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);
120 $DIC->database()->insert(
123 "id" => [
"integer", $this->
getId()],
125 "is_online" => [
"integer", $this->
getOnline()],
135 $ilDB = $DIC[
'ilDB'];
141 $this->
setOnline($ilBiblData->getIsOnline());
149 $upload = $DIC->upload();
150 $has_valid_upload = $upload->hasUploads() && !$upload->hasBeenProcessed();
151 if (
$_POST[
'override_entries'] && $has_valid_upload) {
154 $this->moveUploadedFile($upload);
156 if ($has_valid_upload) {
162 $DIC->database()->update(
166 "is_online" => [
"integer", $this->
getOnline()],
169 [
"id" => [
"integer", $this->
getId()]]
178 protected function doDelete($leave_out_il_bibl_data =
false, $leave_out_delete_file =
false)
181 $ilDB = $DIC[
'ilDB'];
182 if (!$leave_out_delete_file) {
187 "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(
193 $this->bib_entry_factory->deleteEntryById($this->
getId());
195 if (!$leave_out_il_bibl_data) {
198 "DELETE FROM il_bibl_data WHERE id = " .
$ilDB->quote($this->getId(),
"integer")
211 return "{$this->getType()}/{$this->getId()}";
218 protected function moveUploadedFile(\
ILIAS\FileUpload\FileUpload $upload)
223 $result = array_values($upload->getResults())[0];
265 return $DIC[
"filesystem"]->storage();
278 if ($without_filename) {
279 return substr($file_name, 0, strrpos($file_name, DIRECTORY_SEPARATOR));
318 return $stream->getMetadata(
'uri');
330 return $this->bib_type_factory->getInstanceForType(
$type)->getStringRepresentation();
343 $instance = $this->bib_type_factory->getInstanceForFileName(
$filename);
345 return $instance->getId();
358 public function doCloneObject($new_obj, $a_target_id, $a_copy_id = null, $a_omit_tree =
false)
364 if (!$cp_options->isRootNode($this->getRefId())) {
368 $new_obj->cloneStructure($this->
getId());
370 $new_obj->parseFileToDatabase();
389 $this->
copyFile($original->getFileAbsolutePath());
391 $this->
setTitle($original->getTitle());
392 $this->
setType($original->getType());
406 $reader = $this->bib_filereader_factory->getByType(
$type, $this->bib_entry_factory, $this->bib_field_factory, $this->bib_attribute_factory);
408 $this->entries = $reader->parseContentToEntries($this);
426 $this->is_online = $a_online;
446 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 disabled disabled disabled.
parseFileToDatabase()
Reads out the source file and writes all entries to the database.