ILIAS  trunk Revision v11.0_alpha-1838-g59fc79e306b
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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

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
 
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
 
LOMServices $lom_services
 
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 getIconForType (string $type)
 
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 61 of file class.ilObjBibliographic.php.

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

62  {
63  global $DIC;
64 
65  $this->storage = $DIC->resourceStorage();
66  $this->upload_service = $DIC->upload();
67  $this->stakeholder = new ilObjBibliographicStakeholder();
68  $this->filesystem = $DIC->filesystem()->storage();
69 
70  if ($existant_bibl_id !== 0) {
71  $this->setId($existant_bibl_id);
72  $this->doRead();
73  }
74  parent::__construct($existant_bibl_id, false);
75 
76  $this->bib_type_factory = new ilBiblTypeFactory();
77  $this->bib_field_factory = new ilBiblFieldFactory($this->bib_type_factory->getInstanceForType($this->getFileType()));
78  $this->bib_overview_factory = new ilBiblOverviewModelFactory();
79  $this->bib_entry_factory = new ilBiblEntryFactory(
80  $this->bib_field_factory,
81  $this->bib_type_factory->getInstanceForType($this->getFileType()),
82  $this->bib_overview_factory
83  );
84  $this->bib_filereader_factory = new ilBiblFileReaderFactory();
85  $this->bib_attribute_factory = new ilBiblAttributeFactory($this->bib_field_factory);
86  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setId(int $id)
Class ilObjBibliographicStakeholder.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: shib_login.php:22
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 331 of file class.ilObjBibliographic.php.

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

331  : void
332  {
333  $original = new ilObjBibliographic($original_id);
334  $this->setFilename($original->getFilename());
335  $this->setDescription($original->getDescription());
336  $this->setTitle($original->getTitle());
337  $this->setType($original->getType());
338  $identification = $original->getResourceId();
339  if ($identification instanceof ResourceIdentification) {
340  $new_identification = $this->storage->manage()->clone($identification);
341  $this->setResourceId($new_identification);
342  } else {
343  $this->copyFile($original->getFileAbsolutePath());
344  }
345  $this->parseFileToDatabase();
346  $this->setMigrated($original->isMigrated());
347  $this->doUpdate();
348 
349  // copy filters
350 
351  $filters = new ilBiblFieldFilterFactory();
352  foreach ($filters->getAllForObjectId($original_id) as $filter) {
353  $cloned_filter = clone $filter;
354  $cloned_filter->setId(0);
355  $cloned_filter->setObjectId($this->getId());
356  $cloned_filter->create();
357  }
358  }
setTitle(string $title)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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 225 of file class.ilObjBibliographic.php.

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

Referenced by cloneStructure().

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

◆ deleteFile()

ilObjBibliographic::deleteFile ( )
protected

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

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

Referenced by doDelete(), and doUpdate().

231  : bool
232  {
233  $path = $this->getFileDirectory();
234  try {
235  $this->filesystem->deleteDir($path);
236  } catch (IOException) {
237  return false;
238  }
239 
240  return true;
241  }
Indicates general problems with the input or output operations.
Definition: IOException.php:27
$path
Definition: ltiservices.php:29
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ determineFileTypeByFileName()

ilObjBibliographic::determineFileTypeByFileName ( string  $filename)

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

Referenced by doCreate().

416  : int
417  {
418  return $this->bib_type_factory->getInstanceForFileName($filename)->getId();
419  }
+ 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 311 of file class.ilObjBibliographic.php.

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

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

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

119  : void
120  {
121  if ($this->upload_service->hasUploads()) {
122  if (!$this->upload_service->hasBeenProcessed()) {
123  $this->upload_service->process();
124  }
125  $this->setResourceId($this->handleUpload());
126  }
127 
128  $this->db->insert(
129  "il_bibl_data",
130  [
131  "id" => ["integer", $this->getId()],
132  "filename" => ["text", $this->getFilename()],
133  "file_type" => ["integer",
134  $this->getFilename() ? $this->determineFileTypeByFileName($this->getFilename()) : ""
135  ],
136  "rid" => ["string", (($rid = $this->getResourceId()) !== null) ? $rid->serialize() : ''],
137  ]
138  );
139  $this->parseFileToDatabase();
140  $this->getObjectProperties()->storePropertyIsOnline(new ilObjectPropertyIsOnline(false));
141  }
handleUpload()
handles a FileUpload and returns an IRSS identification string.
determineFileTypeByFileName(string $filename)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
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 188 of file class.ilObjBibliographic.php.

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

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

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

Referenced by cloneStructure().

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

References getFileDirectory(), and getFilename().

Referenced by getLegacyAbsolutePath().

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

◆ getFileDirectory()

ilObjBibliographic::getFileDirectory ( )
Deprecated:

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

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

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

◆ getFilename()

ilObjBibliographic::getFilename ( )

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

References $filename, getResourceId(), and null.

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

261  : ?string
262  {
263  if ($this->getResourceId() !== null) {
264  return $this->filename = $this->storage->manage()
265  ->getCurrentRevision($this->getResourceId())
266  ->getInformation()
267  ->getTitle();
268  }
269  return $this->filename;
270  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ 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 246 of file class.ilObjBibliographic.php.

References getFilename().

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

◆ getFileType()

ilObjBibliographic::getFileType ( )

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

References ilBiblTypeFactoryInterface\DATA_TYPE_BIBTEX, getFilename(), and null.

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

300  : int
301  {
302  $filename = $this->getFilename();
303  if ($filename === null) {
305  }
306  $instance = $this->bib_type_factory->getInstanceForFileName($filename);
307 
308  return $instance->getId();
309  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ 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 293 of file class.ilObjBibliographic.php.

References ilObject\$type, and getFileType().

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

◆ getLegacyAbsolutePath()

ilObjBibliographic::getLegacyAbsolutePath ( )

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

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

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

◆ getResourceId()

ilObjBibliographic::getResourceId ( )
Returns
ResourceIdentification

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

References $resource_id.

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

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

◆ getStorageId()

ilObjBibliographic::getStorageId ( )

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

References getResourceId().

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

◆ handleUpload()

ilObjBibliographic::handleUpload ( )
private

handles a FileUpload and returns an IRSS identification string.

Exceptions
IllegalStateException

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

References getResourceId(), and null.

Referenced by doCreate(), and doUpdate().

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

◆ initType()

ilObjBibliographic::initType ( )
protected

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

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

◆ isMigrated()

ilObjBibliographic::isMigrated ( )

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

References $is_migrated.

Referenced by doUpdate(), and getLegacyAbsolutePath().

406  : bool
407  {
408  return $this->is_migrated;
409  }
+ 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 363 of file class.ilObjBibliographic.php.

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

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

363  : void
364  {
365  //Read File
366  if ($this->getResourceId() === null) {
367  return;
368  }
369  $type = $this->getFileType();
370  $reader = $this->bib_filereader_factory->getByType(
371  $type,
372  $this->bib_entry_factory,
373  $this->bib_field_factory,
374  $this->bib_attribute_factory
375  );
376  $reader->readContent($this->getResourceId());
377  $this->entries = $reader->parseContentToEntries($this);
378  }
string $type
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setFilename()

ilObjBibliographic::setFilename ( string  $filename)

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

References $filename.

Referenced by cloneStructure(), and doCreate().

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

◆ setFileType()

ilObjBibliographic::setFileType ( int  $file_type)

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

References $file_type.

Referenced by doCreate().

380  : void
381  {
382  $this->file_type = $file_type;
383  }
+ Here is the caller graph for this function:

◆ setMigrated()

ilObjBibliographic::setMigrated ( bool  $migrated)

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

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

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

◆ setResourceId()

ilObjBibliographic::setResourceId ( ResourceIdentification  $identification)

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

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

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

Field Documentation

◆ $bib_attribute_factory

ilBiblAttributeFactory ilObjBibliographic::$bib_attribute_factory
protected

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

◆ $bib_data_factory

ilBiblDataFactoryInterface ilObjBibliographic::$bib_data_factory
protected

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

◆ $bib_entry_factory

ilBiblEntryFactory ilObjBibliographic::$bib_entry_factory
protected

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

◆ $bib_field_factory

ilBiblFieldFactory ilObjBibliographic::$bib_field_factory
protected

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

◆ $bib_filereader_factory

ilBiblFileReaderFactory ilObjBibliographic::$bib_filereader_factory
protected

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

◆ $bib_overview_factory

ilBiblOverviewModelFactory ilObjBibliographic::$bib_overview_factory
protected

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

◆ $bib_type_factory

ilBiblTypeFactory ilObjBibliographic::$bib_type_factory
protected

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

◆ $entries

array ilObjBibliographic::$entries = []
protected

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

◆ $file_type

int ilObjBibliographic::$file_type = 0
protected

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

Referenced by setFileType().

◆ $filename

string ilObjBibliographic::$filename = null
protected

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

Referenced by getFilename(), and setFilename().

◆ $filesystem

Filesystem ilObjBibliographic::$filesystem
protected

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

◆ $is_migrated

bool ilObjBibliographic::$is_migrated = false
protected

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

Referenced by isMigrated().

◆ $resource_id

ResourceIdentification ilObjBibliographic::$resource_id = null
protected

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

Referenced by getResourceId().

◆ $stakeholder

ilObjBibliographicStakeholder ilObjBibliographic::$stakeholder
protected

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

◆ $storage

Services ilObjBibliographic::$storage
protected

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

◆ $upload_service

FileUpload ilObjBibliographic::$upload_service
protected

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


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