From 38a6e83a1d9028bcf171d12674c202a0e99bd3ba Mon Sep 17 00:00:00 2001
From: Johannes Hoermann <j.hoermann@adito.de>
Date: Thu, 4 Apr 2019 15:42:30 +0200
Subject: [PATCH] refactor tree

---
 .../recordcontainers/jdito/contentProcess.js    | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/entity/ObjectTree_entity/recordcontainers/jdito/contentProcess.js b/entity/ObjectTree_entity/recordcontainers/jdito/contentProcess.js
index c290fd12d8..c4a65d74fb 100644
--- a/entity/ObjectTree_entity/recordcontainers/jdito/contentProcess.js
+++ b/entity/ObjectTree_entity/recordcontainers/jdito/contentProcess.js
@@ -19,7 +19,9 @@ if (filter)
     }
 }
 var originalObjectId = vars.get("$param.ObjectId_param");
+
 _loadObjectRelationTree(originalObjectId, vars.get("$param.ObjectType_param"), selectedRelationType);
+
 result.object(tree);
 
 function _loadObjectRelationTree(pObjectId, pObjectType, pObjectRelationTypeId, pNodeId, pLayer, pRelationTypeData)
@@ -86,7 +88,6 @@ function _loadObjectRelationTree(pObjectId, pObjectType, pObjectRelationTypeId,
             if (!pRelationTypeData)
                 pRelationTypeData = pNodeId[2];
             
-            var typeId = pRelationTypeData[0];
             var hierarchy = pRelationTypeData[4];
             var destObjectType = pRelationTypeData[6];
             var relationType1 = pRelationTypeData[7];
@@ -140,7 +141,7 @@ function _loadObjectRelationTree(pObjectId, pObjectType, pObjectRelationTypeId,
  * @param {String} pRelationType1
  * @param {String} pRelationType2
  * @param {String} pPrevId Id of the previous node to exclude it
- * @param {String} pNoRecursion if false: select for direction "same" the other direction, if result is empty.
+ * @param {Boolean} [pNoRecursion=false] if false: select for direction "same" the other direction, if result is empty.
  * 
  * @return {[][]}
  */
@@ -201,6 +202,18 @@ function _getRelationTypes(pObjectType)
     return ObjectRelationUtils.getPossibleRelationTypes(pObjectType, true);
 }
 
+/**
+ * insert a new Entry
+ * 
+ * @param {Array} pTree
+ * @param {Array[][]} pEntryData
+ * @param {Array[][]} pNodeId id of the parent
+ * @param {Integer} pLayer layernumber
+ * @param {String} pObjectType
+ * @param {Integer} [pNum=undefined] optional number added to the key. Needed, if the key would not be unique.
+ * 
+ * @return {Array[][]} the uids of the inserted data. Consists of [ObjectId, pEntryData-Index, ""(not needed anymore), pObjectType, pNodeId, objectrelationid, objecttype
+ */
 function _insertEntry(pTree, pEntryData, pNodeId, pLayer, pObjectType, pNum)
 {
     var expanded = true;
-- 
GitLab