ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilBibliographicDataSet Class Reference

Bibliographic dataset class. More...

+ Inheritance diagram for ilBibliographicDataSet:
+ Collaboration diagram for ilBibliographicDataSet:

Public Member Functions

 __construct ()
 Constructor.
 getSupportedVersions ()
 getXmlNamespace ($a_entity, $a_schema_version)
 importRecord ($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
 readData ($a_entity, $a_version, $a_ids)
 Read data from Cache for a given entity and ID(s)
 exportLibraryFile ($a_id)
 importLibraryFile ($a_mapping)
- Public Member Functions inherited from ilDataSet
 init ($a_entity, $a_schema_version)
 Init.
 setExportDirectories ($a_relative, $a_absolute)
 Set export directories.
 setImportDirectory ($a_val)
 Set import directory.
 getImportDirectory ()
 Get import directory.
 setDSPrefix ($a_val)
 Set XML dataset namespace prefix.
 getDSPrefix ()
 Get XML dataset namespace prefix.
 getDSPrefixString ()
 getDirectDataFromQuery ($a_query, $a_convert_to_leading_upper=true)
 Get data from query.This is a standard procedure, all db field names are directly mapped to abstract fields.
 convertToLeadingUpper ($a_str)
 Make xyz_abc a XyzAbc string.
 getJsonRepresentation ()
 Get json representation.
 getXmlRepresentation ($a_entity, $a_schema_version, $a_ids, $a_field="", $a_omit_header=false, $a_omit_types=false)
 Get xml representation <dataset install_id="123" install_url="..."> <types entity="table_name" version="4.0.1"> <ftype name="field_1" type="text"> <ftype name="field_2" type="date"> <ftype name="field_3" type="integer"> </types> <types ...> ...
 addRecordsXml ($a_writer, $a_prefixes, $a_entity, $a_schema_version, $a_ids, $a_field="")
 Add records xml.
 afterXmlRecordWriting ($a_entity, $a_version, $a_set)
 After xml record writing hook record.
 getNamespaces (&$namespaces, $a_entity, $a_schema_version)
 Get xml namespaces.
 getXmlRecord ($a_entity, $a_version, $a_set)
 Get xml record for version.
 getJsonRecord ($a_set)
 Get json record for version.
 getXmlTypes ($a_entity, $a_version)
 Get xml types.
 getJsonTypes ($a_entity, $a_version)
 Get json types.
 getXMLEntityName ($a_entity, $a_version)
 Get entity name for xml (may be overwritten)
 getXMLEntityTag ($a_entity, $a_schema_version)
 Get entity tag.
 getJsonEntityName ($a_entity, $a_version)
 Get entity name for json (may be overwritten)
 setImport ($a_val)
 Set import object.
 getImport ()
 Get import object.

Protected Member Functions

 getTypes ($a_entity, $a_version)
 Map XML attributes of entities to datatypes (text, integer...)
 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_ids)
 Build data array, data is read from cache except bibl object itself.
- Protected Member Functions inherited from ilDataSet
 createObjectExportId ($a_type, $a_id)
 Build ilias export id.
 parseObjectExportId ($a_id, $a_fallback_id=NULL)
 Parse export id.

Protected Attributes

 $db
 $data = array()
 $record_field_ids_2_storage = array()
 $import_bib_object
 $user
 $import_temp_refs = array()
 $import_temp_refs_props = array()

Additional Inherited Members

- Data Fields inherited from ilDataSet
 $dircnt
const EXPORT_NO_INST_ID = 1
const EXPORT_ID_ILIAS_LOCAL = 2
const EXPORT_ID_ILIAS_LOCAL_INVALID = 3
const EXPORT_ID_ILIAS_REMOTE = 4
const EXPORT_ID_ILIAS_REMOTE_INVALID = 5
const EXPORT_ID = 6
const EXPORT_ID_INVALID = 7

Detailed Description

Bibliographic dataset class.

Author
Theodor Truffer tt@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch
Martin Studer ms@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch

Definition at line 11 of file class.ilBibliographicDataSet.php.

Constructor & Destructor Documentation

ilBibliographicDataSet::__construct ( )

Constructor.

Reimplemented from ilDataSet.

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

References $ilDB, and $ilUser.

{
global $ilDB, $ilUser;
$this->db = $ilDB;
$this->user = $ilUser;
}

Member Function Documentation

ilBibliographicDataSet::_readData (   $a_entity,
  $a_ids 
)
protected

Build data array, data is read from cache except bibl object itself.

Parameters
string$a_entity
array$a_ids

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

References $data, and ilObject\_lookupType().

Referenced by readData().

