ILIAS  release_8 Revision v8.23
ilObjBibliographic Class Reference

Class ilObjBibliographic. More...

+ Inheritance diagram for ilObjBibliographic:
+ Collaboration diagram for ilObjBibliographic:

Public Member Functions

 __construct (int $existant_bibl_id=0)
 If bibliographic object exists, read it's data from database, otherwise create it. More...
 
 getFileDirectory ()
 
 getFilePath (bool $without_filename=false)
 
 setFilename (string $filename)
 
 getFilename ()
 
 getFileAbsolutePath ()
 
 getLegacyAbsolutePath ()
 
 getFileTypeAsString ()
 
 getFileType ()
 
 cloneStructure (int $original_id)
 Attention only use this for objects who have not yet been created (use like: $x = new ilObjDataCollection; $x->cloneStructure($id)) More...
 
 parseFileToDatabase ()
 Reads out the source file and writes all entries to the database. More...
 
 setFileType (int $file_type)
 
 setOnline (bool $a_online)
 
 getOnline ()
 
 setResourceId (ResourceIdentification $identification)
 
 getResourceId ()
 
 getStorageId ()
 
 isMigrated ()
 
 setMigrated (bool $migrated)
 
 determineFileTypeByFileName (string $filename)
 
- Public Member Functions inherited from ilObject2
 __construct (int $a_id=0, bool $a_reference=true)
 Constructor. More...
 
 read ()
 
 create (bool $a_clone_mode=false)
 
 update ()
 
 delete ()
 
 cloneMetaData (ilObject $target_obj)
 
 cloneObject (int $target_id, int $copy_id=0, bool $omit_tree=false)
 
