ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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)
 @description 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 ()
 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...
 
 cloneMetaData (ilObject $target_obj)
 Copy meta data. More...
 
 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, int $new_obj_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 62 of file class.ilObjBibliographic.php.

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

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

+ Here is the call graph for this function:

Member Function Documentation

◆ cloneStructure()

ilObjBibliographic::cloneStructure ( int  $original_id)

@description 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 332 of file class.ilObjBibliographic.php.

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

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

+ Here is the call graph for this function:

◆ copyFile()

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

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

226 : void
227 {
228 $target = $this->getFileDirectory() . '/' . basename($file_to_copy);
229 $this->filesystem->copy($file_to_copy, $target);
230 }

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

Referenced by cloneStructure().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteFile()

ilObjBibliographic::deleteFile ( )
protected

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

232 : bool
233 {
234 $path = $this->getFileDirectory();
235 try {
236 $this->filesystem->deleteDir($path);
237 } catch (IOException) {
238 return false;
239 }
240
241 return true;
242 }
Indicates general problems with the input or output operations.
Definition: IOException.php:28
$path
Definition: ltiservices.php:30

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

Referenced by doDelete(), and doUpdate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ determineFileTypeByFileName()

ilObjBibliographic::determineFileTypeByFileName ( string  $filename)

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

417 : int
418 {
419 return $this->bib_type_factory->getInstanceForFileName($filename)->getId();
420 }

References $filename.

Referenced by doCreate().

+ Here is the caller graph for this function:

◆ doCloneObject()

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

Reimplemented from ilObject2.

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

312 : void
313 {
314 assert($new_obj instanceof ilObjBibliographic);
315 //copy online status if object is not the root copy object
316 $cp_options = ilCopyWizardOptions::_getInstance($a_copy_id);
317
318 if (!$cp_options->isRootNode($this->getRefId())) {
319 $new_obj->getObjectProperties()->storePropertyIsOnline(new Online(false));
320 }
321
322 $new_obj->cloneStructure($this->getId());
323 $new_obj->parseFileToDatabase();
324 }
static _getInstance(int $a_copy_id)

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

+ Here is the call graph for this function:

◆ doCreate()

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

Create object.

Parameters
bool$clone_mode

Reimplemented from ilObject2.

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

120 : void
121 {
122 if ($this->upload_service->hasUploads()) {
123 if (!$this->upload_service->hasBeenProcessed()) {
124 $this->upload_service->process();
125 }
126 $this->setResourceId($this->handleUpload());
127 }
128
129 $this->db->insert(
130 "il_bibl_data",
131 [
132 "id" => ["integer", $this->getId()],
133 "filename" => ["text", $this->getFilename()],
134 "file_type" => ["integer",
135 $this->getFilename() ? $this->determineFileTypeByFileName($this->getFilename()) : ""
136 ],
137 "rid" => ["string", (($rid = $this->getResourceId()) !== null) ? $rid->serialize() : ''],
138 ]
139 );
140 $this->parseFileToDatabase();
141 $this->getObjectProperties()->storePropertyIsOnline(new Online(false));
142 }
determineFileTypeByFileName(string $filename)
handleUpload()
handles a FileUpload and returns an IRSS identification string.

References determineFileTypeByFileName(), getFilename(), ilObject\getId(), ilObject\getObjectProperties(), getResourceId(), handleUpload(), parseFileToDatabase(), and setResourceId().

+ 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 189 of file class.ilObjBibliographic.php.

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

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

+ Here is the call graph for this function:

◆ doUpdate()

ilObjBibliographic::doUpdate ( )
protected

Reimplemented from ilObject2.

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

