ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
class.ilObjBibliographicUploadHandlerGUI.php
Go to the documentation of this file.
1 <?php
2 
18 declare(strict_types=1);
19 
23 
29 {
30  public function __construct(private string $rid = "")
31  {
33  }
34 
35  protected function getUploadResult(): HandlerResult
36  {
37  $this->upload->process();
38 
39  $result_array = $this->upload->getResults();
40  $result = end($result_array);
41 
42  if ($result instanceof UploadResult && $result->isOK()) {
43  $resource_identification = $this->storage->manage()->find($this->rid);
44  if ($resource_identification !== null) {
45  $identifier = $this->storage->manage()->replaceWithUpload(
46  $resource_identification,
47  $result,
48  $this->stakeholder
49  )->getIdentification()->serialize();
50  } else {
51  $identifier = $this->storage->manage()->upload($result, $this->stakeholder)->serialize();
52  }
53  $status = HandlerResult::STATUS_OK;
54  $message = "file upload OK";
55  } else {
56  $identifier = '';
57  $status = HandlerResult::STATUS_FAILED;
58  $message = $result->getStatus()->getMessage();
59  }
60 
61  return new BasicHandlerResult(
63  $status,
64  $identifier,
65  $message
66  );
67  }
68 }
__construct(VocabulariesInterface $vocabularies)
Class ilObjBibliographicStakeholder.
Class ilCtrlAwareStorageUploadHandler.
$message
Definition: xapiexit.php:32