| java.lang.Object | |
| ↳ | org.mule.modules.boxnet.BoxConnector |
Known Direct Subclasses
|
Known Indirect Subclasses
|
Box.net Cloud Connector Module.
| Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| String | AUTH_URL | The url where the user needs to enter his credentials | |||||||||
| String | BOX_AUTH_TICKET | ||||||||||
| String | BOX_AUTH_TOKEN | ||||||||||
| Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| apiKey | The API key obtained when registering a project with the Box platform. | ||||||||||
| authCallback | |||||||||||
| authToken | |||||||||||
| callbackPath | The url where box.net will direct the authentication callback. | ||||||||||
| callbackPort | The port where the authentication callback will be listening on Defaults to 8080 | ||||||||||
| client | |||||||||||
| decoder | |||||||||||
| httpConnector | The http connector to be used when serving the authorization callback. | ||||||||||
| logger | |||||||||||
| muleContext | |||||||||||
| postAuthFlow | The name of a flow to be invoked after an authorization callback is received. | ||||||||||
| postAuthorizationFlow | |||||||||||
| restoreAuthTokenFlow | The name of a flow to be executed each time the authentication token needs to be used. | ||||||||||
| restoreTokenFlow | Actual restore token flow egarly fetched | ||||||||||
| saveAuthTokenFlow | The name of a flow to be executed each time an authentication token is received. | ||||||||||
| saveTokenFlow | Actual save token flow egarly fetched | ||||||||||
| usesCallback | If true, an http inbound endpoint will be set in place to receive a callback from box.net with the authToken once the user has authenticated. | ||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
This processor adds file or folder to tags list.
| |||||||||||
After the user authenticates the ticket obtained with the get-ticket processor,
there're two ways to get the required auth token:
| |||||||||||
Redirects the browser to box authorization page so that the user can enter his credentials.
| |||||||||||
Create a new folder
| |||||||||||
Deletes a file or folder
| |||||||||||
Downloads a file an returns its contents as a byte[]
| |||||||||||
This processor returns all the user's tags.
| |||||||||||
Gets information about a file
| |||||||||||
Get and access ticket using the configured apiKey.
| |||||||||||
This processor is used to get a user's files and folders tree.
| |||||||||||
This method initiaes the box client and the auth callback.
| |||||||||||
Logs out the user associated with the authorization token
| |||||||||||
This processor moves a file or folder to another folder.
| |||||||||||
This processor privately shares a file or folder with another user(s).
| |||||||||||
Makes a public share of a file or folder
| |||||||||||
This processor unshares a public shared file or folder
| |||||||||||
Create a new user in box.net
| |||||||||||
This processor renames a file or folder.
| |||||||||||
This processor sets a description to a file or folder.
| |||||||||||
Receives a comma separated list of paths and uploads the corresponding
files.
| |||||||||||
Receives an input stream and uploads its content as a file
| |||||||||||
This method is used to verify user registration email
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
org.mule.api.context.MuleContextAware
| |||||||||||
The url where the user needs to enter his credentials
The API key obtained when registering a project with the Box platform. For more information about this field please refer to http://developers.box.net/
The url where box.net will direct the authentication callback. For more info look at http://developers.box.net/w/page/12923915/ApiAuthentication Defaults to box_auth_callback
The port where the authentication callback will be listening on Defaults to 8080
The http connector to be used when serving the authorization callback. If usesCallback is false then this connector is not used. If not provided, the default http connector will be used. However, specifying an https connector instead is adviced.
The name of a flow to be invoked after an authorization callback is received. If usesCallback is false then this flow will never be invoked. This flow will receive a copy of the current mule message carrying two additional invocation variables:
The name of a flow to be executed each time the authentication token needs to be used. If this attribute is specified, then a flow with this named will be fetch on the registry and invoked every time the auth token is needed. This flow will receive a copy of the current mule message and must set the payload to a valid auth token. If the flow fails to accomplish that, an exception will be thrown For example: <box:config apiKey="${apiKey}" restoreAuthTokenFlow="restoreTokenFlow" saveAuthTokenFlow="saveTokenFlow"/> <flow name="restoreTokenFlow"> <objectstore:retrieve key="flowVars['currentUserId']"/> </flow> <flow name="save"> <objectstore:store key="flowVars['currentUserId']" value-ref="#[flowVars['boxAuthToken']]"/> </flow> If this attribute is not specified, then the token will be fetched from memory. Notice that this means the token won't survive an application restart and that the connector would be incapable of handling two different concurrent accounts
Actual restore token flow egarly fetched
The name of a flow to be executed each time an authentication token is received. If this attribute is specified, then a flow with this name will be fetch on the registry and invoked every time the auth token is obtained. This flow will receive a copy of the current mule message carrying two additional invocation variables:
Actual save token flow egarly fetched
If true, an http inbound endpoint will be set in place to receive a callback from box.net with the authToken once the user has authenticated. If this callback is in place, there's no need for you to manually invoke the get-auth-token processor. For more info look at http://developers.box.net/w/page/12923915/ApiAuthentication Defaults to false
This processor adds file or folder to tags list.
| message | The current mule message |
|---|---|
| csvTags | Comma separated list of tags |
| target | Can be either 'file' or 'folder' depending on what do you want to add |
| targetId | The id of a file or folder to be added |
After the user authenticates the ticket obtained with the get-ticket processor, there're two ways to get the required auth token:
| message | The current mule message |
|---|---|
| ticket | The ticket to authenticate against. |
| IllegalArgumentException | if the ticket does not match a logged user |
|---|
Redirects the browser to box authorization page so that the user can enter his credentials. The new location will be https://www.box.net/api/1.0/auth/<<ticket>>
| message | The current mule message |
|---|---|
| ticket | The ticket to be authorized |
Create a new folder
| message | The current mule message |
|---|---|
| parentFolderId | The id of the parent folder |
| folderName | The name of the folder you want to create |
| share | Specifies if the folder is shared. This parameter is optional and defaults to false |
CreateFolderResponse with
data about the operation status and info about the newly created folder (if successful)
Deletes a file or folder
| message | The current mule message |
|---|---|
| target | The type of item to be shared. This can be set as 'file' or 'folder'. Any other value will throw a IllegalArgumentException |
| targetId | The id of the item you wish to delete. If the target is a folder, this will be the folder_id. If the target is a file, this will be the file_id. |
DeleteResponse with data about the operation statusDownloads a file an returns its contents as a byte[]
| message | The current mule message |
|---|---|
| fileId | The id of the file we want to download |
This processor returns all the user's tags.
On successful you will get an xml representing the tags that looks like this:
| message | The current mule message |
|---|---|
| encoding | Encoding to use when decoding from BASE64. Optional, defaults to UTF-8 |
Gets information about a file
| message | The current mule message |
|---|---|
| fileId | The id of the file you want info about |
GetFileInfoResponse
Get and access ticket using the configured apiKey. Optionally, you can ask the connector to automatically redirect the browser to box authorization page so that the user can enter his credentials. This is done by invoking org.mule.modules.boxnet.BoxConnector.authorizeTicket(MuleMessage, String) Otherwise, the user needs to manually go to https://www.box.net/api/1.0/auth/<<ticket>> Either way, the connector WILL NOT be responsible for storing this ticket. For more info look at http://developers.box.net/w/page/12923915/ApiAuthentication
| message | The current mule message |
|---|---|
| redirect | If true, then the browser will be automatically redirected to https://www.box.net/api/1.0/auth/<<ticket>> |
This processor is used to get a user's files and folders tree. 'folderId' param defines root folder from which the tree begins. 'csvParams' is comma separated list where you can set additional parameters, which are: onelevel - make a tree of one level depth, so you will get only files and folders stored in folder which folder_id you have provided. nofiles - include folders only in result tree, no files. nozip - do not zip tree xml. On successful result you will receive 'listing_ok' as status and the tree xml. if you haven't set 'nozip' as a parameter (it's set by default), then you have to unzip it. Then you will get xml like this: (note that updatedand createdare UNIX timestamps in PST).
| message | The current mule message |
|---|---|
| folderId | The ID of the root folder from which the tree begins. If this value is "0", the user's full account tree is returned. Defaults to zero |
| csvParams | Comma separated list of params. This is optional and defaults to 'nozip' |
| encoding | Optional parameter to specify the encoding to use when decoding BASE64. Defaults to UTF-8 |
GetAccountTreeResponse with
data about the operation status and info about the inspected folder (if successful)
This method initiaes the box client and the auth callback. Also, it fetches the save/restore flows (if specified). If those are specified but don't exist in the registry, then IllegalArgumentException is thrown
| IllegalArgumentException | if restore/save token flows are specified but don't exist |
|---|---|
| MuleException |
Logs out the user associated with the authorization token
| message | The current mule message |
|---|
LogoutResponse with data about the operation status
This processor moves a file or folder to another folder. On a successful result, status will be 's_move_node'. If the result wasn't successful, status field can be: 'e_move_node', 'not_logged_in', 'application_restricted'.
| message | The current mule message |
|---|---|
| target | Can be either 'file' or 'folder' depending on what do you |
| targetId | Is the id of a file or folder to be moved |
| destinationId | Is the destination folder id. |
| MuleException |
|---|
This processor privately shares a file or folder with another user(s). 'target' param, 'target_id' is . 'emails' params is an array of emails of users' to share files with. if 'notify' param is , 'message' param . Note: currently only files can be shared privately.
| muleMessage | The current mule message |
|---|---|
| target | Should be either 'file' or 'folder' |
| targetId | The id of the file or folder to be shared |
| csvMails | Comma separated list of email addresses of the users that will receive the share |
| notify | If true, then a notification email will be sent to users. Optional parameter, defaults to true |
| message | Is a message to be included in the notification email. Optional parameter, defaults to an empty string |
Makes a public share of a file or folder
| muleMessage | The current mule message |
|---|---|
| target | The type of item to be shared. This can be set as 'file' or 'folder'. Any other value will throw a IllegalArgumentException |
| targetId | The id of the item you wish to share. If the target is a folder, this will be the folder_id. If the target is a file, this will be the file_id. |
| password | The password to protect the folder or file. |
| message | An message to be included in a notification email. |
PublicShareResponse with
data about the operation status and info about the shared folder (if successful)This processor unshares a public shared file or folder
| message | The current mule message |
|---|---|
| target | Shoud be either 'file' or 'folder' |
| targetId | Is id of a file or folder to be unshared |
Create a new user in box.net
| The user's email | |
| password | The user's password |
RegisterNewUserResponse with
data about the operation status and info about the newly created user (if successful)
This processor renames a file or folder.
| message | The current mule message |
|---|---|
| target | Can be either 'file' or 'folder' depending on what you want to rename |
| targetId | Is the id of a file or folder to be renamed |
| newName | Is the new name for a file or folder |
| message | |
|---|---|
| ticket | |
| authToken |
| apiKey |
|---|
| callbackPath |
|---|
| callbackPort |
|---|
This processor sets a description to a file or folder.
| message | The current mule message |
|---|---|
| target | Can be either 'file' or 'folder' |
| targetId | The id of the folder/file you want to modify |
| description | The description you want to set |
| httpConnector |
|---|
| context |
|---|
| postAuthFlow |
|---|
| restoreAuthTokenFlow |
|---|
| saveAuthTokenFlow |
|---|
| usesCallback |
|---|
Receives a comma separated list of paths and uploads the corresponding files.
| message | The current mule message |
|---|---|
| paths | A List of Strings with the paths where the files are. Defaults to payload |
| folderId | The id of the parent folder. Defaults to 0 (the root folder) |
UploadResponse with
data about the operation status and info about the newly uploaded files (if successful)
Receives an input stream and uploads its content as a file
| message | The current mule message |
|---|---|
| folderId | The id of the parent folder. Defaults to 0 which is the root folder |
| filename | The name we want the file to have on box.net |
| input | InputStream with the contents of the file. Defaults to the message payload. |
UploadResponse with
data about the operation status and info about the newly uploaded file (if successful)
This method is used to verify user registration email
| message | The current mule message |
|---|---|
| loginName | The login username of the user for which you would like to verify registration. |