ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilMDVocabularyUploadHandlerGUI Class Reference
+ Inheritance diagram for ilMDVocabularyUploadHandlerGUI:
+ Collaboration diagram for ilMDVocabularyUploadHandlerGUI:

Public Member Functions

 __construct ()
 ilUIDemoFileUploadHandlerGUI constructor. More...
 
 getInfoResult (string $identifier)
 
 getInfoForExistingFiles (array $file_ids)
 
- Public Member Functions inherited from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler
 __construct ()
 ilUIDemoFileUploadHandlerGUI constructor. More...
 
 getFileIdentifierParameterName ()
 @inheritDoc More...
 
 getUploadURL ()
 @inheritDoc More...
 
 getExistingFileInfoURL ()
 @inheritDoc More...
 
 getFileRemovalURL ()
 @inheritDoc More...
 
 executeCommand ()
 Since this is a ilCtrl aware UploadHandler executeCommand MUST be implemented. More...
 
 getInfoResult (string $identifier)
 
 getInfoForExistingFiles (array $file_ids)
 
 supportsChunkedUploads ()
 
 executeCommand ()
 Since this is a ilCtrl aware UploadHandler executeCommand MUST be implemented. More...
 
 getFileIdentifierParameterName ()
 
 getUploadURL ()
 
 getFileRemovalURL ()
 
 getExistingFileInfoURL ()
 
 getInfoForExistingFiles (array $file_ids)
 
 getInfoResult (string $identifier)
 
 supportsChunkedUploads ()
 

Protected Member Functions

 getUploadResult ()
 
 getRemoveResult (string $identifier)
 
- Protected Member Functions inherited from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler
 readChunkedInformation ()
 
 getUploadResult ()
 
 getRemoveResult (string $identifier)
 

Protected Attributes

Filesystem $temp
 
- Protected Attributes inherited from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler
const CMD_UPLOAD = 'upload'
 
const CMD_REMOVE = 'remove'
 
const CMD_INFO = 'info'
 
HttpServices $http
 
ilCtrl $ctrl
 
FileUpload $upload
 
bool $is_chunked = false
 
int $chunk_index = 0
 
int $amount_of_chunks = 0
 
string $chunk_id = null
 
int $chunk_total_size = 0
 

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 class.ilMDVocabularyUploadHandlerGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilMDVocabularyUploadHandlerGUI::__construct ( )

ilUIDemoFileUploadHandlerGUI constructor.

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

Definition at line 34 of file class.ilMDVocabularyUploadHandlerGUI.php.

35 {
36 global $DIC;
37
38 $this->temp = $DIC->filesystem()->temp();
40 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, and ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ getInfoForExistingFiles()

ilMDVocabularyUploadHandlerGUI::getInfoForExistingFiles ( array  $file_ids)
Parameters
array$file_ids
Returns
BasicFileInfoResult[]

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

Definition at line 110 of file class.ilMDVocabularyUploadHandlerGUI.php.

110 : array
111 {
112 return [];
113 }

◆ getInfoResult()

ilMDVocabularyUploadHandlerGUI::getInfoResult ( string  $identifier)
Returns
null|FileInfoResult for the file with the given identifier or null if the file does not exist.

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

Definition at line 82 of file class.ilMDVocabularyUploadHandlerGUI.php.

83 {
84 $title = $mime = 'unknown';
85 $size = 0;
86
87 $files = $this->temp->hasDir($identifier) ?
88 $this->temp->listContents($identifier) :
89 [];
90
91 foreach ($files as $file) {
92 if (!$file->isFile()) {
93 continue;
94 }
95 $title = $file->getFilename();
96 $size = $file->getSize();
97 $mime = $file->getMimeType();
98 break;
99 }
100
101 return new BasicFileInfoResult(
103 $identifier,
104 $title,
105 $size,
106 $mime
107 );
108 }

References ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler\getFileIdentifierParameterName(), and ILIAS\FileUpload\Handler\FileInfoResult\getSize().

+ Here is the call graph for this function:

◆ getRemoveResult()

ilMDVocabularyUploadHandlerGUI::getRemoveResult ( string  $identifier)
protected

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

Definition at line 72 of file class.ilMDVocabularyUploadHandlerGUI.php.

73 {
74 return new BasicHandlerResult(
76 HandlerResult::STATUS_OK,
77 $identifier,
78 'asynchronous removal blocked'
79 );
80 }

References ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler\getFileIdentifierParameterName().

+ Here is the call graph for this function:

◆ getUploadResult()

ilMDVocabularyUploadHandlerGUI::getUploadResult ( )
protected

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

Definition at line 42 of file class.ilMDVocabularyUploadHandlerGUI.php.

43 {
44 $status = HandlerResult::STATUS_FAILED;
45 $new_identification = 'unknown';
46 $message = 'file upload failed';
47
48 $this->upload->process();
49 $uploadResults = $this->upload->getResults();
50 $result = end($uploadResults);
51
52 if ($result instanceof UploadResult && $result->isOK() && $result->getSize()) {
53 $new_identification = uniqid('md_vocab_');
54 $move_success = $this->upload->moveOneFileTo(
55 $result,
56 $new_identification,
57 Location::TEMPORARY
58 );
59 if ($move_success) {
60 $status = HandlerResult::STATUS_OK;
61 $message = 'Upload ok';
62 }
63 }
64 return new BasicHandlerResult(
66 $status,
67 $new_identification,
69 );
70 }
$message
Definition: xapiexit.php:31

References $message, ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler\getFileIdentifierParameterName(), ILIAS\FileUpload\DTO\UploadResult\isOK(), and ILIAS\Repository\upload().

+ Here is the call graph for this function:

Field Documentation

◆ $temp

Filesystem ilMDVocabularyUploadHandlerGUI::$temp
protected

Definition at line 32 of file class.ilMDVocabularyUploadHandlerGUI.php.


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