ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
ILIAS\File\Icon\ilIconUploadHandlerGUI Class Reference
+ Inheritance diagram for ILIAS\File\Icon\ilIconUploadHandlerGUI:
+ Collaboration diagram for ILIAS\File\Icon\ilIconUploadHandlerGUI:

Public Member Functions

 __construct ()
 ilUIDemoFileUploadHandlerGUI constructor. More...
 
 getInfoResult (string $rid)
 
 getInfoForExistingFiles (array $resource_identifiers)
 
- 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 $rid)
 
- Protected Member Functions inherited from ILIAS\MetaData\OERExposer\OAIPMH\Handler\AbstractCtrlAwareUploadHandler
 readChunkedInformation ()
 
 getUploadResult ()
 
 getRemoveResult (string $identifier)
 

Private Attributes

Services $storage
 
ilObjFileIconStakeholder $stakeholder
 
WrapperFactory $wrapper
 
Factory $refinery
 

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()

ILIAS\File\Icon\ilIconUploadHandlerGUI::__construct ( )

ilUIDemoFileUploadHandlerGUI constructor.

Definition at line 49 of file class.ilIconUploadHandlerGUI.php.

References $DIC, $id, $message, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\MetaData\OERExposer\OAIPMH\Handler\AbstractCtrlAwareUploadHandler\getFileIdentifierParameterName(), ILIAS\MetaData\OERExposer\OAIPMH\Handler\AbstractCtrlAwareUploadHandler\getUploadResult(), ILIAS\FileUpload\DTO\UploadResult\isOK(), null, ILIAS\Repository\refinery(), and ILIAS\Repository\upload().

50  {
51  global $DIC;
53  $this->storage = $DIC->resourceStorage();
54  $this->wrapper = $DIC->http()->wrapper();
55  $this->refinery = $DIC->refinery();
56  $this->stakeholder = new ilObjFileIconStakeholder();
57  }
global $DIC
Definition: shib_login.php:26
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ getInfoForExistingFiles()

ILIAS\File\Icon\ilIconUploadHandlerGUI::getInfoForExistingFiles ( array  $resource_identifiers)
Returns
BasicFileInfoResult[]

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

Definition at line 145 of file class.ilIconUploadHandlerGUI.php.

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

145  : array
146  {
147  $infos = [];
148  foreach ($resource_identifiers as $rid) {
149  $id = $this->storage->manage()->find($rid);
150  if (!$id instanceof ResourceIdentification) {
151  continue;
152  }
153  $r = $this->storage->manage()->getCurrentRevision($id)->getInformation();
154 
155  $infos[] = new BasicFileInfoResult(
157  $rid,
158  $r->getTitle(),
159  $r->getSize(),
160  $r->getMimeType()
161  );
162  }
163 
164  return $infos;
165  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
$r
+ Here is the call graph for this function:

◆ getInfoResult()

ILIAS\File\Icon\ilIconUploadHandlerGUI::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 125 of file class.ilIconUploadHandlerGUI.php.

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

125  : ?FileInfoResult
126  {
127  $id = $this->storage->manage()->find($rid);
128  if (!$id instanceof ResourceIdentification) {
129  return new BasicFileInfoResult($this->getFileIdentifierParameterName(), 'unknown', 'unknown', 0, 'unknown');
130  }
131  $r = $this->storage->manage()->getCurrentRevision($id)->getInformation();
132 
133  return new BasicFileInfoResult(
135  $rid,
136  $r->getTitle(),
137  $r->getSize(),
138  $r->getMimeType()
139  );
140  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
$r
+ Here is the call graph for this function:

◆ getRemoveResult()

ILIAS\File\Icon\ilIconUploadHandlerGUI::getRemoveResult ( string  $rid)
protected

Definition at line 103 of file class.ilIconUploadHandlerGUI.php.

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

103  : HandlerResult
104  {
105  $id = $this->storage->manage()->find($rid);
106  if ($id !== null) {
107  $rev = $this->storage->manage()->getCurrentRevision($id);
108  $rev_num = $rev->getVersionNumber();
109  $this->storage->manage()->removeRevision($id, $rev_num);
110  return new BasicHandlerResult(
112  HandlerResult::STATUS_OK,
113  $rid,
114  'file deleted'
115  );
116  }
117  return new BasicHandlerResult(
119  HandlerResult::STATUS_FAILED,
120  $rid,
121  'file not found'
122  );
123  }
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

◆ $refinery

Factory ILIAS\File\Icon\ilIconUploadHandlerGUI::$refinery
private

Definition at line 44 of file class.ilIconUploadHandlerGUI.php.

◆ $stakeholder

ilObjFileIconStakeholder ILIAS\File\Icon\ilIconUploadHandlerGUI::$stakeholder
private

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

◆ $storage

Services ILIAS\File\Icon\ilIconUploadHandlerGUI::$storage
private

Definition at line 41 of file class.ilIconUploadHandlerGUI.php.

◆ $wrapper

WrapperFactory ILIAS\File\Icon\ilIconUploadHandlerGUI::$wrapper
private

Definition at line 43 of file class.ilIconUploadHandlerGUI.php.


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