ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\LegalDocuments\FileUpload\UploadHandler Class Reference
+ Inheritance diagram for ILIAS\LegalDocuments\FileUpload\UploadHandler:
+ Collaboration diagram for ILIAS\LegalDocuments\FileUpload\UploadHandler:

Public Member Functions

 __construct (private readonly Closure $link, private readonly Closure $content, private readonly Closure $txt)
 
 getFileIdentifierParameterName ()
 
 getUploadURL ()
 
 getFileRemovalURL ()
 
 getExistingFileInfoURL ()
 
 getInfoForExistingFiles (array $file_ids)
 
 getInfoResult (string $identifier)
 
 supportsChunkedUploads ()
 
 getFileIdentifierParameterName ()
 
 getUploadURL ()
 
 getFileRemovalURL ()
 
 getExistingFileInfoURL ()
 
 getInfoForExistingFiles (array $file_ids)
 
 getInfoResult (string $identifier)
 
 supportsChunkedUploads ()
 

Private Member Functions

 to (string $cmd)
 

Additional Inherited Members

- Data Fields inherited from ILIAS\UI\Component\Input\Field\UploadHandler
const DEFAULT_FILE_ID_PARAMETER = 'file_id'
 

Detailed Description

Definition at line 31 of file UploadHandler.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\LegalDocuments\FileUpload\UploadHandler::__construct ( private readonly Closure  $link,
private readonly Closure  $content,
private readonly Closure  $txt 
)
Parameters
Closure(string)string $link
Closure()Result<DocumentContent> $content
Closure(string)string $txt

Definition at line 38 of file UploadHandler.php.

42 {
43 }

Member Function Documentation

◆ getExistingFileInfoURL()

ILIAS\LegalDocuments\FileUpload\UploadHandler::getExistingFileInfoURL ( )
Returns
string of the URL where in GUI existing files are handled. The URL is called by GET with a field with name from getFileIdentifierParameterName() and the FileID of the desired file. Return a FI

Implements ILIAS\UI\Component\Input\Field\UploadHandler.

Definition at line 60 of file UploadHandler.php.

60 : string
61 {
62 return $this->to('info');
63 }

References ILIAS\LegalDocuments\FileUpload\UploadHandler\to().

+ Here is the call graph for this function:

◆ getFileIdentifierParameterName()

ILIAS\LegalDocuments\FileUpload\UploadHandler::getFileIdentifierParameterName ( )
Returns
string defaults to self::DEFAULT_FILE_ID_PARAMETER

Implements ILIAS\UI\Component\Input\Field\UploadHandler.

Definition at line 45 of file UploadHandler.php.

45 : string
46 {
47 return UploadHandlerInterface::DEFAULT_FILE_ID_PARAMETER;
48 }

◆ getFileRemovalURL()

ILIAS\LegalDocuments\FileUpload\UploadHandler::getFileRemovalURL ( )
Returns
string of the URL where in GUI deleted files are handled. The URL is called by POST with a field with name from getFileIdentifierParameterName() and the FileID of the deleted file.

Implements ILIAS\UI\Component\Input\Field\UploadHandler.

Definition at line 55 of file UploadHandler.php.

55 : string
56 {
57 return $this->to('rm');
58 }

References ILIAS\LegalDocuments\FileUpload\UploadHandler\to().

+ Here is the call graph for this function:

◆ getInfoForExistingFiles()

ILIAS\LegalDocuments\FileUpload\UploadHandler::getInfoForExistingFiles ( array  $file_ids)
Parameters
array$file_ids
Returns
BasicFileInfoResult[]

Implements ILIAS\UI\Component\Input\Field\UploadHandler.

Definition at line 65 of file UploadHandler.php.

65 : array
66 {
67 return [];
68 }

◆ getInfoResult()

ILIAS\LegalDocuments\FileUpload\UploadHandler::getInfoResult ( string  $identifier)
Returns
null|FileInfoResult for the file with the given identifier or null if the file does not exist.

Implements ILIAS\UI\Component\Input\Field\UploadHandler.

Definition at line 70 of file UploadHandler.php.

70 : ?FileInfoResult
71 {
72 return ($this->content)()->map(fn(DocumentContent $c) => new BasicFileInfoResult(
73 $identifier,
74 $identifier,
75 ($this->txt)('updated_document'),
76 strlen($c->value()),
77 $c->type()
78 ))->except(fn() => new Ok(null))->value();
79 }
$c
Definition: deliver.php:25

References $c.

◆ getUploadURL()

ILIAS\LegalDocuments\FileUpload\UploadHandler::getUploadURL ( )
Returns
string of the URL where dropped files are sent to. This URL must make sure the upload is handled and a \ILIAS\FileUpload\Handler\HandlerResult is returned as JSON.

Implements ILIAS\UI\Component\Input\Field\UploadHandler.

Definition at line 50 of file UploadHandler.php.

50 : string
51 {
52 return $this->to('upload');
53 }

References ILIAS\LegalDocuments\FileUpload\UploadHandler\to().

+ Here is the call graph for this function:

◆ supportsChunkedUploads()

ILIAS\LegalDocuments\FileUpload\UploadHandler::supportsChunkedUploads ( )
Returns
bool if this uploadhandler chan handle Chunked Uploads. These come in multiple requests and must be combined to a single file. If your UploadHandler can handle Chunked Uploads, you can use a UI\Component\Input\Field\Upload\File with .

Implements ILIAS\UI\Component\Input\Field\UploadHandler.

Definition at line 81 of file UploadHandler.php.

81 : bool
82 {
83 return false;
84 }

◆ to()

ILIAS\LegalDocuments\FileUpload\UploadHandler::to ( string  $cmd)
private

Definition at line 86 of file UploadHandler.php.

86 : string
87 {
88 return ($this->link)($cmd);
89 }
link(string $caption, string $href, bool $new_viewport=false)

References ILIAS\Repository\link().

Referenced by ILIAS\LegalDocuments\FileUpload\UploadHandler\getExistingFileInfoURL(), ILIAS\LegalDocuments\FileUpload\UploadHandler\getFileRemovalURL(), and ILIAS\LegalDocuments\FileUpload\UploadHandler\getUploadURL().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: