     else
       top = @objectsAsArray().filter (o) ->
         o? and o.parent_id == null
-    top.map (o) ->
-      id: o.id
-      name: o.name
-      children: children o
+    top.map show
 
   location_tree: (root_id) ->
+    aliases = @globalAliases()
+
     contents = (o) =>
-      o.contents().map (p) ->
-        id: p.id
-        name: p.name
-        contents: contents p
+      o.contents().map show
+
+    show = (o) ->
+      x =
+        id: o.id
+        name: o.name
+      if aliases[o.id]?
+        x.alias = aliases[o.id]
+      x.contents = contents o
+      x
 
     if root_id?
       root = @findById root_id

      !!object.name.match regex

  inheritance_tree: (root_id) ->
    children = (o) =>
      child_os = @objectsAsArray().filter (other_o) ->
        other_o.parent_id == o.id
      child_os.map (child_o) ->
        id: child_o.id
        name: child_o.name
        children: children child_o

    if root_id?
      root = @findById root_id

    for id,object of @objects
      object

  globalAliases: ->
    @sys.properties.filter((prop) -> prop.mooObject).reduce(((map, prop) ->
      map[prop.value] = '$' + prop.key
      map
    ), {})

  list: ->
    aliases = @globalAliases()
    for id,object of @objects
      x =
        id: object.id
        name: object.name
      if aliases[id]?
        x.alias = aliases[id]
      x

  search: (search) ->
    regex = new RegExp "#{search}", 'i'
