FileAccess Orion

Handler extends SecuredServerPlugin
in package

Implement vimeo handler

This class provides interfaces for system hooks that handle vimeo updates related to content changes This class implements a cli command to trigger uploads and several other to administrate videos in bulk

Tags
category

Plugin

author

Tobias Teichner webmaster@teichner.biz

since

File available since v5.71.0

Table of Contents

$config  : stdClass|null
Buffer for configuration
$defaultPermissions  : array<string|int, mixed>
The default permission set
$dir  : string
The implementation directory
$name  : string
Name of the plugin
$api  : Vimeo|null
The api instance
$max_tries  : int
Maximum limit for retries on check render progress per video 30 * 45 will be 22 1/2 minutes
__construct()  : mixed
Handler constructor.
AssignAssetToRelatedFolder()  : Result
Assign to linked folder
GetAccessList()  : array<string|int, mixed>
Name()  : string
OnAddOrUpdateContent()  : mixed
OnCommandLineInterfaceCall()  : mixed
Cli to recreate a whole set of vimeo assets
OnDeleteContent()  : mixed
OnGeneralSearchFields()  : mixed
Triggered on get general search fields of video asset
OnGetEntityAttributes()  : mixed
Add input field to core object
OnHandleUploadAssignMaster()  : mixed
Triggered as side effect on upload of file to asset object
OnMapArrayIncludes()  : mixed
OnReCreateAsset()  : mixed
Called when assets are re created by system command
OnRegisterWidgetIncludes()  : mixed
OnSearchFields()  : mixed
RegisterHooks()  : array<string|int, mixed>
Register system hooks
RequestOnUrlParsed()  : mixed
The request hook
ServeRequest()  : mixed
Serve request
settings()  : Result|object
Get/Set the settings
SetupTemplate()  : mixed
UploadAsset()  : Result
Handler method to actually upload the asset
handleConfig()  : void
Handle the context requests
hasAccess()  : bool
Check if endpoint is accessible for this user group
isInContext()  : bool
Is in certain context?
setupAttributes()  : void
Set up the permission attribute table
addDomains()  : void
Add whitelist domains
connect()  : Vimeo|null
Get connection
deleteFolder()  : mixed
Delete a vimeo folder by id
deleteVideo()  : mixed
Delete the video from platform
handleConfigPreset()  : mixed
Handle the context requests
listFolders()  : mixed
List vide folders
listVideos()  : mixed
Load a list of videos in the manor of data tables
publicUrl()  : Result
Fetch the public url to video
resolveAssetName()  : mixed
Resolve the assigned name of an asset
resolveAssetPublicUrl()  : mixed
Resolve the asset public url to embed it in a player
resolveVideoData()  : Result

Properties

$defaultPermissions

The default permission set

protected array<string|int, mixed> $defaultPermissions = [['endpoint' => 'config', 'root' => true, 'admin' => true]]

$max_tries

Maximum limit for retries on check render progress per video 30 * 45 will be 22 1/2 minutes

private int $max_tries = 30

Methods

__construct()

Handler constructor.

public __construct() : mixed
Return values
mixed

AssignAssetToRelatedFolder()

Assign to linked folder

public AssignAssetToRelatedFolder(Asset $asset) : Result
Parameters
$asset : Asset
Return values
Result

GetAccessList()

public GetAccessList(User $user) : array<string|int, mixed>
Parameters
$user : User
Return values
array<string|int, mixed>

OnCommandLineInterfaceCall()

Cli to recreate a whole set of vimeo assets

public OnCommandLineInterfaceCall( $param) : mixed
Parameters
$param :

HookArgument

Return values
mixed

OnGeneralSearchFields()

Triggered on get general search fields of video asset

public OnGeneralSearchFields( $param) : mixed

Used to add information about the vimeo video to the title field

Parameters
$param :

HookArgument

Return values
mixed

OnGetEntityAttributes()

Add input field to core object

public OnGetEntityAttributes(HookArgument $reference) : mixed
Parameters
$reference : HookArgument
Return values
mixed

OnHandleUploadAssignMaster()

Triggered as side effect on upload of file to asset object

public OnHandleUploadAssignMaster( $param) : mixed
Parameters
$param :

HookArgument

Return values
mixed

OnMapArrayIncludes()

