ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
ilSkillProfileUploadHandlerGUI Class Reference

Class ilSkillProfileUploadHandlerGUI. More...

+ Inheritance diagram for ilSkillProfileUploadHandlerGUI:
+ Collaboration diagram for ilSkillProfileUploadHandlerGUI:

Public Member Functions

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

Protected Member Functions

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

Private Attributes

ResourceStorage $storage
 
ilSkillProfileStorageStakeHolder $stakeholder
 

Additional Inherited Members

- Data Fields inherited from ILIAS\UI\Component\Input\Field\UploadHandler
const DEFAULT_FILE_ID_PARAMETER = 'file_id'
 
- Protected Attributes inherited from ILIAS\MetaData\OERExposer\OAIPMH\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
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilSkillProfileUploadHandlerGUI::__construct ( )

Member Function Documentation

◆ getInfoForExistingFiles()

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

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

Definition at line 101 of file class.ilSkillProfileUploadHandlerGUI.php.

References $id, $r, and ILIAS\MetaData\OERExposer\OAIPMH\Handler\AbstractCtrlAwareUploadHandler\getFileIdentifierParameterName().

101  : array
102  {
103  $infos = [];
104  foreach ($file_ids as $file_id) {
105  $id = $this->storage->manage()->find($file_id);
106  if ($id === null) {
107  continue;
108  }
109  $r = $this->storage->manage()->getCurrentRevision($id)->getInformation();
110 
111  $infos[] = new BasicFileInfoResult($this->getFileIdentifierParameterName(), $file_id, $r->getTitle(), $r->getSize(), $r->getMimeType());
112  }
113 
114  return $infos;
115  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:24
$r
+ Here is the call graph for this function:

◆ getInfoResult()

ilSkillProfileUploadHandlerGUI::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 84 of file class.ilSkillProfileUploadHandlerGUI.php.

References $id, $r, and ILIAS\MetaData\OERExposer\OAIPMH\Handler\AbstractCtrlAwareUploadHandler\getFileIdentifierParameterName().

85  {
86  $id = $this->storage->manage()->find($identifier);
87  if ($id === null) {
88  return new BasicFileInfoResult($this->getFileIdentifierParameterName(), 'unknown', 'unknown', 0, 'unknown');
89  }
90  $r = $this->storage->manage()->getCurrentRevision($id)->getInformation();
91 
92  return new BasicFileInfoResult(
94  $identifier,
95  $r->getTitle(),
96  $r->getSize(),
97  $r->getMimeType()
98  );
99  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:24
$r
+ Here is the call graph for this function:

◆ getRemoveResult()

ilSkillProfileUploadHandlerGUI::getRemoveResult ( string  $identifier)
protected

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

References $id, and ILIAS\MetaData\OERExposer\OAIPMH\Handler\AbstractCtrlAwareUploadHandler\getFileIdentifierParameterName().

73  {
74  $id = $this->storage->manage()->find($identifier);
75  if ($id !== null) {
76  $this->storage->manage()->remove($id, $this->stakeholder);
77 
78  return new BasicHandlerResult($this->getFileIdentifierParameterName(), HandlerResultInterface::STATUS_OK, $identifier, 'file deleted');
79  } else {
80  return new BasicHandlerResult($this->getFileIdentifierParameterName(), HandlerResultInterface::STATUS_FAILED, $identifier, 'file not found');
81  }
82  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:24
+ Here is the call graph for this function:

Field Documentation

◆ $stakeholder

ilSkillProfileStorageStakeHolder ilSkillProfileUploadHandlerGUI::$stakeholder
private

Definition at line 40 of file class.ilSkillProfileUploadHandlerGUI.php.

◆ $storage

ResourceStorage ilSkillProfileUploadHandlerGUI::$storage
private

Definition at line 39 of file class.ilSkillProfileUploadHandlerGUI.php.


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