{
switch ($a_entity) {
case 'bibl':
foreach ($a_ids as $bibl_id) {
if (ilObject::_lookupType($bibl_id) == 'bibl') {
$obj = new ilObjBibliographic($bibl_id);
$data = array(
'id' => $bibl_id,
'title' => $obj->getTitle(),
'description' => $obj->getDescription(),
'fileName' => $obj->getFilename(),
'is_online' => $obj->getOnline(),
);
$this->data[] = $data;
}
}
break;
default:
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilBibliographicDataSet::exportLibraryFile (   $a_id)
Parameters
int$a_id

Definition at line 184 of file class.ilBibliographicDataSet.php.

{
$obj = new ilObjBibliographic($a_id);
copy($obj->getFileAbsolutePath(), $this->absolute_export_dir . "/" . $obj->getFilename());
}
ilBibliographicDataSet::getDependencies (   $a_entity,
  $a_version,
  $a_rec,
  $a_ids 
)
protected

Return dependencies form entities to other entities (in our case these are all the DB relations)

Parameters
string$a_entity
string$a_version
array$a_rec
array$a_ids
Returns
array

Definition at line 131 of file class.ilBibliographicDataSet.php.

{
return false;
}
ilBibliographicDataSet::getSupportedVersions ( )
Returns
array

Reimplemented from ilDataSet.

Definition at line 56 of file class.ilBibliographicDataSet.php.

{
return array( '4.5.0' );
}
ilBibliographicDataSet::getTypes (   $a_entity,
  $a_version 
)
protected

Map XML attributes of entities to datatypes (text, integer...)

Parameters
string$a_entity
string$a_version
Returns
array

Reimplemented from ilDataSet.

Definition at line 105 of file class.ilBibliographicDataSet.php.

{
switch ($a_entity) {
case 'bibl':
return array(
"id" => "integer",
"title" => "text",
"description" => "text",
"filename" => "text",
'is_online' => 'integer',
);
default:
return array();
}
}
ilBibliographicDataSet::getXmlNamespace (   $a_entity,
  $a_schema_version 
)
Parameters
string$a_entity
string$a_schema_version
Returns
string

Reimplemented from ilDataSet.

Definition at line 67 of file class.ilBibliographicDataSet.php.

{
return 'http://www.ilias.de/xml/Modules/Bibliographic/' . $a_entity;
}
ilBibliographicDataSet::importLibraryFile (   $a_mapping)
Parameters
ilImportMapping$a_mapping

Definition at line 193 of file class.ilBibliographicDataSet.php.

References ilUtil\getDataDir(), and ilDataSet\getImportDirectory().

Referenced by importRecord().

{
$import_path = $this->getImportDirectory()
. "/Modules/Bibliographic/set_1/expDir_1/" . $this->import_bib_object->getFilename();
$new_id = $this->import_bib_object->getId();
$new_path = ilUtil::getDataDir() . "/bibl/" . $new_id;
mkdir($new_path);
copy($import_path, $new_path . "/" . $this->import_bib_object->getFilename());
$this->import_bib_object->writeSourcefileEntriesToDb();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilBibliographicDataSet::importRecord (   $a_entity,
  $a_types,
  $a_rec,
  $a_mapping,
  $a_schema_version 
)
Parameters
string$a_entity
$a_types
array$a_rec
ilImportMapping$a_mapping
string$a_schema_version

Definition at line 79 of file class.ilBibliographicDataSet.php.

References $ilDB, and importLibraryFile().

{
global $ilDB;
switch ($a_entity) {
case 'bibl':
$new_obj = new ilObjBibliographic();
$new_obj->setTitle($a_rec['title']);
$new_obj->setDescription($a_rec['description']);
$new_obj->setFilename($a_rec['fileName']);
$new_obj->setOnline(false);
$new_obj->create();
$this->import_bib_object = $new_obj;
$a_mapping->addMapping('Modules/Bibliographic', 'bibl', $a_rec['id'], $new_obj->getId());
$this->importLibraryFile($a_mapping);
break;
}
}

+ Here is the call graph for this function:

ilBibliographicDataSet::readData (   $a_entity,
  $a_version,
  $a_ids 
)

Read data from Cache for a given entity and ID(s)

Parameters
string$a_entity
string$a_version
array$a_idsone or multiple ids

Reimplemented from ilDataSet.

Definition at line 143 of file class.ilBibliographicDataSet.php.

References _readData().

{
$this->data = array();
if (! is_array($a_ids)) {
$a_ids = array( $a_ids );
}
$this->_readData($a_entity, $a_ids);
}

+ Here is the call graph for this function:

Field Documentation

ilBibliographicDataSet::$data = array()
protected

Definition at line 20 of file class.ilBibliographicDataSet.php.

Referenced by _readData().

ilBibliographicDataSet::$db
protected

Definition at line 16 of file class.ilBibliographicDataSet.php.

ilBibliographicDataSet::$import_bib_object
protected

Definition at line 30 of file class.ilBibliographicDataSet.php.

ilBibliographicDataSet::$import_temp_refs = array()
protected

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

ilBibliographicDataSet::$import_temp_refs_props = array()
protected

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

ilBibliographicDataSet::$record_field_ids_2_storage = array()
protected

Definition at line 26 of file class.ilBibliographicDataSet.php.

ilBibliographicDataSet::$user
protected

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


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