ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 100 of file class.ilSkillProfileUploadHandlerGUI.php.

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

100  : array
101  {
102  $infos = [];
103  foreach ($file_ids as $file_id) {
104  $id = $this->storage->manage()->find($file_id);
105  if ($id === null) {
106  continue;
107  }
108  $r = $this->storage->manage()->getCurrentRevision($id)->getInformation();
109 
110  $infos[] = new BasicFileInfoResult($this->getFileIdentifierParameterName(), $file_id, $r->getTitle(), $r->getSize(), $r->getMimeType());
111  }
112 
113  return $infos;
114  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
$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 83 of file class.ilSkillProfileUploadHandlerGUI.php.

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

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

◆ getRemoveResult()

ilSkillProfileUploadHandlerGUI::getRemoveResult ( string  $identifier)
protected

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

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

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

Field Documentation

◆ $stakeholder

ilSkillProfileStorageStakeHolder ilSkillProfileUploadHandlerGUI::$stakeholder
private

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

◆ $storage

ResourceStorage ilSkillProfileUploadHandlerGUI::$storage
private

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


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