+ dn = "[#{attr}]"
+ subattr.each do |a|
+ dn += "[#{a}]"
+ end
+ if value_info.is_a? Hash
+ dn += '[value]'
+ end
+
+ selectables = []
+ attrtext = attrvalue
+ if dataclass and dataclass.is_a? Class
+ if attrvalue and !attrvalue.empty?
+ Link.where(head_uuid: attrvalue, link_class: ["tag", "identifier"]).each do |tag|
+ attrtext += " [#{tag.name}]"
+ end
+ selectables.append({name: attrtext, uuid: attrvalue, type: dataclass.to_s})
+ end
+ #dataclass.where(uuid: attrvalue).each do |item|
+ # selectables.append({name: item.uuid, uuid: item.uuid, type: dataclass.to_s})
+ #end
+ itemuuids = []
+ dataclass.limit(10).each do |item|
+ itemuuids << item.uuid
+ selectables.append({name: item.uuid, uuid: item.uuid, type: dataclass.to_s})
+ end
+ Link.where(head_uuid: itemuuids, link_class: ["tag", "identifier"]).each do |tag|
+ selectables.each do |selectable|
+ if selectable['uuid'] == tag.head_uuid
+ selectable['name'] += ' [' + tag.name + ']'
+ end
+ end
+ end
+ end