4 include_once(
"./Services/DataSet/classes/class.ilDataSet.php");
29 return array(
"4.3.0");
40 return "http://www.ilias.de/xml/Services/Taxonomy/" . $a_entity;
49 protected function getTypes($a_entity, $a_version)
52 if ($a_entity ==
"tax") {
58 "Description" =>
"text",
59 "SortingMode" =>
"integer");
64 if ($a_entity ==
"tax_usage") {
75 if ($a_entity ==
"tax_tree") {
81 "Parent" =>
"integer",
85 "OrderNr" =>
"integer" 91 if ($a_entity ==
"tax_node_assignment") {
95 "NodeId" =>
"integer",
96 "Component" =>
"text",
110 public function readData($a_entity, $a_version, $a_ids, $a_field =
"")
114 if (!is_array($a_ids)) {
115 $a_ids =
array($a_ids);
119 if ($a_entity ==
"tax") {
120 switch ($a_version) {
124 " FROM tax_data JOIN object_data ON (tax_data.id = object_data.obj_id) " .
126 $ilDB->in(
"id", $a_ids,
false,
"integer"));
132 if ($a_entity ==
"tax_usage") {
133 switch ($a_version) {
138 $ilDB->in(
"tax_id", $a_ids,
false,
"integer"));
144 if ($a_entity ==
"tax_tree") {
145 switch ($a_version) {
148 " ,parent,depth,type,title,order_nr " .
149 " FROM tax_tree JOIN tax_node ON (child = obj_id) " .
151 $ilDB->in(
"tax_id", $a_ids,
false,
"integer") .
158 if ($a_entity ==
"tax_node_assignment") {
159 switch ($a_version) {
162 " FROM tax_node_assignment " .
164 $ilDB->in(
"node_id", $a_ids,
false,
"integer"));
178 "tax_tree" =>
array(
"ids" => $a_rec[
"Id"]),
179 "tax_usage" =>
array(
"ids" => $a_rec[
"Id"])
183 "tax_node_assignment" =>
array(
"ids" => $a_rec[
"Child"])
200 public function importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
207 include_once(
"./Services/Taxonomy/classes/class.ilObjTaxonomy.php");
219 $newObj->setTitle($a_rec[
"Title"]);
220 $newObj->setDescription($a_rec[
"Description"]);
221 $newObj->setSortingMode($a_rec[
"SortingMode"]);
224 $this->current_obj = $newObj;
225 $a_mapping->addMapping(
"Services/Taxonomy",
"tax", $a_rec[
"Id"], $newObj->getId());
229 switch ($a_rec[
"Type"]) {
231 $parent = (int) $a_mapping->getMapping(
"Services/Taxonomy",
"tax_tree", $a_rec[
"Parent"]);
232 $tax_id = $a_mapping->getMapping(
"Services/Taxonomy",
"tax", $a_rec[
"TaxId"]);
234 $parent = $this->current_obj->getTree()->readRootId();
237 $node->setTitle($a_rec[
"Title"]);
238 $node->setOrderNr($a_rec[
"OrderNr"]);
239 $node->setTaxonomyId($tax_id);
242 $a_mapping->addMapping(
253 case "tax_node_assignment":
254 $new_item_id = (int) $a_mapping->getMapping(
257 $a_rec[
"Component"] .
":" . $a_rec[
"ItemType"] .
":" . $a_rec[
"ItemId"]
259 $new_node_id = (int) $a_mapping->getMapping(
"Services/Taxonomy",
"tax_tree", $a_rec[
"NodeId"]);
263 $new_item_id_obj = (int) $a_mapping->getMapping(
266 $a_rec[
"Component"] .
":" . $a_rec[
"ItemType"] .
":" . $a_rec[
"ItemId"]
268 if ($new_item_id > 0 && $new_node_id > 0 && $new_item_id_obj > 0) {
269 include_once(
"./Services/Taxonomy/classes/class.ilTaxNodeAssignment.php");
270 $node_ass =
new ilTaxNodeAssignment($a_rec[
"Component"], $new_item_id_obj, $a_rec[
"ItemType"], $this->current_obj->getId());
276 $usage = $a_mapping->getMapping(
"Services/Taxonomy",
"tax_usage_of_obj", $a_rec[
"ObjId"]);
280 $a_mapping->addMapping(
284 $usage . $this->current_obj->getId()
addAssignment($a_node_id, $a_item_id, $a_order_nr=0)
Add assignment.
Taxonomy node <-> item assignment.
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 ...
readData($a_entity, $a_version, $a_ids, $a_field="")
Read data.
getDependencies($a_entity, $a_version, $a_rec, $a_ids)
Determine the dependent sets of data.
Create styles array
The data for the language used.
static putInTree( $a_tax_id, $a_node, $a_parent_id="", $a_target_node_id="", $a_order_nr=0)
Put this node into the taxonomy tree.
getSupportedVersions()
Get supported versions.
getXmlNamespace($a_entity, $a_schema_version)
Get xml namespace.
A dataset contains in data in a common structure that can be shared and transformed for different pur...
importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
Import record.
getTypes($a_entity, $a_version)
Get field types for entity.