- Public Member Functions inherited from ilObject
 __construct (int $id=0, bool $reference=true)
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 processAutoRating ()
 
 read ()
 
 getId ()
 
 setId (int $id)
 
 setRefId (int $ref_id)
 
 getRefId ()
 
 getType ()
 
 setType (string $type)
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 
 getUntranslatedTitle ()
 Get untranslated object title WebDAV needs to access the untranslated title of an object. More...
 
 setTitle (string $title)
 
 getDescription ()
 
 setDescription (string $desc)
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 
 setImportId (string $import_id)
 
 setOfflineStatus (bool $status)
 
 getOfflineStatus ()
 
 supportsOfflineHandling ()
 
 getOwner ()
 
 getOwnerName ()
 get full name of object owner More...
 
 setOwner (int $usr_id)
 
 getCreateDate ()
 Get create date in YYYY-MM-DD HH-MM-SS format. More...
 
 getLastUpdateDate ()
 Get last update date in YYYY-MM-DD HH-MM-SS format. More...
 
 create ()
 note: title, description and type should be set when this function is called More...
 
 update ()
 
 MDUpdateListener (string $element)
 Metadata update listener. More...
 
 createMetaData ()
 
 updateMetaData ()
 
 deleteMetaData ()
 
 updateOwner ()
 update owner of object in db More...
 
 putInTree (int $parent_ref_id)
 maybe this method should be in tree object!? More...
 
 setPermissions (int $parent_ref_id)
 
 setParentRolePermissions (int $parent_ref_id)
 Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g. More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 
 delete ()
 delete object or referenced object (in the case of a referenced object, object data is only deleted if last reference is deleted) This function removes an object entirely from system!! More...
 
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type. More...
 
 applyDidacticTemplate (int $tpl_id)
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 appendCopyInfo (int $target_id, int $copy_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies (int $target_id, int $copy_id)
 Clone object dependencies. More...
 
 cloneMetaData (ilObject $target_obj)
 Copy meta data. More...
 
 selfOrParentWithRatingEnabled ()
 
 getPossibleSubObjects (bool $filter=true)
 get all possible sub objects of this type the object can decide which types of sub objects are possible jut in time overwrite if the decision distinguish from standard model More...
 

Protected Member Functions

 initType ()
 
 doCreate (bool $clone_mode=false)
 Create object. More...
 
 doUpdate ()
 
 doDelete (bool $leave_out_il_bibl_data=false, bool $leave_out_delete_file=false)
 
 deleteFile ()
 
 doCloneObject (ilObject2 $new_obj, int $a_target_id, ?int $a_copy_id=null)
 
- Protected Member Functions inherited from ilObject2
 initType ()
 
 doRead ()
 
 doCreate (bool $clone_mode=false)
 
 beforeCreate ()
 If overwritten this method should return true, there is currently no "abort" handling for cases where "false" is returned. More...
 
 doUpdate ()
 
 beforeUpdate ()
 
 doDelete ()
 
 beforeDelete ()
 
 doCloneObject (ilObject2 $new_obj, int $a_target_id, ?int $a_copy_id=null)
 
 beforeCloneObject ()
 
- Protected Member Functions inherited from ilObject
 doMDUpdateListener (string $a_element)
 
 beforeMDUpdateListener (string $a_element)
 
 doCreateMetaData ()
 
 beforeCreateMetaData ()
 
 doUpdateMetaData ()
 
 beforeUpdateMetaData ()
 
 doDeleteMetaData ()
 
 beforeDeleteMetaData ()
 
 handleAutoRating ()
 
 hasAutoRating ()
 

Protected Attributes

ILIAS Filesystem Filesystem $filesystem
 
FileUpload $upload_service
 
ilBiblFileReaderFactory $bib_filereader_factory
 
ilBiblTypeFactory $bib_type_factory
 
ilBiblEntryFactory $bib_entry_factory
 
ilBiblFieldFactory $bib_field_factory
 
ilBiblDataFactoryInterface $bib_data_factory
 
ilBiblOverviewModelFactory $bib_overview_factory
 
ilBiblAttributeFactory $bib_attribute_factory
 
Services $storage
 
ilObjBibliographicStakeholder $stakeholder
 
string $filename = null
 
array $entries = []
 
bool $is_online = false
 
int $file_type = 0
 
ILIAS ResourceStorage Identification ResourceIdentification $resource_id = null
 
bool $is_migrated = false
 
- Protected Attributes inherited from ilObject
ilLogger $obj_log
 
ILIAS $ilias
 
ilObjectDefinition $obj_definition
 
ilDBInterface $db
 
ilLogger $log
 
ilErrorHandling $error
 
ilTree $tree
 
ilAppEventHandler $app_event_handler
 
ilRbacAdmin $rbac_admin
 
ilRbacReview $rbac_review
 
ilObjUser $user
 
ilLanguage $lng
 
int $id
 
bool $referenced
 
bool $call_by_reference
 
int $max_title = self::TITLE_LENGTH
 
int $max_desc = self::DESC_LENGTH
 
bool $add_dots = true
 
int $ref_id = null
 
string $type = ""
 
string $title = ""
 
bool $offline = false
 
string $desc = ""
 
string $long_desc = ""
 
int $owner = 0
 
string $create_date = ""
 
string $last_update = ""
 
string $import_id = ""
 
bool $register = false
 

Private Member Functions

 handleUpload ()
 handles a FileUpload and returns an IRSS identification string. More...
 
 copyFile (string $file_to_copy)
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId (string $import_id)
 Get (latest) object id for an import id. More...
 
static _lookupImportId (int $obj_id)
 
static _lookupOwnerName (int $owner_id)
 Lookup owner name for owner id. More...
 
static _getIdForImportId (string $import_id)
 
static _getAllReferences (int $id)
 get all reference ids for object ID More...
 
static _lookupTitle (int $obj_id)
 
static lookupOfflineStatus (int $obj_id)
 Lookup offline status using objectDataCache. More...
 
static _lookupOwner (int $obj_id)
 Lookup owner user ID for object ID. More...
 
static _getIdsForTitle (string $title, string $type='', bool $partial_match=false)
 
static _lookupDescription (int $obj_id)
 
static _lookupLastUpdate (int $obj_id, bool $formatted=false)
 
static _getLastUpdateOfObjects (array $obj_ids)
 
static _lookupObjId (int $ref_id)
 
static _setDeletedDate (int $ref_id, int $deleted_by)
 
static setDeletedDates (array $ref_ids, int $user_id)
 
static _resetDeletedDate (int $ref_id)
 
static _lookupDeletedDate (int $ref_id)
 
static _writeTitle (int $obj_id, string $title)
 write title to db (static) More...
 
static _writeDescription (int $obj_id, string $desc)
 write description to db (static) More...
 
static _writeImportId (int $obj_id, string $import_id)
 write import id to db (static) More...
 
static _lookupType (int $id, bool $reference=false)
 
static _isInTrash (int $ref_id)
 
static _hasUntrashedReference (int $obj_id)
 checks whether an object has at least one reference that is not in trash More...
 
static _lookupObjectId (int $ref_id)
 
static _getObjectsDataForType (string $type, bool $omit_trash=false)
 get all objects of a certain type More...
 
static _exists (int $id, bool $reference=false, ?string $type=null)
 checks if an object exists in object_data More...
 
static _getObjectsByType (string $obj_type="", int $owner=null)
 
static _prepareCloneSelection (array $ref_ids, string $new_type, bool $show_path=true)
 Prepare copy wizard object selection. More...
 
static _getIcon (int $obj_id=0, string $size="big", string $type="", bool $offline=false)
 Get icon for repository item. More...
 
static collectDeletionDependencies (array &$deps, int $ref_id, int $obj_id, string $type, int $depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies (int $obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $obj_ids)
 
static getAllOwnedRepositoryObjects (int $user_id)
 
static fixMissingTitles ($type, array &$obj_title_map)
 Try to fix missing object titles. More...
 
static _lookupCreationDate (int $obj_id)
 
static _getObjectTypeIdByTitle (string $type, \ilDBInterface $ilDB=null)
 
- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 
const DESC_LENGTH = 128
 
const LONG_DESC_LENGTH = 4000
 
const TABLE_OBJECT_DATA = "object_data"
 
array $objectList
 
string $untranslatedTitle
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjBibliographic::__construct ( int  $existant_bibl_id = 0)

If bibliographic object exists, read it's data from database, otherwise create it.

Parameters
int$existant_bibl_idis not set when object is getting created

Definition at line 60 of file class.ilObjBibliographic.php.

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ilObject2\doRead(), ILIAS\Repository\filesystem(), and ilObject\setId().

61  {
62  global $DIC;
63 
64  $this->storage = $DIC->resourceStorage();
65  $this->upload_service = $DIC->upload();
66  $this->stakeholder = new ilObjBibliographicStakeholder();
67  $this->filesystem = $DIC->filesystem()->storage();
68 
69  if ($existant_bibl_id) {
70  $this->setId($existant_bibl_id);
71  $this->doRead();
72  }
73  parent::__construct($existant_bibl_id, false);
74 
75  $this->bib_type_factory = new ilBiblTypeFactory();
76  $this->bib_field_factory = new ilBiblFieldFactory($this->bib_type_factory->getInstanceForType($this->getFileType()));
77  $this->bib_overview_factory = new ilBiblOverviewModelFactory();
78  $this->bib_entry_factory = new ilBiblEntryFactory(
79  $this->bib_field_factory,
80  $this->bib_type_factory->getInstanceForType($this->getFileType()),
81  $this->bib_overview_factory
82  );
83  $this->bib_filereader_factory = new ilBiblFileReaderFactory();
84  $this->bib_attribute_factory = new ilBiblAttributeFactory($this->bib_field_factory);
85  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setId(int $id)
global $DIC
Definition: feed.php:28
Class ilObjBibliographicStakeholder.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

Member Function Documentation

◆ cloneStructure()

ilObjBibliographic::cloneStructure ( int  $original_id)

Attention only use this for objects who have not yet been created (use like: $x = new ilObjDataCollection; $x->cloneStructure($id))

Parameters
int$original_idThe original ID of the dataselection you want to clone it's structure

Definition at line 330 of file class.ilObjBibliographic.php.

References copyFile(), doUpdate(), parseFileToDatabase(), ilObject\setDescription(), setFilename(), setMigrated(), setResourceId(), ilObject\setTitle(), and ilObject\setType().

330  : void
331  {
332  $original = new ilObjBibliographic($original_id);
333  $this->setFilename($original->getFilename());
334  $this->setDescription($original->getDescription());
335  $this->setTitle($original->getTitle());
336  $this->setType($original->getType());
337  $identification = $original->getResourceId();
338  if ($identification instanceof ResourceIdentification) {
339  $new_identification = $this->storage->manage()->clone($identification);
340  $this->setResourceId($new_identification);
341  } else {
342  $this->copyFile($original->getFileAbsolutePath());
343  }
344  $this->parseFileToDatabase();
345  $this->setMigrated($original->isMigrated());
346  $this->doUpdate();
347  }
setTitle(string $title)
setType(string $type)
setDescription(string $desc)
setResourceId(ResourceIdentification $identification)
copyFile(string $file_to_copy)
Class ilObjBibliographic.
parseFileToDatabase()
Reads out the source file and writes all entries to the database.
+ Here is the call graph for this function:

◆ copyFile()

ilObjBibliographic::copyFile ( string  $file_to_copy)
private
Deprecated:

Definition at line 223 of file class.ilObjBibliographic.php.

References ILIAS\Repository\filesystem(), and getFileDirectory().

Referenced by cloneStructure().

223  : void
224  {
225  $target = $this->getFileDirectory() . '/' . basename($file_to_copy);
226  $this->filesystem->copy($file_to_copy, $target);
227  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteFile()

ilObjBibliographic::deleteFile ( )
protected

Definition at line 229 of file class.ilObjBibliographic.php.

References Vendor\Package\$e, $path, ILIAS\Repository\filesystem(), and getFileDirectory().

Referenced by doDelete(), and doUpdate().

229  : bool
230  {
231  $path = $this->getFileDirectory();
232  try {
233  $this->filesystem->deleteDir($path);
234  } catch (\ILIAS\Filesystem\Exception\IOException $e) {
235  return false;
236  }
237 
238  return true;
239  }
Class ChatMainBarProvider .
$path
Definition: ltiservices.php:32
Class FlySystemFileAccessTest disabled disabled disabled.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ determineFileTypeByFileName()

ilObjBibliographic::determineFileTypeByFileName ( string  $filename)

Definition at line 415 of file class.ilObjBibliographic.php.

Referenced by doCreate().

415  : int
416  {
417  return $this->bib_type_factory->getInstanceForFileName($filename)->getId();
418  }
+ Here is the caller graph for this function:

◆ doCloneObject()

ilObjBibliographic::doCloneObject ( ilObject2  $new_obj,
int  $a_target_id,
?int  $a_copy_id = null 
)
protected

Definition at line 310 of file class.ilObjBibliographic.php.

References ilCopyWizardOptions\_getInstance(), ilObject\getId(), and getOnline().

310  : void
311  {
312  assert($new_obj instanceof ilObjBibliographic);
313  //copy online status if object is not the root copy object
314  $cp_options = ilCopyWizardOptions::_getInstance($a_copy_id);
315 
316  if (!$cp_options->isRootNode($this->getRefId())) {
317  $new_obj->setOnline($this->getOnline());
318  }
319 
320  $new_obj->cloneStructure($this->getId());
321  $new_obj->parseFileToDatabase();
322  }
static _getInstance(int $a_copy_id)
Class ilObjBibliographic.
+ Here is the call graph for this function:

◆ doCreate()

ilObjBibliographic::doCreate ( bool  $clone_mode = false)
protected

Create object.

Parameters
bool$clone_mode

Definition at line 118 of file class.ilObjBibliographic.php.

References ilObject\$id, determineFileTypeByFileName(), ilObject2\doRead(), getFilename(), ilObject\getId(), getOnline(), getResourceId(), handleUpload(), parseFileToDatabase(), setFilename(), setFileType(), setMigrated(), setOnline(), setResourceId(), and ActiveRecord\where().

118  : void
119  {
120  if ($this->upload_service->hasUploads()) {
121  $this->setResourceId($this->handleUpload());
122  }
123 
124  $this->db->insert(
125  "il_bibl_data",
126  [
127  "id" => ["integer", $this->getId()],
128  "filename" => ["text", $this->getFilename()],
129  "is_online" => ["integer", $this->getOnline()],
130  "file_type" => ["integer",
131  $this->getFilename() ? $this->determineFileTypeByFileName($this->getFilename()) : ""
132  ],
133  "rid" => ["string", ($rid = $this->getResourceId()) ? $rid->serialize() : ''],
134  ]
135  );
136  $this->parseFileToDatabase();
137  }
handleUpload()
handles a FileUpload and returns an IRSS identification string.
determineFileTypeByFileName(string $filename)
setResourceId(ResourceIdentification $identification)
parseFileToDatabase()
Reads out the source file and writes all entries to the database.
+ Here is the call graph for this function:

◆ doDelete()

ilObjBibliographic::doDelete ( bool  $leave_out_il_bibl_data = false,
bool  $leave_out_delete_file = false 
)
protected

Definition at line 186 of file class.ilObjBibliographic.php.

References ilHistory\_removeEntriesForObject(), deleteFile(), and ilObject\getId().

186  : void
187  {
188  if (!$leave_out_delete_file) {
189  $this->deleteFile();
190  }
191  //il_bibl_attribute
192  $this->db->manipulate(
193  "DELETE FROM il_bibl_attribute WHERE il_bibl_attribute.entry_id IN "
194  . "(SELECT il_bibl_entry.id FROM il_bibl_entry WHERE il_bibl_entry.data_id = " . $this->db->quote(
195  $this->getId(),
196  "integer"
197  ) . ")"
198  );
199  //il_bibl_entry
200  $this->bib_entry_factory->deleteEntryById($this->getId());
201 
202  if (!$leave_out_il_bibl_data) {
203  //il_bibl_data
204  $this->db->manipulate(
205  "DELETE FROM il_bibl_data WHERE id = " . $this->db->quote($this->getId(), "integer")
206  );
207  }
208  // delete history entries
210  }
static _removeEntriesForObject(int $a_obj_id)
remove all history entries for an object
+ Here is the call graph for this function:

◆ doUpdate()

ilObjBibliographic::doUpdate ( )
protected

Definition at line 154 of file class.ilObjBibliographic.php.

References deleteFile(), ilObject2\doDelete(), getFilename(), getFileType(), ilObject\getId(), getOnline(), getResourceId(), handleUpload(), isMigrated(), parseFileToDatabase(), setMigrated(), and setResourceId().

Referenced by cloneStructure().

154  : void
155  {
156  $has_valid_upload = $this->upload_service->hasUploads() && !$this->upload_service->hasBeenProcessed();
157 
158  if ($has_valid_upload) {
159  $identification = $this->handleUpload();
160  if ($identification instanceof ResourceIdentification) {
161  $this->setResourceId($identification);
162  if (!$this->isMigrated()) {
163  $this->deleteFile();
164  $this->setMigrated(true);
165  }
166  }
167  }
168  if ($has_valid_upload) {
169  // Delete the object, but leave the db table 'il_bibl_data' for being able to update it using WHERE, and also leave the file
170  $this->doDelete(true, true);
171  $this->parseFileToDatabase();
172  }
173 
174  $this->db->update(
175  "il_bibl_data",
176  [
177  "filename" => ["text", $this->getFilename()],
178  "is_online" => ["integer", $this->getOnline()],
179  "file_type" => ["integer", $this->getFileType()],
180  "rid" => ["string", ($rid = $this->getResourceId()) ? $rid->serialize() : ''],
181  ],
182  ["id" => ["integer", $this->getId()]]
183  );
184  }
handleUpload()
handles a FileUpload and returns an IRSS identification string.
setResourceId(ResourceIdentification $identification)
parseFileToDatabase()
Reads out the source file and writes all entries to the database.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFileAbsolutePath()

ilObjBibliographic::getFileAbsolutePath ( )
Returns
string returns the absolute filepath of the bib/ris file. it's build as follows: /bibl/$id/$filename

Definition at line 275 of file class.ilObjBibliographic.php.

References getFileDirectory(), and getFilename().

Referenced by getLegacyAbsolutePath().

275  : string
276  {
277  return $this->getFileDirectory() . DIRECTORY_SEPARATOR . $this->getFilename();
278  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFileDirectory()

ilObjBibliographic::getFileDirectory ( )
Deprecated:

Definition at line 215 of file class.ilObjBibliographic.php.

Referenced by copyFile(), deleteFile(), and getFileAbsolutePath().

215  : string
216  {
217  return "{$this->getType()}/{$this->getId()}";
218  }
+ Here is the caller graph for this function:

◆ getFilename()

ilObjBibliographic::getFilename ( )

Definition at line 260 of file class.ilObjBibliographic.php.

References $filename, and getResourceId().

Referenced by doCreate(), doUpdate(), getFileAbsolutePath(), getFilePath(), and getFileType().

260  : ?string
261  {
262  if ($this->getResourceId()) {
263  return $this->filename = $this->storage->manage()
264  ->getCurrentRevision($this->getResourceId())
265  ->getInformation()
266  ->getTitle();
267  }
268  return $this->filename;
269  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFilePath()

ilObjBibliographic::getFilePath ( bool  $without_filename = false)
Returns
string|void

Definition at line 244 of file class.ilObjBibliographic.php.

References getFilename().

245  {
246  $file_name = $this->getFilename();
247 
248  if ($without_filename) {
249  return substr($file_name, 0, strrpos($file_name, DIRECTORY_SEPARATOR));
250  } else {
251  return $file_name;
252  }
253  }
+ Here is the call graph for this function:

◆ getFileType()

ilObjBibliographic::getFileType ( )

Definition at line 299 of file class.ilObjBibliographic.php.

References ilBiblTypeFactoryInterface\DATA_TYPE_BIBTEX, and getFilename().

Referenced by ilBiblFactoryFacade\__construct(), doUpdate(), getFileTypeAsString(), and parseFileToDatabase().

299  : int
300  {
301  $filename = $this->getFilename();
302  if ($filename === null) {
304  }
305  $instance = $this->bib_type_factory->getInstanceForFileName($filename);
306 
307  return $instance->getId();
308  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFileTypeAsString()

ilObjBibliographic::getFileTypeAsString ( )
Deprecated:
use type factory instead of string representation

Definition at line 292 of file class.ilObjBibliographic.php.

References ilObject\$type, and getFileType().

292  : string
293  {
294  $type = $this->getFileType();
295 
296  return $this->bib_type_factory->getInstanceForType($type)->getStringRepresentation();
297  }
string $type
+ Here is the call graph for this function:

◆ getLegacyAbsolutePath()

ilObjBibliographic::getLegacyAbsolutePath ( )

Definition at line 280 of file class.ilObjBibliographic.php.

References ILIAS\Repository\filesystem(), getFileAbsolutePath(), getResourceId(), and isMigrated().

281  {
282  $stream = ($this->isMigrated()) ?
283  $this->storage->consume()->stream($this->getResourceId())->getStream() :
284  $this->filesystem->readStream($this->getFileAbsolutePath());
285 
286  return $stream->getMetadata('uri');
287  }
+ Here is the call graph for this function:

◆ getOnline()

ilObjBibliographic::getOnline ( )

Definition at line 379 of file class.ilObjBibliographic.php.

References $is_online.

Referenced by doCloneObject(), doCreate(), and doUpdate().

379  : bool
380  {
381  return $this->is_online;
382  }
+ Here is the caller graph for this function:

◆ getResourceId()

ilObjBibliographic::getResourceId ( )
Returns
ResourceIdentification

Definition at line 392 of file class.ilObjBibliographic.php.

References $resource_id.

Referenced by doCreate(), doUpdate(), getFilename(), getLegacyAbsolutePath(), getStorageId(), handleUpload(), and parseFileToDatabase().

393  {
394  return $this->resource_id;
395  }
ILIAS ResourceStorage Identification ResourceIdentification $resource_id
+ Here is the caller graph for this function:

◆ getStorageId()

ilObjBibliographic::getStorageId ( )

Definition at line 397 of file class.ilObjBibliographic.php.

References getResourceId().

397  : string
398  {
399  if (!$this->getResourceId() instanceof ResourceIdentification) {
400  return '-';
401  }
402  return $this->storage->manage()->getResource($this->getResourceId())->getStorageID();
403  }
+ Here is the call graph for this function:

◆ handleUpload()

ilObjBibliographic::handleUpload ( )
private

handles a FileUpload and returns an IRSS identification string.

Exceptions

Definition at line 91 of file class.ilObjBibliographic.php.

References getResourceId().

Referenced by doCreate(), and doUpdate().

92  {
93  if (!$this->upload_service->hasBeenProcessed()) {
94  $this->upload_service->process();
95  }
96  $array_result = $this->upload_service->getResults();
97  $result = reset($array_result); // FileUpload is the first element
98  if (!$result->isOK()) {
99  return null;
100  }
101 
102  if ($this->getResourceId()) {
103  $this->storage->manage()->appendNewRevision(
104  $this->getResourceId(),
105  $result,
106  $this->stakeholder
107  );
108  return $this->getResourceId();
109  }
110 
111  return $this->storage->manage()->upload($result, $this->stakeholder);
112  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initType()

ilObjBibliographic::initType ( )
protected

Definition at line 51 of file class.ilObjBibliographic.php.

51  : void
52  {
53  $this->type = "bibl";
54  }

◆ isMigrated()

ilObjBibliographic::isMigrated ( )

Definition at line 405 of file class.ilObjBibliographic.php.

References $is_migrated.

Referenced by doUpdate(), and getLegacyAbsolutePath().

405  : bool
406  {
407  return $this->is_migrated;
408  }
+ Here is the caller graph for this function:

◆ parseFileToDatabase()

ilObjBibliographic::parseFileToDatabase ( )

Reads out the source file and writes all entries to the database.

Definition at line 352 of file class.ilObjBibliographic.php.

References ilObject\$type, getFileType(), and getResourceId().

Referenced by cloneStructure(), doCreate(), and doUpdate().

352  : void
353  {
354  //Read File
355  if ($this->getResourceId() === null) {
356  return;
357  }
358  $type = $this->getFileType();
359  $reader = $this->bib_filereader_factory->getByType(
360  $type,
361  $this->bib_entry_factory,
362  $this->bib_field_factory,
363  $this->bib_attribute_factory
364  );
365  $reader->readContent($this->getResourceId());
366  $this->entries = $reader->parseContentToEntries($this);
367  }
string $type
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setFilename()

ilObjBibliographic::setFilename ( string  $filename)

Definition at line 255 of file class.ilObjBibliographic.php.

References $filename.

Referenced by cloneStructure(), and doCreate().

255  : void
256  {
257  $this->filename = $filename;
258  }
+ Here is the caller graph for this function:

◆ setFileType()

ilObjBibliographic::setFileType ( int  $file_type)

Definition at line 369 of file class.ilObjBibliographic.php.

References $file_type.

Referenced by doCreate().

369  : void
370  {
371  $this->file_type = $file_type;
372  }
+ Here is the caller graph for this function:

◆ setMigrated()

ilObjBibliographic::setMigrated ( bool  $migrated)

Definition at line 410 of file class.ilObjBibliographic.php.

Referenced by cloneStructure(), doCreate(), and doUpdate().

410  : void
411  {
412  $this->is_migrated = $migrated;
413  }
+ Here is the caller graph for this function:

◆ setOnline()

ilObjBibliographic::setOnline ( bool  $a_online)

Definition at line 374 of file class.ilObjBibliographic.php.

Referenced by doCreate().

374  : void
375  {
376  $this->is_online = $a_online;
377  }
+ Here is the caller graph for this function:

◆ setResourceId()

ilObjBibliographic::setResourceId ( ResourceIdentification  $identification)

Definition at line 384 of file class.ilObjBibliographic.php.

Referenced by cloneStructure(), doCreate(), and doUpdate().

384  : void
385  {
386  $this->resource_id = $identification;
387  }
+ Here is the caller graph for this function:

Field Documentation

◆ $bib_attribute_factory

ilBiblAttributeFactory ilObjBibliographic::$bib_attribute_factory
protected

Definition at line 41 of file class.ilObjBibliographic.php.

◆ $bib_data_factory

ilBiblDataFactoryInterface ilObjBibliographic::$bib_data_factory
protected

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

◆ $bib_entry_factory

ilBiblEntryFactory ilObjBibliographic::$bib_entry_factory
protected

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

◆ $bib_field_factory

ilBiblFieldFactory ilObjBibliographic::$bib_field_factory
protected

Definition at line 38 of file class.ilObjBibliographic.php.

◆ $bib_filereader_factory

ilBiblFileReaderFactory ilObjBibliographic::$bib_filereader_factory
protected

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

◆ $bib_overview_factory

ilBiblOverviewModelFactory ilObjBibliographic::$bib_overview_factory
protected

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

◆ $bib_type_factory

ilBiblTypeFactory ilObjBibliographic::$bib_type_factory
protected

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

◆ $entries

array ilObjBibliographic::$entries = []
protected

Definition at line 45 of file class.ilObjBibliographic.php.

◆ $file_type

int ilObjBibliographic::$file_type = 0
protected

Definition at line 47 of file class.ilObjBibliographic.php.

Referenced by setFileType().

◆ $filename

string ilObjBibliographic::$filename = null
protected

Definition at line 44 of file class.ilObjBibliographic.php.

Referenced by getFilename(), and setFilename().

◆ $filesystem

ILIAS Filesystem Filesystem ilObjBibliographic::$filesystem
protected

Definition at line 33 of file class.ilObjBibliographic.php.

◆ $is_migrated

bool ilObjBibliographic::$is_migrated = false
protected

Definition at line 49 of file class.ilObjBibliographic.php.

Referenced by isMigrated().

◆ $is_online

bool ilObjBibliographic::$is_online = false
protected

Definition at line 46 of file class.ilObjBibliographic.php.

Referenced by getOnline().

◆ $resource_id

ILIAS ResourceStorage Identification ResourceIdentification ilObjBibliographic::$resource_id = null
protected

Definition at line 48 of file class.ilObjBibliographic.php.

Referenced by getResourceId().

◆ $stakeholder

ilObjBibliographicStakeholder ilObjBibliographic::$stakeholder
protected

Definition at line 43 of file class.ilObjBibliographic.php.

◆ $storage

Services ilObjBibliographic::$storage
protected

Definition at line 42 of file class.ilObjBibliographic.php.

◆ $upload_service

FileUpload ilObjBibliographic::$upload_service
protected

Definition at line 34 of file class.ilObjBibliographic.php.


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