89 if ($existant_bibl_id) {
90 $this->
setId($existant_bibl_id);
96 $this->bib_field_factory =
new ilBiblFieldFactory($this->bib_type_factory->getInstanceForType($this->getFileType()));
98 $this->bib_entry_factory =
new ilBiblEntryFactory($this->bib_field_factory, $this->bib_type_factory->getInstanceForType($this->getFileType()), $this->bib_overview_factory);
113 $upload = $DIC->upload();
114 if ($upload->hasUploads() && !$upload->hasBeenProcessed()) {
116 $this->moveUploadedFile($upload);
119 $DIC->database()->insert(
122 "id" => [
"integer", $this->
getId()],
124 "is_online" => [
"integer", $this->
getOnline()],
134 $ilDB = $DIC[
'ilDB'];
140 $this->
setOnline($ilBiblData->getIsOnline());
148 $upload = $DIC->upload();
149 $has_valid_upload = $upload->hasUploads() && !$upload->hasBeenProcessed();
150 if (
$_POST[
'override_entries'] && $has_valid_upload) {
153 $this->moveUploadedFile($upload);
155 if ($has_valid_upload) {
161 $DIC->database()->update(
165 "is_online" => [
"integer", $this->
getOnline()],
168 [
"id" => [
"integer", $this->
getId()]]
177 protected function doDelete($leave_out_il_bibl_data =
false, $leave_out_delete_file =
false)
180 $ilDB = $DIC[
'ilDB'];
181 if (!$leave_out_delete_file) {
186 "DELETE FROM il_bibl_attribute WHERE il_bibl_attribute.entry_id IN " .
"(SELECT il_bibl_entry.id FROM il_bibl_entry WHERE il_bibl_entry.data_id = " .
$ilDB->quote(
192 $this->bib_entry_factory->deleteEntryById($this->
getId());
194 if (!$leave_out_il_bibl_data) {
197 "DELETE FROM il_bibl_data WHERE id = " .
$ilDB->quote($this->getId(),
"integer")
210 return "{$this->getType()}/{$this->getId()}";
217 protected function moveUploadedFile(\
ILIAS\FileUpload\FileUpload $upload)
222 $result = array_values($upload->getResults())[0];
264 return $DIC[
"filesystem"]->storage();
277 if ($without_filename) {
278 return substr($file_name, 0, strrpos($file_name, DIRECTORY_SEPARATOR));
317 return $stream->getMetadata(
'uri');
329 return $this->bib_type_factory->getInstanceForType(
$type)->getStringRepresentation();
342 $instance = $this->bib_type_factory->getInstanceForFileName(
$filename);
344 return $instance->getId();
357 public function doCloneObject($new_obj, $a_target_id, $a_copy_id = null, $a_omit_tree =
false)
363 if (!$cp_options->isRootNode($this->getRefId())) {
367 $new_obj->cloneStructure($this->
getId());
369 $new_obj->parseFileToDatabase();
388 $this->
copyFile($original->getFileAbsolutePath());
390 $this->
setTitle($original->getTitle());
391 $this->
setType($original->getType());
405 $reader = $this->bib_filereader_factory->getByType(
$type, $this->bib_entry_factory, $this->bib_field_factory, $this->bib_attribute_factory);
407 $this->entries =
$reader->parseContentToEntries($this);
425 $this->is_online = $a_online;
445 return $this->bib_type_factory->getInstanceForFileName(
$filename)->getId();
Class ChatMainBarProvider .
determineFileTypeByFileName($filename)
setId($a_id)
set object id public
doCloneObject($new_obj, $a_target_id, $a_copy_id=null, $a_omit_tree=false)
Clone BIBL.
static where($where, $operator=null)
doDelete($leave_out_il_bibl_data=false, $leave_out_delete_file=false)
__construct($existant_bibl_id=0)
If bibliographic object exists, read it's data from database, otherwise create it.
static _getInstance($a_copy_id)
Get instance of copy wizard options.
getId()
get object id public
Class ilBiblEntryFactory.
cloneStructure($original_id)
Attention only use this for objects who have not yet been created (use like: $x = new ilObjDataCollec...
Class ilBiblAttributeFactory.
__construct(Container $dic, ilPlugin $plugin)
Class ilBiblFieldFactory.
static _removeEntriesForObject($a_obj_id)
remove all history entries for an object
Class ilObjBibliographic.
getFilePath($without_filename=false)
Class ilBiblFileReaderFactory.
Class ilBiblOverviewModelFactory.
Class FlySystemFileAccessTest.
parseFileToDatabase()
Reads out the source file and writes all entries to the database.