158 : void
159 {
160 $has_valid_upload = $this->upload_service->hasUploads() && !$this->upload_service->hasBeenProcessed();
161
162 if ($has_valid_upload) {
163 $identification = $this->handleUpload();
164 if ($identification instanceof ResourceIdentification) {
165 $this->setResourceId($identification);
166 if (!$this->isMigrated()) {
167 $this->deleteFile();
168 $this->setMigrated(true);
169 }
170 }
171 }
172 if ($has_valid_upload) {
173 // Delete the object, but leave the db table 'il_bibl_data' for being able to update it using WHERE, and also leave the file
174 $this->doDelete(true, true);
175 $this->parseFileToDatabase();
176 }
177
178 $this->db->update(
179 "il_bibl_data",
180 [
181 "filename" => ["text", $this->getFilename()],
182 "file_type" => ["integer", $this->getFileType()],
183 "rid" => ["string", (($rid = $this->getResourceId()) !== null) ? $rid->serialize() : ''],
184 ],
185 ["id" => ["integer", $this->getId()]]
186 );
187 }

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

Referenced by cloneStructure().

+ 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 277 of file class.ilObjBibliographic.php.

277 : string
278 {
279 return $this->getFileDirectory() . DIRECTORY_SEPARATOR . $this->getFilename();
280 }

References getFileDirectory(), and getFilename().

Referenced by getLegacyAbsolutePath().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFileDirectory()

ilObjBibliographic::getFileDirectory ( )
Deprecated:

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

218 : string
219 {
220 return "{$this->getType()}/{$this->getId()}";
221 }

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

+ Here is the caller graph for this function:

◆ getFilename()

ilObjBibliographic::getFilename ( )

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

262 : ?string
263 {
264 if ($this->getResourceId() !== null) {
265 return $this->filename = $this->storage->manage()
266 ->getCurrentRevision($this->getResourceId())
267 ->getInformation()
268 ->getTitle();
269 }
270 return $this->filename;
271 }

References $filename, and getResourceId().

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

+ 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 247 of file class.ilObjBibliographic.php.

247 : ?string
248 {
249 $file_name = $this->getFilename();
250
251 if ($without_filename) {
252 return substr((string) $file_name, 0, strrpos((string) $file_name, DIRECTORY_SEPARATOR));
253 }
254 return $file_name;
255 }

References getFilename().

+ Here is the call graph for this function:

◆ getFileType()

ilObjBibliographic::getFileType ( )

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

301 : int
302 {
303 $filename = $this->getFilename();
304 if ($filename === null) {
306 }
307 $instance = $this->bib_type_factory->getInstanceForFileName($filename);
308
309 return $instance->getId();
310 }

References $filename, ilBiblTypeFactoryInterface\DATA_TYPE_BIBTEX, and getFilename().

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

+ 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 294 of file class.ilObjBibliographic.php.

294 : string
295 {
296 $type = $this->getFileType();
297
298 return $this->bib_type_factory->getInstanceForType($type)->getStringRepresentation();
299 }
string $type

References ilObject\$type, and getFileType().

+ Here is the call graph for this function:

◆ getLegacyAbsolutePath()

ilObjBibliographic::getLegacyAbsolutePath ( )

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

283 {
284 $stream = ($this->isMigrated()) ?
285 $this->storage->consume()->stream($this->getResourceId())->getStream() :
286 $this->filesystem->readStream($this->getFileAbsolutePath());
287
288 return $stream->getMetadata('uri');
289 }

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

+ Here is the call graph for this function:

◆ getResourceId()

ilObjBibliographic::getResourceId ( )
Returns
ResourceIdentification

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

395 {
396 return $this->resource_id;
397 }
ResourceIdentification $resource_id

References $resource_id.

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

+ Here is the caller graph for this function:

◆ getStorageId()

ilObjBibliographic::getStorageId ( )

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

399 : string
400 {
401 if (!$this->getResourceId() instanceof ResourceIdentification) {
402 return '-';
403 }
404 return $this->storage->manage()->getResource($this->getResourceId())->getStorageID();
405 }

References getResourceId().

Referenced by ILIAS\UI\Implementation\Component\Table\AbstractTable\getStorageData(), and ILIAS\UI\Implementation\Component\Table\AbstractTable\setStorageData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleUpload()

ilObjBibliographic::handleUpload ( )
private

handles a FileUpload and returns an IRSS identification string.

Exceptions
IllegalStateException

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

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

References getResourceId().

Referenced by doCreate(), and doUpdate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initType()

ilObjBibliographic::initType ( )
protected

Reimplemented from ilObject2.

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

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

◆ isMigrated()

ilObjBibliographic::isMigrated ( )

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

407 : bool
408 {
409 return $this->is_migrated;
410 }

References $is_migrated.

Referenced by doUpdate(), and getLegacyAbsolutePath().

+ 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 364 of file class.ilObjBibliographic.php.

364 : void
365 {
366 //Read File
367 if ($this->getResourceId() === null) {
368 return;
369 }
370 $type = $this->getFileType();
371 $reader = $this->bib_filereader_factory->getByType(
372 $type,
373 $this->bib_entry_factory,
374 $this->bib_field_factory,
375 $this->bib_attribute_factory
376 );
377 $reader->readContent($this->getResourceId());
378 $this->entries = $reader->parseContentToEntries($this);
379 }

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

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setFilename()

ilObjBibliographic::setFilename ( string  $filename)

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

257 : void
258 {
259 $this->filename = $filename;
260 }

References $filename.

Referenced by cloneStructure().

+ Here is the caller graph for this function:

◆ setFileType()

ilObjBibliographic::setFileType ( int  $file_type)

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

381 : void
382 {
383 $this->file_type = $file_type;
384 }

References $file_type.

◆ setMigrated()

ilObjBibliographic::setMigrated ( bool  $migrated)

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

412 : void
413 {
414 $this->is_migrated = $migrated;
415 }

Referenced by cloneStructure(), and doUpdate().

+ Here is the caller graph for this function:

◆ setResourceId()

ilObjBibliographic::setResourceId ( ResourceIdentification  $identification)

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

386 : void
387 {
388 $this->resource_id = $identification;
389 }

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

+ Here is the caller graph for this function:

Field Documentation

◆ $bib_attribute_factory

ilBiblAttributeFactory ilObjBibliographic::$bib_attribute_factory
protected

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

◆ $bib_data_factory

ilBiblDataFactoryInterface ilObjBibliographic::$bib_data_factory
protected

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

◆ $bib_entry_factory

ilBiblEntryFactory ilObjBibliographic::$bib_entry_factory
protected

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

◆ $bib_field_factory

ilBiblFieldFactory ilObjBibliographic::$bib_field_factory
protected

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

◆ $bib_filereader_factory

ilBiblFileReaderFactory ilObjBibliographic::$bib_filereader_factory
protected

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

◆ $bib_overview_factory

ilBiblOverviewModelFactory ilObjBibliographic::$bib_overview_factory
protected

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

◆ $bib_type_factory

ilBiblTypeFactory ilObjBibliographic::$bib_type_factory
protected

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

◆ $entries

array ilObjBibliographic::$entries = []
protected

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

◆ $file_type

int ilObjBibliographic::$file_type = 0
protected

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

Referenced by setFileType().

◆ $filename

string ilObjBibliographic::$filename = null
protected

◆ $filesystem

Filesystem ilObjBibliographic::$filesystem
protected

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

◆ $is_migrated

bool ilObjBibliographic::$is_migrated = false
protected

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

Referenced by isMigrated().

◆ $resource_id

ResourceIdentification ilObjBibliographic::$resource_id = null
protected

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

Referenced by getResourceId().

◆ $stakeholder

ilObjBibliographicStakeholder ilObjBibliographic::$stakeholder
protected

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

◆ $storage

Services ilObjBibliographic::$storage
protected

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

◆ $upload_service

FileUpload ilObjBibliographic::$upload_service
protected

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


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