BoxHandler extends DocumentHandler implements CloudImportInterface
Table of Contents
Interfaces
Constants
- API_URL_V2 = 'https://api.box.com/2.0'
- ERROR_BAD_JSON = 'DISK_BOX_HANDLER_22005'
- ERROR_CODE_APP_IN_BLACKLIST = 'DISK_DOC_HANDLER_220028'
- ERROR_CODE_APP_NOT_CONFIGURED = 'DISK_DOC_HANDLER_220027'
- ERROR_CODE_INSUFFICIENT_SCOPE = 'DISK_DOC_HANDLER_220022'
- ERROR_CODE_INVALID_ACCESS_LEVEL = 'DISK_DOC_HANDLER_220026'
- ERROR_CODE_INVALID_CREDENTIALS = 'DISK_DOC_HANDLER_220023'
- ERROR_CODE_NOT_FOUND = 'DISK_DOC_HANDLER_220030'
- ERROR_CODE_NOT_FOUND_ETAG = 'DISK_DOC_HANDLER_220031'
- ERROR_CODE_NOT_GRANTED_APP = 'DISK_DOC_HANDLER_220025'
- ERROR_CODE_NOT_INSTALLED_APP = 'DISK_DOC_HANDLER_220024'
- ERROR_CODE_UNKNOWN = 'DISK_DOC_HANDLER_220029'
- ERROR_COULD_NOT_FIND_ID = 'DISK_BOX_HANDLER_22014'
- ERROR_COULD_NOT_VIEW_FILE = 'DISK_BOX_HANDLER_22013'
- ERROR_HTTP_CREATE_BLANK = 'DISK_BOX_HANDLER_22004'
- ERROR_HTTP_DELETE_FILE = 'DISK_BOX_HANDLER_22006'
- ERROR_HTTP_DOWNLOAD_FILE = 'DISK_BOX_HANDLER_22007'
- ERROR_HTTP_GET_LOCATION_FOR_UPLOAD = 'DISK_BOX_HANDLER_22009'
- ERROR_HTTP_GET_METADATA = 'DISK_BOX_HANDLER_22008'
- ERROR_HTTP_INSERT_PERMISSION = 'DISK_BOX_HANDLER_22010'
- ERROR_HTTP_LIST_FOLDER = 'DISK_BOX_HANDLER_22015'
- ERROR_HTTP_RESUMABLE_UPLOAD = 'DISK_BOX_HANDLER_22012'
- ERROR_INVALID_RESPONSE_STATUS = 'DISK_DOC_HANDLER_22002'
- ERROR_METHOD_IS_NOT_SUPPORTED = 'DISK_BOX_HANDLER_22001'
- ERROR_NOT_INSTALLED_SOCSERV = 'DISK_BOX_HANDLER_22002'
- ERROR_REQUIRED_PARAMETER = 'DISK_DOC_HANDLER_22003'
- ERROR_UNSUPPORTED_FILE_FORMAT = 'DISK_BOX_HANDLER_22003'
- SPECIFIC_FOLDER_CODE = \Bitrix\Disk\SpecificFolder::CODE_FOR_IMPORT_BOX
Methods
- __construct() : mixed
- checkAccessibleTokenService() : bool
- Execute this method for check potential possibility get access token.
- checkHttpResponse() : bool
- checkViewFile() : bool|null
- Check success view file in service.
- className() : string
- createBlankFile() : FileData|null
- Create new blank file in cloud service.
- createFile() : FileData|null
- Create file in cloud service by upload from us server.
- deleteFile() : bool
- Delete file from cloud service by FileData::id
- downloadFile() : FileData|null
- Download file from cloud service by FileData::id, put contents in FileData::src
- downloadPartFile() : FileData|null
- Download part of file from cloud service by FileData::id, put contents in FileData::src
- getAccessToken() : string
- getCode() : string
- Internal code. Identificate document handler
- getConvertExtension() : mixed
- getDataForViewFile() : string|null
- Get url for showing preview file.
- getErrorByCode() : array<string|int, Error>
- Getting once error with the necessary code.
- getErrorContainer() : mixed
- getErrors() : array<string|int, Error>
- Getting array of errors.
- getErrorsByCode() : array<string|int, Error>
- Getting array of errors with the necessary code.
- getFileMetadata() : array<string|int, mixed>|null
- Gets a file's metadata by ID.
- getName() : string
- Public name document handler. May show in user interface.
- getStorageName() : string
- Public name storage of documents. May show in user interface.
- getUrlForAuthorizeInTokenService() : string
- Return link for authorize user in external service.
- getUserId() : int
- Returns user id.
- hasAccessToken() : bool
- isEditable() : bool
- Detect by extension editable or not
- isNeedConvertExtension() : bool
- Detect by extension needle or not convert? We work with latest office
- isRequiredAuthorization() : bool
- Need re-run oauth authorization?
- listEditableExtensions() : array<string|int, mixed>
- listFolder() : mixed
- Lists folder contents
- queryAccessToken() : $this
- Request and store access token (self::accessToken) for self::userId
- setUserId() : int
- Sets user id.
- wasChangedAfterCreation() : bool
- Tells if file in cloud service was changed. For example, the method compares created date and modified date.
Constants
API_URL_V2
public
mixed
API_URL_V2
= 'https://api.box.com/2.0'
ERROR_BAD_JSON
public
mixed
ERROR_BAD_JSON
= 'DISK_BOX_HANDLER_22005'
ERROR_CODE_APP_IN_BLACKLIST
public
mixed
ERROR_CODE_APP_IN_BLACKLIST
= 'DISK_DOC_HANDLER_220028'
ERROR_CODE_APP_NOT_CONFIGURED
public
mixed
ERROR_CODE_APP_NOT_CONFIGURED
= 'DISK_DOC_HANDLER_220027'
ERROR_CODE_INSUFFICIENT_SCOPE
public
mixed
ERROR_CODE_INSUFFICIENT_SCOPE
= 'DISK_DOC_HANDLER_220022'
ERROR_CODE_INVALID_ACCESS_LEVEL
public
mixed
ERROR_CODE_INVALID_ACCESS_LEVEL
= 'DISK_DOC_HANDLER_220026'
ERROR_CODE_INVALID_CREDENTIALS
public
mixed
ERROR_CODE_INVALID_CREDENTIALS
= 'DISK_DOC_HANDLER_220023'
ERROR_CODE_NOT_FOUND
public
mixed
ERROR_CODE_NOT_FOUND
= 'DISK_DOC_HANDLER_220030'
ERROR_CODE_NOT_FOUND_ETAG
public
mixed
ERROR_CODE_NOT_FOUND_ETAG
= 'DISK_DOC_HANDLER_220031'
ERROR_CODE_NOT_GRANTED_APP
public
mixed
ERROR_CODE_NOT_GRANTED_APP
= 'DISK_DOC_HANDLER_220025'
ERROR_CODE_NOT_INSTALLED_APP
public
mixed
ERROR_CODE_NOT_INSTALLED_APP
= 'DISK_DOC_HANDLER_220024'
ERROR_CODE_UNKNOWN
public
mixed
ERROR_CODE_UNKNOWN
= 'DISK_DOC_HANDLER_220029'
ERROR_COULD_NOT_FIND_ID
public
mixed
ERROR_COULD_NOT_FIND_ID
= 'DISK_BOX_HANDLER_22014'
ERROR_COULD_NOT_VIEW_FILE
public
mixed
ERROR_COULD_NOT_VIEW_FILE
= 'DISK_BOX_HANDLER_22013'
ERROR_HTTP_CREATE_BLANK
public
mixed
ERROR_HTTP_CREATE_BLANK
= 'DISK_BOX_HANDLER_22004'
ERROR_HTTP_DELETE_FILE
public
mixed
ERROR_HTTP_DELETE_FILE
= 'DISK_BOX_HANDLER_22006'
ERROR_HTTP_DOWNLOAD_FILE
public
mixed
ERROR_HTTP_DOWNLOAD_FILE
= 'DISK_BOX_HANDLER_22007'
ERROR_HTTP_GET_LOCATION_FOR_UPLOAD
public
mixed
ERROR_HTTP_GET_LOCATION_FOR_UPLOAD
= 'DISK_BOX_HANDLER_22009'
ERROR_HTTP_GET_METADATA
public
mixed
ERROR_HTTP_GET_METADATA
= 'DISK_BOX_HANDLER_22008'
ERROR_HTTP_INSERT_PERMISSION
public
mixed
ERROR_HTTP_INSERT_PERMISSION
= 'DISK_BOX_HANDLER_22010'
ERROR_HTTP_LIST_FOLDER
public
mixed
ERROR_HTTP_LIST_FOLDER
= 'DISK_BOX_HANDLER_22015'
ERROR_HTTP_RESUMABLE_UPLOAD
public
mixed
ERROR_HTTP_RESUMABLE_UPLOAD
= 'DISK_BOX_HANDLER_22012'
ERROR_INVALID_RESPONSE_STATUS
public
mixed
ERROR_INVALID_RESPONSE_STATUS
= 'DISK_DOC_HANDLER_22002'
ERROR_METHOD_IS_NOT_SUPPORTED
public
mixed
ERROR_METHOD_IS_NOT_SUPPORTED
= 'DISK_BOX_HANDLER_22001'
ERROR_NOT_INSTALLED_SOCSERV
public
mixed
ERROR_NOT_INSTALLED_SOCSERV
= 'DISK_BOX_HANDLER_22002'
ERROR_REQUIRED_PARAMETER
public
mixed
ERROR_REQUIRED_PARAMETER
= 'DISK_DOC_HANDLER_22003'
ERROR_UNSUPPORTED_FILE_FORMAT
public
mixed
ERROR_UNSUPPORTED_FILE_FORMAT
= 'DISK_BOX_HANDLER_22003'
SPECIFIC_FOLDER_CODE
public
mixed
SPECIFIC_FOLDER_CODE
= \Bitrix\Disk\SpecificFolder::CODE_FOR_IMPORT_BOX
Methods
__construct()
public
__construct(mixed $userId) : mixed
Parameters
- $userId : mixed
checkAccessibleTokenService()
Execute this method for check potential possibility get access token.
public
checkAccessibleTokenService() : bool
Tags
Return values
boolcheckHttpResponse()
public
checkHttpResponse(HttpClient $http) : bool
Parameters
- $http : HttpClient
Return values
boolcheckViewFile()
Check success view file in service.
public
checkViewFile(FileData $fileData) : bool|null
Parameters
- $fileData : FileData
Return values
bool|nullclassName()
public
static className() : string
Return values
string —the fully qualified name of this class.
createBlankFile()
Create new blank file in cloud service.
public
createBlankFile(FileData $fileData) : FileData|null
It is not necessary set shared rights on file.
Parameters
- $fileData : FileData
Return values
FileData|nullcreateFile()
Create file in cloud service by upload from us server.
public
createFile(FileData $fileData) : FileData|null
Necessary set shared rights on file for common work.
Parameters
- $fileData : FileData
Return values
FileData|nulldeleteFile()
Delete file from cloud service by FileData::id
public
deleteFile(FileData $fileData) : bool
Parameters
- $fileData : FileData
Return values
booldownloadFile()
Download file from cloud service by FileData::id, put contents in FileData::src
public
downloadFile(FileData $fileData) : FileData|null
Parameters
- $fileData : FileData
Return values
FileData|nulldownloadPartFile()
Download part of file from cloud service by FileData::id, put contents in FileData::src
public
downloadPartFile(FileData $fileData, mixed $startRange, mixed $chunkSize) : FileData|null
Parameters
- $fileData : FileData
- $startRange : mixed
- $chunkSize : mixed
Return values
FileData|nullgetAccessToken()
public
getAccessToken() : string
Return values
stringgetCode()
Internal code. Identificate document handler
public
static getCode() : string
Tags
Return values
stringgetConvertExtension()
public
static getConvertExtension(mixed $extension) : mixed
Parameters
- $extension : mixed
getDataForViewFile()
Get url for showing preview file.
public
getDataForViewFile(FileData $fileData) : string|null
Parameters
- $fileData : FileData
Return values
string|nullgetErrorByCode()
Getting once error with the necessary code.
public
getErrorByCode(mixed $code) : array<string|int, Error>
Parameters
- $code : mixed
-
Code of error.
Tags
Return values
array<string|int, Error>getErrorContainer()
public
getErrorContainer() : mixed
getErrors()
Getting array of errors.
public
getErrors() : array<string|int, Error>
Return values
array<string|int, Error>getErrorsByCode()
Getting array of errors with the necessary code.
public
getErrorsByCode(mixed $code) : array<string|int, Error>
Parameters
- $code : mixed
-
Code of error.
Tags
Return values
array<string|int, Error>getFileMetadata()
Gets a file's metadata by ID.
public
getFileMetadata(FileData $fileData) : array<string|int, mixed>|null
Parameters
- $fileData : FileData
Return values
array<string|int, mixed>|null —Describes file (id, title, size)
getName()
Public name document handler. May show in user interface.
public
static getName() : string
Tags
Return values
stringgetStorageName()
Public name storage of documents. May show in user interface.
public
static getStorageName() : string
Tags
Return values
stringgetUrlForAuthorizeInTokenService()
Return link for authorize user in external service.
public
getUrlForAuthorizeInTokenService([string $mode = 'modal' ]) : string
Parameters
- $mode : string = 'modal'
Return values
stringgetUserId()
Returns user id.
public
getUserId() : int
Return values
inthasAccessToken()
public
hasAccessToken() : bool
Return values
boolisEditable()
Detect by extension editable or not
public
static isEditable(mixed $extension) : bool
Parameters
- $extension : mixed
Return values
boolisNeedConvertExtension()
Detect by extension needle or not convert? We work with latest office
public
static isNeedConvertExtension(mixed $extension) : bool
Parameters
- $extension : mixed
Return values
boolisRequiredAuthorization()
Need re-run oauth authorization?
public
isRequiredAuthorization() : bool
Return values
boollistEditableExtensions()
public
static listEditableExtensions() : array<string|int, mixed>
Return values
array<string|int, mixed>listFolder()
Lists folder contents
public
listFolder(mixed $path, mixed $folderId) : mixed
Parameters
- $path : mixed
- $folderId : mixed
queryAccessToken()
Request and store access token (self::accessToken) for self::userId
public
queryAccessToken() : $this
Return values
$thissetUserId()
Sets user id.
public
setUserId(mixed $userId) : int
Parameters
- $userId : mixed
Return values
intwasChangedAfterCreation()
Tells if file in cloud service was changed. For example, the method compares created date and modified date.
public
wasChangedAfterCreation(array<string|int, mixed> $currentMetadata[, array<string|int, mixed> $oldMetadata = array() ]) : bool
Parameters
- $currentMetadata : array<string|int, mixed>
-
Metadata (@see \Bitrix\Disk\Document::getFileMetadata());
- $oldMetadata : array<string|int, mixed> = array()
-
Old metadata.