39 $this->notes_manager =
$DIC->notes()->internal()->domain()->notes();
40 $this->notes_data =
$DIC->notes()->internal()->data();
45 return array(
"4.3.0",
"10.0");
48 protected function getXmlNamespace(
string $a_entity,
string $a_schema_version): string
50 return "https://www.ilias.de/xml/Services/Notes/" . $a_entity;
58 if ($a_entity ===
"user_notes") {
64 "RepObjId" =>
"integer",
68 "Author" =>
"integer",
69 "CreationDate" =>
"timestamp",
73 "NoRepository" =>
"integer"
77 if ($a_entity ===
"comments_settings") {
97 if ($a_entity ===
"user_notes") {
101 $this->getDirectDataFromQuery(
"SELECT id, rep_obj_id, obj_id, obj_type, type, " .
102 " author, note_text, creation_date, label, subject, no_repository " .
105 $ilDB->in(
"author", $a_ids,
false,
"integer") .
106 " AND obj_type = " .
$ilDB->quote(
"pd",
"text"));
110 if ($a_entity ===
"comments_settings") {
111 switch ($a_version) {
113 foreach($a_ids as
$id) {
116 "Active" => (
int) $this->notes_manager->commentsActive((
int)
$id)
129 string $a_schema_version
131 $a_rec = $this->stripTags($a_rec);
134 $usr_id = $a_mapping->
getMapping(
"components/ILIAS/User",
"usr", $a_rec[
"Author"]);
138 if ((
int) $a_rec[
"RepObjId"] === 0 &&
139 $a_rec[
"ObjId"] == $a_rec[
"Author"] &&
140 $a_rec[
"Type"] == Note::PRIVATE &&
141 $a_rec[
"ObjType"] ===
"pd") {
142 $context = $this->notes_data->context(
148 $note = $this->notes_data->note(
154 $a_rec[
"CreationDate"]
156 $this->notes_manager->createNote(
164 case "comments_settings":
165 $obj_id = (
int) $a_mapping->
getMapping(
"components/ILIAS/ILIASObject",
"obj", $a_rec[
"Id"]);
166 if ($obj_id > 0 && ((
bool) ($a_rec[
"Active"] ??
false) ===
true)) {
167 $this->notes_manager->activateComments($obj_id,
true);
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
A dataset contains in data in a common structure that can be shared and transformed for different pur...
getMapping(string $a_comp, string $a_entity, string $a_old_id)
readData(string $a_entity, string $a_version, array $a_ids)
Read data from DB.
getTypes(string $a_entity, string $a_version)
Get (abstract) types for (abstract) field names.
importRecord(string $a_entity, array $a_types, array $a_rec, ilImportMapping $a_mapping, string $a_schema_version)
Needs to be overwritten for import use case.
ILIAS Notes InternalDataService $notes_data
ILIAS Notes NotesManager $notes_manager
getXmlNamespace(string $a_entity, string $a_schema_version)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
if(!file_exists('../ilias.ini.php'))