ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilNotesDataSet Class Reference

Notes Data set class. More...

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

Public Member Functions

 getSupportedVersions ()
 Get supported versions. More...
 
 getXmlNamespace ($a_entity, $a_schema_version)
 Get xml namespace. More...
 
 readData ($a_entity, $a_version, $a_ids, $a_field="")
 Read data. More...
 
 importRecord ($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
 Import record. More...
 
- Public Member Functions inherited from ilDataSet
 __construct ()
 Constructor. More...
 
 init ($a_entity, $a_schema_version)
 Init. More...
 
 getSupportedVersions ()
 Get supported version. More...
 
 readData ($a_entity, $a_version, $a_ids)
 Read data from DB. More...
 
 setExportDirectories ($a_relative, $a_absolute)
 Set export directories. More...
 
 setImportDirectory ($a_val)
 Set import directory. More...
 
 getImportDirectory ()
 Get import directory. More...
 
 setDSPrefix ($a_val)
 Set XML dataset namespace prefix. More...
 
 getDSPrefix ()
 Get XML dataset namespace prefix. More...
 
 getDSPrefixString ()
 
 getDirectDataFromQuery ($a_query, $a_convert_to_leading_upper=true, $a_set=true)
 Get data from query.This is a standard procedure, all db field names are directly mapped to abstract fields. More...
 
 convertToLeadingUpper ($a_str)
 Make xyz_abc a XyzAbc string. More...
 
 getJsonRepresentation ()
 Get json representation. More...
 
 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 ...> ... More...
 
 addRecordsXml ($a_writer, $a_prefixes, $a_entity, $a_schema_version, $a_ids, $a_field="")
 Add records xml. More...
 
 afterXmlRecordWriting ($a_entity, $a_version, $a_set)
 After xml record writing hook record. More...
 
 getNamespaces (&$namespaces, $a_entity, $a_schema_version)
 Get xml namespaces. More...
 
 getXmlRecord ($a_entity, $a_version, $a_set)
 Get xml record for version. More...
 
 getJsonRecord ($a_set)
 Get json record for version. More...
 
 getXmlTypes ($a_entity, $a_version)
 Get xml types. More...
 
 getJsonTypes ($a_entity, $a_version)
 Get json types. More...
 
 getXMLEntityName ($a_entity, $a_version)
 Get entity name for xml (may be overwritten) More...
 
 getXMLEntityTag ($a_entity, $a_schema_version)
 Get entity tag. More...
 
 getJsonEntityName ($a_entity, $a_version)
 Get entity name for json (may be overwritten) More...
 
 setImport ($a_val)
 Set import object. More...
 
 getImport ()
 Get import object. More...
 
 setCurrentInstallationId ($a_val)
 Set current installation id. More...
 
 getCurrentInstallationId ()
 Get current installation id. More...
 

Protected Member Functions

 getTypes ($a_entity, $a_version)
 Get field types for entity. More...
 
 getDependencies ($a_entity, $a_version, $a_rec, $a_ids)
 Determine the dependent sets of data. More...
 
- Protected Member Functions inherited from ilDataSet
 getTypes ($a_entity, $a_version)
 Get (abstract) types for (abstract) field names. More...
 
 getXmlNamespace ($a_entity, $a_schema_version)
 Get xml namespace. More...
 
 createObjectExportId ($a_type, $a_id)
 Build ilias export id. More...
 
 parseObjectExportId ($a_id, $a_fallback_id=NULL)
 Parse export id. More...
 

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
 
- Protected Attributes inherited from ilDataSet
 $current_installation_id = ""
 

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

◆ getDependencies()

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.

107  {
108  return false;
109  }

◆ getSupportedVersions()

ilNotesDataSet::getSupportedVersions ( )

Get supported versions.

Parameters

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

References array.

24  {
25  return array("4.3.0");
26  }
Create styles array
The data for the language used.

◆ getTypes()

ilNotesDataSet::getTypes (   $a_entity,
  $a_version 
)
protected

Get field types for entity.

Parameters

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

References array.

46  {
47  // user notes
48  if ($a_entity == "user_notes")
49  {
50  switch ($a_version)
51  {
52  case "4.3.0":
53  return array(
54  "Id" => "integer",
55  "RepObjId" => "integer",
56  "ObjId" => "integer",
57  "ObjType" => "text",
58  "ObjType" => "text",
59  "Type" => "integer",
60  "Author" => "integer",
61  "CreationDate" => "timestamp",
62  "NoteText" => "text",
63  "Label" => "integer",
64  "Subject" => "text",
65  "NoRepository" => "integer"
66  );
67  }
68  }
69  }
Create styles array
The data for the language used.

◆ getXmlNamespace()

ilNotesDataSet::getXmlNamespace (   $a_entity,
  $a_schema_version 
)

Get xml namespace.

Parameters

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

35  {
36  return "http://www.ilias.de/xml/Services/Notes/".$a_entity;
37  }

◆ importRecord()

ilNotesDataSet::importRecord (   $a_entity,
  $a_types,
  $a_rec,
  $a_mapping,
  $a_schema_version 
)

Import record.

Parameters

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

References IL_NOTE_PRIVATE.

123  {
124  switch ($a_entity)
125  {
126  case "user_notes":
127  $usr_id = $a_mapping->getMapping("Services/User", "usr", $a_rec["Author"]);
128  if ($usr_id > 0)
129  {
130  include_once("./Services/Notes/classes/class.ilNote.php");
131 
132  // only import real user (assigned to personal desktop) notes
133  // here.
134  if ((int) $a_rec["RepObjId"] == 0 &&
135  $a_rec["ObjId"] == $a_rec["Author"] &&
136  $a_rec["Type"] == IL_NOTE_PRIVATE &&
137  $a_rec["ObjType"] == "pd")
138  {
139  $note = new ilNote();
140  $note->setObject("pd", 0, $usr_id);
141  $note->setType(IL_NOTE_PRIVATE);
142  $note->setAuthor($usr_id);
143  $note->setText($a_rec["NoteText"]);
144  $note->setSubject($a_rec["Subject"]);
145  $note->setCreationDate($a_rec["CreationDate"]);
146  $note->setLabel($a_rec["Label"]);
147  $note->create(true);
148  }
149  }
150  break;
151  }
152  }
const IL_NOTE_PRIVATE
Definition: class.ilNote.php:4
Note class.

◆ readData()

ilNotesDataSet::readData (   $a_entity,
  $a_version,
  $a_ids,
  $a_field = "" 
)

Read data.

Parameters

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

References $ilDB, array, and ilDataSet\getDirectDataFromQuery().

78  {
79  global $ilDB;
80 
81  if (!is_array($a_ids))
82  {
83  $a_ids = array($a_ids);
84  }
85 
86  // user notes
87  if ($a_entity == "user_notes")
88  {
89  switch ($a_version)
90  {
91  case "4.3.0":
92  $this->getDirectDataFromQuery("SELECT id, rep_obj_id, obj_id, obj_type, type, ".
93  " author, note_text, creation_date, label, subject, no_repository ".
94  " FROM note ".
95  " WHERE ".
96  $ilDB->in("author", $a_ids, false, "integer").
97  " AND obj_type = ".$ilDB->quote("pd" ,"text"));
98  break;
99  }
100  }
101  }
getDirectDataFromQuery($a_query, $a_convert_to_leading_upper=true, $a_set=true)
Get data from query.This is a standard procedure, all db field names are directly mapped to abstract ...
Create styles array
The data for the language used.
global $ilDB
+ Here is the call graph for this function:

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