ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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 ()
 

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 30 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 37 of file UploadHandler.php.

41  {
42  }

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 59 of file UploadHandler.php.

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

59  : string
60  {
61  return $this->to('info');
62  }
+ 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 44 of file UploadHandler.php.

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

◆ 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 54 of file UploadHandler.php.

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

54  : string
55  {
56  return $this->to('rm');
57  }
+ 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 64 of file UploadHandler.php.

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

◆ 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 69 of file UploadHandler.php.

References Vendor\Package\$c, ILIAS\LegalDocuments\Value\DocumentContent\type(), and ILIAS\LegalDocuments\Value\DocumentContent\value().

69  : ?FileInfoResult
70  {
71  return ($this->content)()->map(fn(DocumentContent $c) => new BasicFileInfoResult(
72  $identifier,
73  $identifier,
74  ($this->txt)('updated_document'),
75  strlen($c->value()),
76  $c->type()
77  ))->except(fn() => new Ok(null))->value();
78  }
+ Here is the call graph for this function:

◆ 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 is returned as JSON.

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

Definition at line 49 of file UploadHandler.php.

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

49  : string
50  {
51  return $this->to('upload');
52  }
+ 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 with .

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

Definition at line 80 of file UploadHandler.php.

80  : bool
81  {
82  return false;
83  }

◆ to()

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

Definition at line 85 of file UploadHandler.php.

References ILIAS\Repository\link().

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

85  : string
86  {
87  return ($this->link)($cmd);
88  }
link(string $caption, string $href, bool $new_viewport=false)
+ 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: