Nextcloud PHP API (stable18)

IEditor

Tags
since
18.0.0

Table of Contents

getCreators()  : \OCP\DirectEditing\ACreateFromTemplate[]|\OCP\DirectEditing\ACreateEmpty[]
Return a list of file creation options to be presented to the user
getId()  : string
Return a unique identifier for the editor
getMimetypes()  : string[]
A list of mimetypes that should open the editor by default
getMimetypesOptional()  : string[]
A list of mimetypes that can be opened in the editor optionally
getName()  : string
Return a readable name for the editor
isSecure()  : bool
Return if the view is able to securely view a file without downloading it to the browser
open()  : Response
Return a template response for displaying the editor

Methods

getCreators()

Return a list of file creation options to be presented to the user

public getCreators() : \OCP\DirectEditing\ACreateFromTemplate[]|\OCP\DirectEditing\ACreateEmpty[]
Tags
since
18.0.0
Return values
\OCP\DirectEditing\ACreateFromTemplate[]|\OCP\DirectEditing\ACreateEmpty[]

getId()

Return a unique identifier for the editor

public getId() : string

e.g. richdocuments

Tags
since
18.0.0
Return values
string

getMimetypes()

A list of mimetypes that should open the editor by default

public getMimetypes() : string[]
Tags
since
18.0.0
Return values
string[]

getMimetypesOptional()

A list of mimetypes that can be opened in the editor optionally

public getMimetypesOptional() : string[]
Tags
since
18.0.0
Return values
string[]

getName()

Return a readable name for the editor

public getName() : string

e.g. Collabora Online

Tags
since
18.0.0
Return values
string

isSecure()

Return if the view is able to securely view a file without downloading it to the browser

public isSecure() : bool
Tags
since
18.0.0
Return values
bool

open()

Return a template response for displaying the editor

public open(IToken $token) : Response

open can only be called once when the client requests the editor with a one-time-use token For handling editing and later requests, editors need to impelement their own token handling and take care of invalidation

This behavior is similar to the current direct editing implementation in collabora where we generate a one-time token and switch over to the regular wopi token for the actual editing/saving process

Parameters
$token : IToken
Tags
since
18.0.0
Return values
Response

Search results