public OnMapArrayIncludes( $param) : mixed
Parameters
$param :

HookArgument

Return values
mixed

OnReCreateAsset()

Called when assets are re created by system command

public OnReCreateAsset( $param) : mixed
Parameters
$param :

HookArgument

Return values
mixed

OnRegisterWidgetIncludes()

public OnRegisterWidgetIncludes( $param) : mixed
Parameters
$param :

HookArgument

Return values
mixed

OnSearchFields()

public OnSearchFields( $param) : mixed
Parameters
$param :

HookArgument

Return values
mixed

RegisterHooks()

Register system hooks

public RegisterHooks() : array<string|int, mixed>

Register a set of handler functions to be called in certain positions.

Return values
array<string|int, mixed>

A list of hooks to register

RequestOnUrlParsed()

The request hook

public RequestOnUrlParsed(HookArgument $param) : mixed
Parameters
$param : HookArgument

The hook values

Return values
mixed

ServeRequest()

Serve request

public ServeRequest(Request $request, Response $response) : mixed

Serve the request and return appropriate result.

Parameters
$request : Request

The http request object

$response : Response
Return values
mixed

settings()

Get/Set the settings

public settings([null|object $new = null ]) : Result|object

This method is cached per instance

Parameters
$new : null|object = null

New set of settings to store

Return values
Result|object

SetupTemplate()

public SetupTemplate([mixed $data = null ]) : mixed
Parameters
$data : mixed = null
Tags
inheritDoc
Return values
mixed

UploadAsset()

Handler method to actually upload the asset

public UploadAsset(Asset $asset[, string|null $l = null ][, bool $force = false ]) : Result
Parameters
$asset : Asset

The asset instance

$l : string|null = null

The target language

$force : bool = false

When true, force the new upload

Return values
Result

A system result object

hasAccess()

Check if endpoint is accessible for this user group

protected hasAccess(string|array<string|int, string> $right[, Response|null $response = null ][, User|null $user = null ]) : bool
Parameters
$right : string|array<string|int, string>
$response : Response|null = null
$user : User|null = null
Return values
bool

isInContext()

Is in certain context?

protected isInContext(HookArgument $param, string $type, string $widget) : bool
Parameters
$param : HookArgument

The hook argument

$type : string

The type can be scss, css and js to search in widgets or _ to search in global includes

$widget : string

The widget to search for

Return values
bool

setupAttributes()

Set up the permission attribute table

protected setupAttributes( &$attributes,  $l) : void
Parameters
$attributes :

array List of attributes

$l :

string The language

Return values
void

addDomains()

Add whitelist domains

private addDomains(string $id) : void
Parameters
$id : string
Return values
void

connect()

Get connection

private connect([bool $force = false ]) : Vimeo|null
Parameters
$force : bool = false
Return values
Vimeo|null

deleteFolder()

Delete a vimeo folder by id

private deleteFolder(Request $request, Response $response) : mixed
Parameters
$request : Request
$response : Response
Return values
mixed

deleteVideo()

Delete the video from platform

private deleteVideo(Request $request, Response $response) : mixed
Parameters
$request : Request
$response : Response
Return values
mixed

handleConfigPreset()

Handle the context requests

private handleConfigPreset(Request $request, Response $response) : mixed
Parameters
$request : Request
$response : Response
Return values
mixed

listVideos()

Load a list of videos in the manor of data tables

private listVideos(Request $request, Response $response) : mixed
Parameters
$request : Request
$response : Response
Return values
mixed

publicUrl()

Fetch the public url to video

private publicUrl(Asset $asset[, string|null $vimeo_url = null ]) : Result

This method uses the object cache

Parameters
$asset : Asset
$vimeo_url : string|null = null
Return values
Result

resolveAssetName()

Resolve the assigned name of an asset

private resolveAssetName(Request $request, Response $response) : mixed
Parameters
$request : Request
$response : Response
Return values
mixed

resolveAssetPublicUrl()

Resolve the asset public url to embed it in a player

private resolveAssetPublicUrl(Request $request, Response $response) : mixed

This method uses a cache

Parameters
$request : Request
$response : Response
Return values
mixed

resolveVideoData()

private resolveVideoData(int $id) : Result
Parameters
$id : int
Return values
Result

Search results