ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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)
 
 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
 getObjectProperties ()
 
 flushObjectProperties ()
 
 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 $description)
 
 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 = []
 
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
 
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 = ""
 
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 59 of file class.ilObjBibliographic.php.

References $DIC, ILIAS\MetaData\Repository\Validation\Data\__construct(), ilObject2\doRead(), ILIAS\Repository\filesystem(), and ilObject\setId().

60  {
61  global $DIC;
62 
63  $this->storage = $DIC->resourceStorage();
64  $this->upload_service = $DIC->upload();
65  $this->stakeholder = new ilObjBibliographicStakeholder();
66  $this->filesystem = $DIC->filesystem()->storage();
67 
68  if ($existant_bibl_id) {
69  $this->setId($existant_bibl_id);
70  $this->doRead();
71  }
72  parent::__construct($existant_bibl_id, false);
73 
74  $this->bib_type_factory = new ilBiblTypeFactory();
75  $this->bib_field_factory = new ilBiblFieldFactory($this->bib_type_factory->getInstanceForType($this->getFileType()));
76  $this->bib_overview_factory = new ilBiblOverviewModelFactory();
77  $this->bib_entry_factory = new ilBiblEntryFactory(
78  $this->bib_field_factory,
79  $this->bib_type_factory->getInstanceForType($this->getFileType()),
80  $this->bib_overview_factory
81  );
82  $this->bib_filereader_factory = new ilBiblFileReaderFactory();
83  $this->bib_attribute_factory = new ilBiblAttributeFactory($this->bib_field_factory);
84  }
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
__construct(VocabulariesInterface $vocabularies)
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...
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 327 of file class.ilObjBibliographic.php.

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

327  : void
328  {
329  $original = new ilObjBibliographic($original_id);
330  $this->setFilename($original->getFilename());
331  $this->setDescription($original->getDescription());
332  $this->setTitle($original->getTitle());
333  $this->setType($original->getType());
334  $identification = $original->getResourceId();
335  if ($identification instanceof ResourceIdentification) {
336  $new_identification = $this->storage->manage()->clone($identification);
337  $this->setResourceId($new_identification);
338  } else {
339  $this->copyFile($original->getFileAbsolutePath());
340  }
341  $this->parseFileToDatabase();
342  $this->setMigrated($original->isMigrated());
343  $this->doUpdate();
344  }
setTitle(string $title)
setType(string $type)
setResourceId(ResourceIdentification $identification)
copyFile(string $file_to_copy)
Class ilObjBibliographic.
setDescription(string $description)
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 220 of file class.ilObjBibliographic.php.

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

Referenced by cloneStructure().

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

◆ deleteFile()

ilObjBibliographic::deleteFile ( )
protected

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

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

Referenced by doDelete(), and doUpdate().

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

◆ determineFileTypeByFileName()

ilObjBibliographic::determineFileTypeByFileName ( string  $filename)

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

Referenced by doCreate().

402  : int
403  {
404  return $this->bib_type_factory->getInstanceForFileName($filename)->getId();
405  }
+ 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 307 of file class.ilObjBibliographic.php.

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

307  : void
308  {
309  assert($new_obj instanceof ilObjBibliographic);
310  //copy online status if object is not the root copy object
311  $cp_options = ilCopyWizardOptions::_getInstance($a_copy_id);
312 
313  if (!$cp_options->isRootNode($this->getRefId())) {
314  $new_obj->getObjectProperties()->storePropertyIsOnline(new ilObjectPropertyIsOnline(false));
315  }
316 
317  $new_obj->cloneStructure($this->getId());
318  $new_obj->parseFileToDatabase();
319  }
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 117 of file class.ilObjBibliographic.php.

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

117  : void
118  {
119  if ($this->upload_service->hasUploads()) {
120  $this->setResourceId($this->handleUpload());
121  }
122 
123  $this->db->insert(
124  "il_bibl_data",
125  [
126  "id" => ["integer", $this->getId()],
127  "filename" => ["text", $this->getFilename()],
128  "file_type" => ["integer",
129  $this->getFilename() ? $this->determineFileTypeByFileName($this->getFilename()) : ""
130  ],
131  "rid" => ["string", ($rid = $this->getResourceId()) ? $rid->serialize() : ''],
132  ]
133  );
134  $this->parseFileToDatabase();
135  $this->getObjectProperties()->storePropertyIsOnline(new ilObjectPropertyIsOnline(false));
136  }
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 183 of file class.ilObjBibliographic.php.

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

183  : void
184  {
185  if (!$leave_out_delete_file) {
186  $this->deleteFile();
187  }
188  //il_bibl_attribute
189  $this->db->manipulate(
190  "DELETE FROM il_bibl_attribute WHERE il_bibl_attribute.entry_id IN "
191  . "(SELECT il_bibl_entry.id FROM il_bibl_entry WHERE il_bibl_entry.data_id = " . $this->db->quote(
192  $this->getId(),
193  "integer"
194  ) . ")"
195  );
196  //il_bibl_entry
197  $this->bib_entry_factory->deleteEntryById($this->getId());
198 
199  if (!$leave_out_il_bibl_data) {
200  //il_bibl_data
201  $this->db->manipulate(
202  "DELETE FROM il_bibl_data WHERE id = " . $this->db->quote($this->getId(), "integer")
203  );
204  }
205  // delete history entries
207  }
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 152 of file class.ilObjBibliographic.php.

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

