ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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="", array $ctrl_path=[])
 
 getUploadURL ()
 @inheritDoc More...
 
 getExistingFileInfoURL ()
 @inheritDoc More...
 
 getFileRemovalURL ()
 @inheritDoc More...
 
 getInfoResult (string $identifier)
 
 getInfoForExistingFiles (array $file_ids)
 
 getFileIdentifierParameterName ()
 @inheritDoc More...
 
- Public Member Functions inherited from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler
 __construct ()
 ilUIDemoFileUploadHandlerGUI constructor. More...
 
 getFileIdentifierParameterName ()
 @inheritDoc More...
 
 getUploadURL ()
 @inheritDoc More...
 
 getExistingFileInfoURL ()
 @inheritDoc More...
 
 getFileRemovalURL ()
 @inheritDoc More...
 
 executeCommand ()
 Since this is a ilCtrl aware UploadHandler executeCommand MUST be implemented. More...
 
 getInfoResult (string $identifier)
 
 getInfoForExistingFiles (array $file_ids)
 
 supportsChunkedUploads ()
 
 executeCommand ()
 Since this is a ilCtrl aware UploadHandler executeCommand MUST be implemented. More...
 
 getFileIdentifierParameterName ()
 
 getUploadURL ()
 
 getFileRemovalURL ()
 
 getExistingFileInfoURL ()
 
 getInfoForExistingFiles (array $file_ids)
 
 getInfoResult (string $identifier)
 
 supportsChunkedUploads ()
 

Protected Member Functions

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

Protected Attributes

array $ctrl_path
 
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 = "",
array  $ctrl_path = [] 
)

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

45 {
46 global $DIC;
47 $this->ctrl_path = $ctrl_path;
49
50 if ($logger_id !== "") {
51 $this->log = ilLoggerFactory::getLogger($logger_id);
52 }
53 $this->result_handler = $result_handler;
54 $this->file_id_parameter = $file_id_parameter;
55 }
static getLogger(string $a_component_id)
Get component logger.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

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

+ Here is the call graph for this function:

Member Function Documentation

◆ debug()

ilRepoStandardUploadHandlerGUI::debug ( string  $mess)
protected

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

86 : void
87 {
88 if (!is_null($this->log)) {
89 $this->log->debug($mess);
90 }
91 }

Referenced by getUploadResult().

+ Here is the caller graph for this function:

◆ getCtrlPath()

ilRepoStandardUploadHandlerGUI::getCtrlPath ( )
protected

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

57 : array
58 {
60 $path[] = static::class;
61 return $path;
62 }
$path
Definition: ltiservices.php:30

References $ctrl_path, and $path.

Referenced by getExistingFileInfoURL(), getFileRemovalURL(), and getUploadURL().

+ Here is the caller graph for this function:

◆ getExistingFileInfoURL()

ilRepoStandardUploadHandlerGUI::getExistingFileInfoURL ( )

@inheritDoc

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

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

72 : string
73 {
74 return $this->ctrl->getLinkTargetByClass($this->getCtrlPath(), self::CMD_INFO);
75 }

References ILIAS\Repository\ctrl(), and getCtrlPath().

+ Here is the call graph for this function:

◆ getFileIdentifierParameterName()

ilRepoStandardUploadHandlerGUI::getFileIdentifierParameterName ( )

@inheritDoc

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

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

141 : string
142 {
144 }

References $file_id_parameter.

Referenced by getRemoveResult(), and getUploadResult().

+ Here is the caller graph for this function:

◆ getFileRemovalURL()

ilRepoStandardUploadHandlerGUI::getFileRemovalURL ( )

@inheritDoc

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

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

81 : string
82 {
83 return $this->ctrl->getLinkTargetByClass($this->getCtrlPath(), self::CMD_REMOVE);
84 }

References ILIAS\Repository\ctrl(), and getCtrlPath().

+ Here is the call graph for this function:

◆ getInfoForExistingFiles()

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

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

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

136 : array
137 {
138 return [];
139 }

◆ getInfoResult()

ilRepoStandardUploadHandlerGUI::getInfoResult ( string  $identifier)
Returns
null|FileInfoResult for the file with the given identifier or null if the file does not exist.

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

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

132 {
133 return null;
134 }

◆ getRemoveResult()

ilRepoStandardUploadHandlerGUI::getRemoveResult ( string  $identifier)
protected

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

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

122 {
123 return new BasicHandlerResult(
125 HandlerResult::STATUS_OK,
126 $identifier,
127 ''
128 );
129 }

References getFileIdentifierParameterName().

+ Here is the call graph for this function:

◆ getUploadResult()

ilRepoStandardUploadHandlerGUI::getUploadResult ( )
protected

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

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

94 {
95 $this->debug("checking for uploads...");
96 if ($this->upload->hasUploads()) {
97 $this->debug("has upload...");
98 try {
99 $this->upload->process();
100 $this->debug("nr of results: " . count($this->upload->getResults()));
101 foreach ($this->upload->getResults(
102 ) as $result) { // in this version, there will only be one upload at the time
104 $result = $rh($this->upload, $result);
105 }
106 } catch (Exception $e) {
107 $result = new BasicHandlerResult(
109 BasicHandlerResult::STATUS_FAILED,
110 '',
111 $e->getMessage()
112 );
113 }
114 $this->debug("end of 'has_uploads'");
115 } else {
116 $this->debug("has no upload...");
117 }
118 return $result;
119 }

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

+ Here is the call graph for this function:

◆ getUploadURL()

ilRepoStandardUploadHandlerGUI::getUploadURL ( )

@inheritDoc

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

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

63 : string
64 {
65 return $this->ctrl->getLinkTargetByClass($this->getCtrlPath(), self::CMD_UPLOAD);
66 }

References ILIAS\Repository\ctrl(), and getCtrlPath().

+ Here is the call graph for this function:

Field Documentation

◆ $ctrl_path

array ilRepoStandardUploadHandlerGUI::$ctrl_path
protected

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

Referenced by __construct(), and getCtrlPath().

◆ $file_id_parameter

string ilRepoStandardUploadHandlerGUI::$file_id_parameter = ""
protected

◆ $log

ilLogger ilRepoStandardUploadHandlerGUI::$log = null
protected

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

◆ $result_handler

Closure ilRepoStandardUploadHandlerGUI::$result_handler
protected

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

Referenced by __construct(), and getUploadResult().


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