app/presenters/tree_builder.rb
# Return a tree node for the passed in object
Return a tree node for the passed in object
Return a tree node for the passed in object
def x_build_node(object, pid, options)    
    parents = pid.to_s.split('_')
    options[:is_current] =
        ((object.kind_of?(MiqServer) && MiqServer.my_server(true).id == object.id) ||
         (object.kind_of?(Zone) && MiqServer.my_server(true).my_zone == object.name))
    node = x_build_single_node(object, pid, options)
    if [:policy_profile_tree, :policy_tree].include?(options[:tree])
      open_node(node[:key])
    end
    if Array(@tree_state.x_tree(@name)[:open_nodes]).include?(node[:key]) ||
       options[:open_all] ||
       object[:load_children] ||
       node[:expand]
      node[:expand] = true if options[:type] == :automate &&
                              Array(@tree_state.x_tree(@name)[:open_nodes]).include?(node[:key])
      kids = x_get_tree_objects(object, options, false, parents).map do |o|
        x_build_node(o, node[:key], options)
      end
      node[:children] = kids unless kids.empty?
    else
      if x_get_tree_objects(object, options, true, parents) > 0
        node[:isLazy] = true  
      end
    end
    node
  end
def x_build_node ( object , pid , options ) parents = pid . to_s . split ( '_' ) options [ :is_current ] = ( ( object . kind_of? ( MiqServer ) && MiqServer . my_server ( true ) . id == object . id ) || ( object . kind_of? ( Zone ) && MiqServer . my_server ( true ) . my_zone == object . name ) ) node = x_build_single_node ( object , pid , options ) if [ :policy_profile_tree , :policy_tree ] . include? ( options [ :tree ] ) open_node ( node [ :key ] ) end if Array ( @tree_state . x_tree ( @name ) [ :open_nodes ] ) . include? ( node [ :key ] ) || options [ :open_all ] || object [ :load_children ] || node [ :expand ] node [ :expand ] = true if options [ :type ] == :automate && Array ( @tree_state . x_tree ( @name ) [ :open_nodes ] ) . include? ( node [ :key ] ) kids = x_get_tree_objects ( object , options , false , parents ) . map do | o | x_build_node ( o , node [ :key ] , options ) end node [ :children ] = kids unless kids . empty? else if x_get_tree_objects ( object , options , true , parents ) > 0 node [ :isLazy ] = true end end node end
Return a tree node for the passed in object
Return a tree node for the passed in object
# Called with object, tree node parent id, tree options # Process the node's children # set child flag if children exist
object
<not_specific>
pid
<not_specific>
options
<not_specific>