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

Public Member Functions

 __construct (string $identification)
 
 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

ilMDCopyrightImageStakeholder $stakeholder
 
Services $storage
 
string $identification
 
- 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

Definition at line 30 of file class.ilMDCopyrightImageUploadHandlerGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilMDCopyrightImageUploadHandlerGUI::__construct ( string  $identification)

Definition at line 36 of file class.ilMDCopyrightImageUploadHandlerGUI.php.

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

37  {
38  global $DIC;
39 
40  $this->stakeholder = new ilMDCopyrightImageStakeholder();
41  $this->storage = $DIC->resourceStorage();
42  $this->identification = $identification;
43 
45  }
global $DIC
Definition: shib_login.php:22
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ getInfoForExistingFiles()

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

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

Definition at line 109 of file class.ilMDCopyrightImageUploadHandlerGUI.php.

References getInfoResult().

109  : array
110  {
111  $info_results = [];
112  foreach ($file_ids as $identifier) {
113  $info_results[] = $this->getInfoResult($identifier);
114  }
115 
116  return $info_results;
117  }
+ Here is the call graph for this function:

◆ getInfoResult()

ilMDCopyrightImageUploadHandlerGUI::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 88 of file class.ilMDCopyrightImageUploadHandlerGUI.php.

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

Referenced by getInfoForExistingFiles().

89  {
90  if (null !== ($id = $this->storage->manage()->find($identifier))) {
91  $revision = $this->storage->manage()->getCurrentRevision($id)->getInformation();
92  $title = $revision->getTitle();
93  $size = $revision->getSize();
94  $mime = $revision->getMimeType();
95  } else {
96  $title = $mime = 'unknown';
97  $size = 0;
98  }
99 
100  return new BasicFileInfoResult(
102  $identifier,
103  $title,
104  $size,
105  $mime
106  );
107  }
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()

ilMDCopyrightImageUploadHandlerGUI::getRemoveResult ( string  $identifier)
protected

Definition at line 78 of file class.ilMDCopyrightImageUploadHandlerGUI.php.

References ILIAS\MetaData\OERExposer\OAIPMH\Handler\AbstractCtrlAwareUploadHandler\getFileIdentifierParameterName().

79  {
80  return new BasicHandlerResult(
82  HandlerResult::STATUS_OK,
83  $identifier,
84  'asynchronous removal blocked'
85  );
86  }
+ Here is the call graph for this function:

◆ getUploadResult()

ilMDCopyrightImageUploadHandlerGUI::getUploadResult ( )
protected

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

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

48  {
49  $status = HandlerResult::STATUS_FAILED;
50  $new_identification = 'unknown';
51  $message = 'file upload failed';
52 
53  $this->upload->process();
54  $uploadResults = $this->upload->getResults();
55  $result = end($uploadResults);
56 
57  if ($result instanceof UploadResult && $result->isOK() && $result->getSize()) {
58  $resource_id = $this->storage->manage()->find($this->identification);
59  if (is_null($resource_id)) {
60  $new_identification = $this->storage->manage()->upload($result, $this->stakeholder)->serialize();
61  $status = HandlerResult::STATUS_OK;
62  $message = 'Upload ok';
63  } elseif ($this->identification !== '') {
64  $this->storage->manage()->replaceWithUpload($resource_id, $result, $this->stakeholder);
65  $new_identification = $this->identification;
66  $status = HandlerResult::STATUS_OK;
67  $message = 'Upload ok';
68  }
69  }
70  return new BasicHandlerResult(
72  $status,
73  $new_identification,
74  $message
75  );
76  }
$message
Definition: xapiexit.php:31
+ Here is the call graph for this function:

Field Documentation

◆ $identification

string ilMDCopyrightImageUploadHandlerGUI::$identification
protected

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

Referenced by __construct(), and getUploadResult().

◆ $stakeholder

ilMDCopyrightImageStakeholder ilMDCopyrightImageUploadHandlerGUI::$stakeholder
protected

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

◆ $storage

Services ilMDCopyrightImageUploadHandlerGUI::$storage
protected

Definition at line 33 of file class.ilMDCopyrightImageUploadHandlerGUI.php.


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