4.x.x
Upgrading and Migrating Box Connector to Version 5.x - Mule 4
Upgrade Anypoint Connector for Box (Box Connector) from version 4.x to version 5.x to take advantage of new functionality.
Supported Upgrade Paths
From Version | To Version |
---|---|
5.x.x |
Changes in This Release
-
The prefix for all the connector operations changed from mule-box-connector to box.
-
The OAuth 2.0 configuration XML structure changed.
In earlier releases, the XML for the OAuth 2.0 connection element looked like this:
<mule-box-connector:config name="Mule_box_connector_Config" doc:name="Mule-box-connector Config" property_clientId="clientId" property_clientSecret="secret" property_localCallbackConfig="HTTP_Listener_config" property_host="api.box.com" property_port="4439" property_basePath="/2.0" property_protocol="HTTPS" property_responseTimeout="10000" property_localCallbackPath="/callback" property_externalCallbackUrl="http://my-app.cloudhub.io/callback" property_localAuthorizationUrl="http://localhost:8081/authorize" property_authorizationUrl="https://account.box.com/api/oauth2/authorize" property_accessTokenUrl="https://api.box.com/oauth2/token" />
xmlIn the latest release, the XML looks like this:
<box:config name="Box_Connector_Config" doc:name="Box Connector Config" > <box:oauth2security-connection > <box:oauth-authorization-code consumerKey="consumerKey" consumerSecret="consumerSecret" authorizationUrl="https://account.box.com/api/oauth2/authorize" accessTokenUrl="https://api.box.com/oauth2/token" resourceOwnerId=“resourceownerId” /> <box:oauth-callback-config listenerConfig="HTTP_Listener_config" callbackPath="/callback" authorizePath="/authorize" externalCallbackUrl="http://localhost:8081/callback" /> </box:oauth2security-connection> </box:config>
xml
New Operations
New operations for Box Connector 5.0 include:
Box Operation | Description |
---|---|
Upload file |
Uploads a file to Box. For files larger than 50 MB, use the Create upload session operation instead. |
Get file information |
Retrieves detailed information about a file. |
Upload file version |
POST operation that updates a file’s contents. For files larger than 50 MB, use the Create upload session operation instead. |
Create upload session |
Creates an upload session for a new file. Use this operation for uploading files larger than 50 MB. Chunks large uploads into sequential parts that you can then upload individually. Parts can be uploaded in parallel. |
Get upload session |
Returns information about an upload session. |
List parts |
Returns a list of the chunks uploaded to the upload session so far. |
Create upload session for existing file |
Creates an upload session for an existing file. |
Commit upload session |
Closes an upload session and creates a file from the uploaded chunks. |
Upload part of file |
Updates a chunk of an upload session for a file. |
Remove upload session |
Aborts an upload session and discards all data uploaded. |
Upgrade Prerequisites
Before you perform the upgrade, you must create a backup of your files, data, and configurations in case you need to restore to them.
Upgrade Steps
Follow these steps to perform the upgrade:
-
In Anypoint Studio, create a Mule project.
-
In the Mule Palette view, click Search in Exchange.
-
In Add Dependencies to Project, enter
box
in the search field. -
In Available modules, select Box Connector Config and click Add.
-
Click Finish.
-
Verify that the Box Connector dependency version is 5.0.0 in the
pom.xml
file in the Mule project.
Studio upgrades the connector automatically.
Verify the Upgrade
After you install the latest version of the connector, follow these steps to verify the upgrade:
-
In Studio, verify that there are no errors in the Problems or Console views.
-
Verify that there are no problems in the project
pom.xml
file.
Revert the Upgrade
If it is necessary to revert to the previous version of box connector, change the 5.0.0
dependency version in the project’s pom.xml
file to the previous version.
You must update the project’s pom.xml
file in Anypoint Studio.