Referenced by cloneStructure().

152  : void
153  {
154  $has_valid_upload = $this->upload_service->hasUploads() && !$this->upload_service->hasBeenProcessed();
155 
156  if ($has_valid_upload) {
157  $identification = $this->handleUpload();
158  if ($identification instanceof ResourceIdentification) {
159  $this->setResourceId($identification);
160  if (!$this->isMigrated()) {
161  $this->deleteFile();
162  $this->setMigrated(true);
163  }
164  }
165  }
166  if ($has_valid_upload) {
167  // Delete the object, but leave the db table 'il_bibl_data' for being able to update it using WHERE, and also leave the file
168  $this->doDelete(true, true);
169  $this->parseFileToDatabase();
170  }
171 
172  $this->db->update(
173  "il_bibl_data",
174  [
175  "filename" => ["text", $this->getFilename()],
176  "file_type" => ["integer", $this->getFileType()],
177  "rid" => ["string", ($rid = $this->getResourceId()) ? $rid->serialize() : ''],
178  ],
179  ["id" => ["integer", $this->getId()]]
180  );
181  }
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 272 of file class.ilObjBibliographic.php.

References getFileDirectory(), and getFilename().

Referenced by getLegacyAbsolutePath().

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

◆ getFileDirectory()

ilObjBibliographic::getFileDirectory ( )
Deprecated:

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

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

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

◆ getFilename()

ilObjBibliographic::getFilename ( )

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

References $filename, and getResourceId().

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

257  : ?string
258  {
259  if ($this->getResourceId()) {
260  return $this->filename = $this->storage->manage()
261  ->getCurrentRevision($this->getResourceId())
262  ->getInformation()
263  ->getTitle();
264  }
265  return $this->filename;
266  }
+ 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 241 of file class.ilObjBibliographic.php.

References getFilename().

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

◆ getFileType()

ilObjBibliographic::getFileType ( )

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

References ilBiblTypeFactoryInterface\DATA_TYPE_BIBTEX, and getFilename().

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

296  : int
297  {
298  $filename = $this->getFilename();
299  if ($filename === null) {
301  }
302  $instance = $this->bib_type_factory->getInstanceForFileName($filename);
303 
304  return $instance->getId();
305  }
+ 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 289 of file class.ilObjBibliographic.php.

References ilObject\$type, and getFileType().

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

◆ getLegacyAbsolutePath()

ilObjBibliographic::getLegacyAbsolutePath ( )

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

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

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

◆ getResourceId()

ilObjBibliographic::getResourceId ( )
Returns
ResourceIdentification

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

References $resource_id.

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

380  {
381  return $this->resource_id;
382  }
ILIAS ResourceStorage Identification ResourceIdentification $resource_id
+ Here is the caller graph for this function:

◆ getStorageId()

ilObjBibliographic::getStorageId ( )

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

References getResourceId().

384  : string
385  {
386  if (!$this->getResourceId() instanceof ResourceIdentification) {
387  return '-';
388  }
389  return $this->storage->manage()->getResource($this->getResourceId())->getStorageID();
390  }
+ 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 90 of file class.ilObjBibliographic.php.

References getResourceId().

Referenced by doCreate(), and doUpdate().

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

◆ initType()

ilObjBibliographic::initType ( )
protected

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

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

◆ isMigrated()

ilObjBibliographic::isMigrated ( )

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

References $is_migrated.

Referenced by doUpdate(), and getLegacyAbsolutePath().

392  : bool
393  {
394  return $this->is_migrated;
395  }
+ 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 349 of file class.ilObjBibliographic.php.

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

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

349  : void
350  {
351  //Read File
352  if ($this->getResourceId() === null) {
353  return;
354  }
355  $type = $this->getFileType();
356  $reader = $this->bib_filereader_factory->getByType(
357  $type,
358  $this->bib_entry_factory,
359  $this->bib_field_factory,
360  $this->bib_attribute_factory
361  );
362  $reader->readContent($this->getResourceId());
363  $this->entries = $reader->parseContentToEntries($this);
364  }
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 252 of file class.ilObjBibliographic.php.

References $filename.

Referenced by cloneStructure(), and doCreate().

252  : void
253  {
254  $this->filename = $filename;
255  }
+ Here is the caller graph for this function:

◆ setFileType()

ilObjBibliographic::setFileType ( int  $file_type)

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

References $file_type.

Referenced by doCreate().

366  : void
367  {
368  $this->file_type = $file_type;
369  }
+ Here is the caller graph for this function:

◆ setMigrated()

ilObjBibliographic::setMigrated ( bool  $migrated)

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

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

397  : void
398  {
399  $this->is_migrated = $migrated;
400  }
+ Here is the caller graph for this function:

◆ setResourceId()

ilObjBibliographic::setResourceId ( ResourceIdentification  $identification)

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

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

371  : void
372  {
373  $this->resource_id = $identification;
374  }
+ 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 46 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 48 of file class.ilObjBibliographic.php.

Referenced by isMigrated().

◆ $resource_id

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

Definition at line 47 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: