3require_once(
"./Services/DataSet/classes/class.ilDataSet.php");
4require_once(
'class.ilObjBibliographic.php');
49 parent::__construct();
59 return array(
'4.5.0' );
70 return 'http://www.ilias.de/xml/Modules/Bibliographic/' . $a_entity;
81 public function importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version) {
86 if($new_id = $a_mapping->getMapping(
'Services/Container',
'objs',$a_rec[
'id']))
93 $new_obj->setTitle($a_rec[
'title']);
94 $new_obj->setDescription($a_rec[
'description']);
95 $new_obj->setFilename($a_rec[
'fileName']);
96 $new_obj->setOnline(
false);
97 if (!$new_obj->getId()) {
100 $this->import_bib_object = $new_obj;
101 $a_mapping->addMapping(
'Modules/Bibliographic',
'bibl', $a_rec[
'id'], $new_obj->getId());
116 protected function getTypes($a_entity, $a_version) {
122 "description" =>
"text",
123 "filename" =>
"text",
124 'is_online' =>
'integer',
154 public function readData($a_entity, $a_version, $a_ids) {
155 $this->data = array();
156 if (! is_array($a_ids)) {
157 $a_ids = array( $a_ids );
172 foreach ($a_ids as $bibl_id) {
177 'title' => $obj->getTitle(),
178 'description' => $obj->getDescription(),
179 'fileName' => $obj->getFilename(),
180 'is_online' => $obj->getOnline(),
182 $this->data[] =
$data;
197 copy($obj->getFileAbsolutePath(), $this->absolute_export_dir .
"/" . $obj->getFilename());
206 .
"/Modules/Bibliographic/set_1/expDir_1/" . $this->import_bib_object->getFilename();
207 $new_id = $this->import_bib_object->getId();
210 copy($import_path, $new_path .
"/" . $this->import_bib_object->getFilename());
212 $this->import_bib_object->update();
An exception for terminatinating execution or to throw for unit testing.
Bibliographic dataset class.
importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
$record_field_ids_2_storage
importLibraryFile($a_mapping)
getXmlNamespace($a_entity, $a_schema_version)
getDependencies($a_entity, $a_version, $a_rec, $a_ids)
Return dependencies form entities to other entities (in our case these are all the DB relations)
readData($a_entity, $a_version, $a_ids)
Read data from Cache for a given entity and ID(s)
getTypes($a_entity, $a_version)
Map XML attributes of entities to datatypes (text, integer...)
_readData($a_entity, $a_ids)
Build data array, data is read from cache except bibl object itself.
__construct()
Constructor.
A dataset contains in data in a common structure that can be shared and transformed for different pur...
getImportDirectory()
Get import directory.
Class ilObjBibliographic.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static _lookupType($a_id, $a_reference=false)
lookup object type
static getDataDir()
get data directory (outside webspace)