ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilNotesDataSet Class Reference

Notes Data set class. More...

+ Inheritance diagram for ilNotesDataSet:
+ Collaboration diagram for ilNotesDataSet:

Public Member Functions

 getSupportedVersions ()
 Get supported versions.
 getXmlNamespace ($a_entity, $a_schema_version)
 Get xml namespace.
 readData ($a_entity, $a_version, $a_ids, $a_field="")
 Read data.
 importRecord ($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
 Import record.
- Public Member Functions inherited from ilDataSet
 __construct ()
 Constructor.
 init ($a_entity, $a_schema_version)
 Init.
 readData ($a_entity, $a_version, $a_ids)
 Read data from DB.
 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)
 Get field types for entity.
 getDependencies ($a_entity, $a_version, $a_rec, $a_ids)
 Determine the dependent sets of data.
- 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.

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

Notes Data set class.

Entities

  • user_notes: All personal notes of a user (do not use this for object related queries. Add a new entity for this purpose.
Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 15 of file class.ilNotesDataSet.php.

Member Function Documentation

ilNotesDataSet::getDependencies (   $a_entity,
  $a_version,
  $a_rec,
  $a_ids 
)
protected

Determine the dependent sets of data.

Definition at line 106 of file class.ilNotesDataSet.php.

{
return false;
}
ilNotesDataSet::getSupportedVersions ( )

Get supported versions.

Parameters
@return

Reimplemented from ilDataSet.

Definition at line 23 of file class.ilNotesDataSet.php.

{
return array("4.3.0");
}
ilNotesDataSet::getTypes (   $a_entity,
  $a_version 
)
protected

Get field types for entity.

Parameters
@return

Reimplemented from ilDataSet.

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

{
// user notes
if ($a_entity == "user_notes")
{
switch ($a_version)
{
case "4.3.0":
return array(
"Id" => "integer",
"RepObjId" => "integer",
"ObjId" => "integer",
"ObjType" => "text",
"ObjType" => "text",
"Type" => "integer",
"Author" => "integer",
"CreationDate" => "timestamp",
"NoteText" => "text",
"Label" => "integer",
"Subject" => "text",
"NoRepository" => "integer"
);
}
}
}
ilNotesDataSet::getXmlNamespace (   $a_entity,
  $a_schema_version 
)

Get xml namespace.

Parameters
@return

Reimplemented from ilDataSet.

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

{
return "http://www.ilias.de/xml/Services/Notes/".$a_entity;
}
ilNotesDataSet::importRecord (   $a_entity,
  $a_types,
  $a_rec,
  $a_mapping,
  $a_schema_version 
)

Import record.

Parameters
@return

Definition at line 122 of file class.ilNotesDataSet.php.

References $usr_id, and IL_NOTE_PRIVATE.

{
switch ($a_entity)
{
case "user_notes":
$usr_id = $a_mapping->getMapping("Services/User", "usr", $a_rec["Author"]);
if ($usr_id > 0)
{
include_once("./Services/Notes/classes/class.ilNote.php");
// only import real user (assigned to personal desktop) notes
// here.
if ((int) $a_rec["RepObjId"] == 0 &&
$a_rec["ObjId"] == $a_rec["Author"] &&
$a_rec["Type"] == IL_NOTE_PRIVATE &&
$a_rec["ObjType"] == "pd")
{
$note = new ilNote();
$note->setObject("pd", 0, $usr_id);
$note->setType(IL_NOTE_PRIVATE);
$note->setAuthor($usr_id);
$note->setText($a_rec["NoteText"]);
$note->setSubject($a_rec["Subject"]);
$note->setCreationDate($a_rec["CreationDate"]);
$note->setLabel($a_rec["Label"]);
$note->create(true);
}
}
break;
}
}
ilNotesDataSet::readData (   $a_entity,
  $a_version,
  $a_ids,
  $a_field = "" 
)

Read data.

Parameters
@return

Definition at line 77 of file class.ilNotesDataSet.php.

References ilDataSet\getDirectDataFromQuery().

{
global $ilDB;
if (!is_array($a_ids))
{
$a_ids = array($a_ids);
}
// user notes
if ($a_entity == "user_notes")
{
switch ($a_version)
{
case "4.3.0":
$this->getDirectDataFromQuery("SELECT id, rep_obj_id, obj_id, obj_type, type, ".
" author, note_text, creation_date, label, subject, no_repository ".
" FROM note ".
" WHERE ".
$ilDB->in("author", $a_ids, false, "integer").
" AND obj_type = ".$ilDB->quote("pd" ,"text"));
break;
}
}
}

+ Here is the call graph for this function:


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