ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilRepoStandardUploadHandlerGUI Class Reference
+ Inheritance diagram for ilRepoStandardUploadHandlerGUI:
+ Collaboration diagram for ilRepoStandardUploadHandlerGUI:

Public Member Functions

 __construct (Closure $result_handler, string $file_id_parameter, string $logger_id="")
 
 getInfoResult (string $identifier)
 
 getInfoForExistingFiles (array $file_ids)
 
 getFileIdentifierParameterName ()
 
- Public Member Functions inherited from ILIAS\FileUpload\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

 debug (string $mess)
 
 getUploadResult ()
 
 getRemoveResult (string $identifier)
 
- Protected Member Functions inherited from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler
 readChunkedInformation ()
 
 getUploadResult ()
 
 getRemoveResult (string $identifier)
 

Protected Attributes

ilLogger $log = null
 
Closure $result_handler
 
string $file_id_parameter = ""
 
- Protected Attributes inherited from ILIAS\FileUpload\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

Constructor & Destructor Documentation

◆ __construct()

ilRepoStandardUploadHandlerGUI::__construct ( Closure  $result_handler,
string  $file_id_parameter,
string  $logger_id = "" 
)

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

References $DIC, $file_id_parameter, $result_handler, ILIAS\GlobalScreen\Provider\__construct(), and ilLoggerFactory\getLogger().

43  {
44  global $DIC;
46 
47  if ($logger_id !== "") {
48  $this->log = ilLoggerFactory::getLogger($logger_id);
49  }
50  $this->result_handler = $result_handler;
51  $this->file_id_parameter = $file_id_parameter;
52  }
static getLogger(string $a_component_id)
Get component logger.
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ debug()

ilRepoStandardUploadHandlerGUI::debug ( string  $mess)
protected

Definition at line 54 of file class.ilRepoStandardUploadHandlerGUI.php.

Referenced by getUploadResult().

54  : void
55  {
56  if (!is_null($this->log)) {
57  $this->log->debug($mess);
58  }
59  }
+ Here is the caller graph for this function:

◆ getFileIdentifierParameterName()

ilRepoStandardUploadHandlerGUI::getFileIdentifierParameterName ( )
Returns
string defaults to self::DEFAULT_FILE_ID_PARAMETER

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

Definition at line 119 of file class.ilRepoStandardUploadHandlerGUI.php.

References $file_id_parameter.

Referenced by getRemoveResult(), and getUploadResult().

119  : string
120  {
122  }
+ Here is the caller graph for this function:

◆ getInfoForExistingFiles()

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

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

Definition at line 114 of file class.ilRepoStandardUploadHandlerGUI.php.

114  : array
115  {
116  return [];
117  }

◆ getInfoResult()

ilRepoStandardUploadHandlerGUI::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 109 of file class.ilRepoStandardUploadHandlerGUI.php.

109  : ?FileInfoResult
110  {
111  return null;
112  }

◆ getRemoveResult()

ilRepoStandardUploadHandlerGUI::getRemoveResult ( string  $identifier)
protected

Definition at line 99 of file class.ilRepoStandardUploadHandlerGUI.php.

References getFileIdentifierParameterName().

100  {
101  return new BasicHandlerResult(
103  HandlerResult::STATUS_OK,
104  $identifier,
105  ''
106  );
107  }
+ Here is the call graph for this function:

◆ getUploadResult()

ilRepoStandardUploadHandlerGUI::getUploadResult ( )
protected

Definition at line 61 of file class.ilRepoStandardUploadHandlerGUI.php.

References Vendor\Package\$e, $result_handler, debug(), getFileIdentifierParameterName(), and ILIAS\Repository\upload().

62  {
63  $this->debug("checking for uploads...");
64  if ($this->upload->hasUploads()) {
65  $this->debug("has upload...");
66  try {
67  $this->upload->process();
68  $this->debug("nr of results: " . count($this->upload->getResults()));
69  foreach ($this->upload->getResults(
70  ) as $result) { // in this version, there will only be one upload at the time
71 
73  $result = $rh($this->upload, $result);
74 
75  /*
76  $result = new BasicHandlerResult(
77  $this->getFileIdentifierParameterName(),
78  BasicHandlerResult::STATUS_OK,
79  $id,
80  ''
81  );*/
82  }
83  } catch (Exception $e) {
84  $result = new BasicHandlerResult(
86  BasicHandlerResult::STATUS_FAILED,
87  '',
88  $e->getMessage()
89  );
90  }
91  $this->debug("end of 'has_uploads'");
92  } else {
93  $this->debug("has no upload...");
94  }
95 
96  return $result;
97  }
+ Here is the call graph for this function:

Field Documentation

◆ $file_id_parameter

string ilRepoStandardUploadHandlerGUI::$file_id_parameter = ""
protected

◆ $log

ilLogger ilRepoStandardUploadHandlerGUI::$log = null
protected

Definition at line 35 of file class.ilRepoStandardUploadHandlerGUI.php.

◆ $result_handler

Closure ilRepoStandardUploadHandlerGUI::$result_handler
protected

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

Referenced by __construct(), and getUploadResult().


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