Global.getPoolObj (objName, pool)
function checks if the name of the requested object has a slash in it if true, it tries to fetch the appropriate parent-object (either site or root) and to fetch the object with the requested name in the specified collection

  • Parameter String:
    Name of the object to retrieve
  • Parameter String:
    Name of the pool to search in
  • Returns
    Obj Object with two properties: one containing the parent-object of the pool, the other containing the object itself; If parent or object is null, the function returns null.
Sourcecode in Global/objectFunctions.js:
1:   function getPoolObj(objName, pool) {
2:      var p = new Object();
3:      if (objName.contains("/")) {
4:         var objPath = objName.split("/");
5:         p.parent = root.get(objPath[0]);
6:         p.objName = objPath[1];
7:      } else {
8:         p.parent = res.handlers.site;
9:         p.objName = objName;
10:     }
11:     if (!p.parent)
12:        return null;
13:     p.obj = p.parent[pool].get(p.objName);
14:     if (!p.obj)
15:        return null;
16:     return p;
17:  }