ILIAS  trunk Revision v11.0_alpha-1713-gd8962da2f67
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilObjectTileImageUploadHandlerGUI Class Reference
+ Inheritance diagram for ilObjectTileImageUploadHandlerGUI:
+ Collaboration diagram for ilObjectTileImageUploadHandlerGUI:

Public Member Functions

 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

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

Protected Attributes

ilLanguage $language
 
ResourceStorageServices $storage
 
ilObjectTileImageStakeholder $stakeholder
 
ilObjectTileImageFlavourDefinition $flavour
 
ResourceIdentification $rid = null
 
bool $has_access = false
 
- 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
 

Additional Inherited Members

- Data Fields inherited from ILIAS\UI\Component\Input\Field\UploadHandler
const DEFAULT_FILE_ID_PARAMETER = 'file_id'
 

Detailed Description

Member Function Documentation

◆ getInfoForExistingFiles()

ilObjectTileImageUploadHandlerGUI::getInfoForExistingFiles ( array  $file_ids)
Returns
[]

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

Definition at line 168 of file class.ilObjectTileImageUploadHandlerGUI.php.

References getInfoResult().

168  : array
169  {
170  $info_results = [];
171  foreach ($file_ids as $identifier) {
172  $info_results[] = $this->getInfoResult($identifier);
173  }
174 
175  return $info_results;
176  }
+ Here is the call graph for this function:

◆ getInfoResult()

ilObjectTileImageUploadHandlerGUI::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 144 of file class.ilObjectTileImageUploadHandlerGUI.php.

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

Referenced by getInfoForExistingFiles().

144  : ?FileInfoResult
145  {
146  if (null !== ($id = $this->storage->manage()->find($identifier))) {
147  $revision = $this->storage->manage()->getCurrentRevision($id)->getInformation();
148  $title = $revision->getTitle();
149  $size = $revision->getSize();
150  $mime = $revision->getMimeType();
151  } else {
152  $title = $mime = 'unknown';
153  $size = 0;
154  }
155 
156  return new BasicFileInfoResult(
158  $identifier,
159  $title,
160  $size,
161  $mime
162  );
163  }
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:
+ Here is the caller graph for this function:

◆ getRemoveResult()

ilObjectTileImageUploadHandlerGUI::getRemoveResult ( string  $identifier)
protected

Definition at line 126 of file class.ilObjectTileImageUploadHandlerGUI.php.

References ILIAS\MetaData\OERExposer\OAIPMH\Handler\AbstractCtrlAwareUploadHandler\getFileIdentifierParameterName(), and ILIAS\UI\examples\Symbol\Glyph\Language\language().

126  : HandlerResult
127  {
128  if ($this->has_access === false) {
129  return $this->getAccessFailureResult(
131  $identifier,
132  $this->language
133  );
134  }
135 
136  return new BasicHandlerResult(
138  HandlerResult::STATUS_OK,
139  $identifier,
140  "We just don't do anything here."
141  );
142  }
language()
description: > Example for rendring a language glyph.
Definition: language.php:41
+ Here is the call graph for this function:

◆ getUploadResult()

ilObjectTileImageUploadHandlerGUI::getUploadResult ( )
protected

Definition at line 87 of file class.ilObjectTileImageUploadHandlerGUI.php.

References $message, $rid, ILIAS\MetaData\OERExposer\OAIPMH\Handler\AbstractCtrlAwareUploadHandler\getFileIdentifierParameterName(), null, and ILIAS\Repository\upload().

88  {
89  $this->upload->process();
90 
91  $result_array = $this->upload->getResults();
92  $result = end($result_array);
93 
94  if (!($result instanceof UploadResult) || !$result->isOK()) {
95  return new BasicHandlerResult(
97  HandlerResult::STATUS_FAILED,
98  '',
99  $result->getStatus()->getMessage()
100  );
101  }
102 
103  $status = HandlerResult::STATUS_OK;
104  $message = "file upload OK";
105  if ($this->rid === null) {
106  $i = $this->storage->manage()->upload($result, $this->stakeholder);
107  } else {
108  $i = $this->rid;
109  $this->storage->manage()->replaceWithUpload(
110  $i,
111  $result,
112  $this->stakeholder
113  );
114  }
115 
116  $this->storage->flavours()->ensure($i, $this->flavour);
117 
118  return new BasicHandlerResult(
120  $status,
121  $i->serialize(),
122  $message
123  );
124  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
$message
Definition: xapiexit.php:31
+ Here is the call graph for this function:

Field Documentation

◆ $flavour

ilObjectTileImageFlavourDefinition ilObjectTileImageUploadHandlerGUI::$flavour
protected

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

◆ $has_access

bool ilObjectTileImageUploadHandlerGUI::$has_access = false
protected

Definition at line 47 of file class.ilObjectTileImageUploadHandlerGUI.php.

◆ $language

ilLanguage ilObjectTileImageUploadHandlerGUI::$language
protected

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

◆ $rid

ResourceIdentification ilObjectTileImageUploadHandlerGUI::$rid = null
protected

Definition at line 46 of file class.ilObjectTileImageUploadHandlerGUI.php.

Referenced by getUploadResult().

◆ $stakeholder

ilObjectTileImageStakeholder ilObjectTileImageUploadHandlerGUI::$stakeholder
protected

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

◆ $storage

ResourceStorageServices ilObjectTileImageUploadHandlerGUI::$storage
protected

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


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