OnlyOfficeHandler extends DocumentHandler implements FileCreatable, IViewer
Table of Contents
Interfaces
- FileCreatable
- IViewer
- Interface IViewer
Constants
- CMD_FORCE_SAVE = 'forcesave'
- CMD_META = 'meta'
- 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_INVALID_RESPONSE_STATUS = 'DISK_DOC_HANDLER_22002'
- ERROR_REQUIRED_PARAMETER = 'DISK_DOC_HANDLER_22003'
- SPECIFIC_FOLDER_CODE = \Bitrix\Disk\SpecificFolder::CODE_FOR_UPLOADED_FILES
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
- Creates new blank file in cloud service.
- createFile() : FileData
- Create file in cloud service by upload from us server.
- deleteFile() : bool
- Deletes file from cloud service by FileData::id
- disconnectUserFromDocument() : Result
- downloadFile() : FileData|null
- Downloads file from cloud service by FileData::id, put contents in FileData::src
- downloadPartFile() : FileData|null
- Downloads 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() : array<string|int, mixed>|null
- Get data 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.
- 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
- isEnabled() : bool
- isNeedConvertExtension() : bool
- Detect by extension needle or not convert? We work with latest office
- isRequiredAuthorization() : bool
- Need re-run oauth authorization?
- isValidToken() : Result
- listEditableExtensions() : array<string|int, mixed>
- queryAccessToken() : $this
- Requests and store access token (self::accessToken) for self::userId
- renameDocument() : Result
- setUserId() : int
- Sets user id.
- shouldRestrictedBySize() : bool
- wasChangedAfterCreation() : bool
- Tells if file in cloud service was changed. For example, the method compares created date and modified date.
Constants
CMD_FORCE_SAVE
public
mixed
CMD_FORCE_SAVE
= 'forcesave'
CMD_META
public
mixed
CMD_META
= 'meta'
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_INVALID_RESPONSE_STATUS
public
mixed
ERROR_INVALID_RESPONSE_STATUS
= 'DISK_DOC_HANDLER_22002'
ERROR_REQUIRED_PARAMETER
public
mixed
ERROR_REQUIRED_PARAMETER
= 'DISK_DOC_HANDLER_22003'
SPECIFIC_FOLDER_CODE
public
mixed
SPECIFIC_FOLDER_CODE
= \Bitrix\Disk\SpecificFolder::CODE_FOR_UPLOADED_FILES
Methods
__construct()
public
__construct(mixed $userId) : mixed
Parameters
- $userId : mixed
checkAccessibleTokenService()
Execute this method for check potential possibility get access token.
public
checkAccessibleTokenService() : bool
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()
Creates 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
Parameters
- $fileData : FileData
Return values
FileDatadeleteFile()
Deletes file from cloud service by FileData::id
public
deleteFile(FileData $fileData) : bool
Parameters
- $fileData : FileData
Return values
booldisconnectUserFromDocument()
public
static disconnectUserFromDocument(string $documentKey, array<string|int, mixed> $userIds) : Result
Parameters
- $documentKey : string
- $userIds : array<string|int, mixed>
Return values
ResultdownloadFile()
Downloads 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()
Downloads 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
Max length is 10 chars
Return values
stringgetConvertExtension()
public
static getConvertExtension(mixed $extension) : mixed
Parameters
- $extension : mixed
getDataForViewFile()
Get data for showing preview file.
public
getDataForViewFile(FileData $fileData) : array<string|int, mixed>|null
Array must be contains keys: id, viewUrl, neededDelete, neededCheckView
Parameters
- $fileData : FileData
Return values
array<string|int, mixed>|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
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
boolisEnabled()
public
static isEnabled() : bool
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
boolisValidToken()
public
static isValidToken(string $token) : Result
Parameters
- $token : string
Return values
ResultlistEditableExtensions()
public
static listEditableExtensions() : array<string|int, mixed>
Return values
array<string|int, mixed>queryAccessToken()
Requests and store access token (self::accessToken) for self::userId
public
queryAccessToken() : $this
Return values
$thisrenameDocument()
public
static renameDocument(string $documentKey, string $newName) : Result
Parameters
- $documentKey : string
- $newName : string
Return values
ResultsetUserId()
Sets user id.
public
setUserId(mixed $userId) : int
Parameters
- $userId : mixed
Return values
intshouldRestrictedBySize()
public
static shouldRestrictedBySize(int $fileSize) : bool
Parameters
- $fileSize : int
Return values
boolwasChangedAfterCreation()
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.