1 class ApplicationController < ActionController::Base
2 include ArvadosApiClientHelper
3 include ApplicationHelper
5 respond_to :html, :json, :js
8 ERROR_ACTIONS = [:render_error, :render_not_found]
10 around_filter :thread_clear
11 around_filter :set_thread_api_token
12 # Methods that don't require login should
13 # skip_around_filter :require_thread_api_token
14 around_filter :require_thread_api_token, except: ERROR_ACTIONS
15 before_filter :set_cache_buster
16 before_filter :accept_uuid_as_id_param, except: ERROR_ACTIONS
17 before_filter :check_user_agreements, except: ERROR_ACTIONS
18 before_filter :check_user_profile, except: ERROR_ACTIONS
19 before_filter :check_user_notifications, except: ERROR_ACTIONS
20 before_filter :load_filters_and_paging_params, except: ERROR_ACTIONS
21 before_filter :find_object_by_uuid, except: [:create, :index, :choose] + ERROR_ACTIONS
25 rescue_from(ActiveRecord::RecordNotFound,
26 ActionController::RoutingError,
27 ActionController::UnknownController,
28 AbstractController::ActionNotFound,
29 with: :render_not_found)
30 rescue_from(Exception,
31 ActionController::UrlGenerationError,
32 with: :render_exception)
36 response.headers["Cache-Control"] = "no-cache, no-store, max-age=0, must-revalidate"
37 response.headers["Pragma"] = "no-cache"
38 response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT"
41 def unprocessable(message=nil)
44 @errors << message if message
45 render_error status: 422
48 def render_error(opts={})
51 # json must come before html here, so it gets used as the
52 # default format when js is requested by the client. This lets
53 # ajax:error callback parse the response correctly, even though
55 f.json { render opts.merge(json: {success: false, errors: @errors}) }
56 f.html { render({action: 'error'}.merge(opts)) }
60 def render_exception(e)
61 logger.error e.inspect
62 logger.error e.backtrace.collect { |x| x + "\n" }.join('') if e.backtrace
63 err_opts = {status: 422}
64 if e.is_a?(ArvadosApiClient::ApiError)
65 err_opts.merge!(action: 'api_error', locals: {api_error: e})
66 @errors = e.api_response[:errors]
67 elsif @object.andand.errors.andand.full_messages.andand.any?
68 @errors = @object.errors.full_messages
72 # Make user information available on the error page, falling back to the
73 # session cache if the API server is unavailable.
75 load_api_token(session[:arvados_api_token])
76 rescue ArvadosApiClient::ApiError
77 unless session[:user].nil?
79 Thread.current[:user] = User.new(session[:user])
80 rescue ArvadosApiClient::ApiError
81 # This can happen if User's columns are unavailable. Nothing to do.
85 # Preload projects trees for the template. If that's not doable, set empty
86 # trees so error page rendering can proceed. (It's easier to rescue the
87 # exception here than in a template.)
88 unless current_user.nil?
91 rescue ArvadosApiClient::ApiError
92 # Fall back to the default-setting code later.
95 @my_project_tree ||= []
96 @shared_project_tree ||= []
97 render_error(err_opts)
100 def render_not_found(e=ActionController::RoutingError.new("Path not found"))
101 logger.error e.inspect
102 @errors = ["Path not found"]
103 set_thread_api_token do
104 self.render_error(action: '404', status: 404)
110 # The order can be left empty to allow it to default.
111 # Or it can be a comma separated list of real database column names, one per model.
112 # Column names should always be qualified by a table name and a direction is optional, defaulting to asc
113 # (e.g. "collections.name" or "collections.name desc").
114 # If a column name is specified, that table will be sorted by that column.
115 # If there are objects from different models that will be shown (such as in Jobs and Pipelines tab),
116 # then a sort column name can optionally be specified for each model, passed as an comma-separated list (e.g. "jobs.script, pipeline_instances.name")
117 # Currently only one sort column name and direction can be specified for each model.
118 def load_filters_and_paging_params
119 if params[:order].blank?
120 @order = 'created_at desc'
121 elsif params[:order].is_a? Array
122 @order = params[:order]
125 @order = JSON.load(params[:order])
127 @order = params[:order].split(',')
130 @order = [@order] unless @order.is_a? Array
134 @limit = params[:limit].to_i
139 @offset = params[:offset].to_i
144 filters = params[:filters]
145 if filters.is_a? String
146 filters = Oj.load filters
147 elsif filters.is_a? Array
148 filters = filters.collect do |filter|
149 if filter.is_a? String
150 # Accept filters[]=["foo","=","bar"]
153 # Accept filters=[["foo","=","bar"]]
158 # After this, params[:filters] can be trusted to be an array of arrays:
159 params[:filters] = filters
164 def find_objects_for_index
165 @objects ||= model_class
166 @objects = @objects.filter(@filters).limit(@limit).offset(@offset)
167 @objects.fetch_multiple_pages(false)
174 @next_page_href = next_page_href(partial: params[:partial], filters: @filters.to_json)
176 content: render_to_string(partial: "show_#{params[:partial]}",
178 next_page_href: @next_page_href
181 render json: @objects
186 render_pane params[:tab_pane]
195 helper_method :render_pane
196 def render_pane tab_pane, opts={}
198 partial: 'show_' + tab_pane.downcase,
200 comparable: self.respond_to?(:compare),
203 }.merge(opts[:locals] || {})
206 render_to_string render_opts
213 find_objects_for_index if !@objects
217 helper_method :next_page_offset
218 def next_page_offset objects=nil
222 if objects.respond_to?(:result_offset) and
223 objects.respond_to?(:result_limit) and
224 objects.respond_to?(:items_available)
225 next_offset = objects.result_offset + objects.result_limit
226 if next_offset < objects.items_available
234 helper_method :next_page_href
235 def next_page_href with_params={}
237 url_for with_params.merge(offset: next_page_offset)
243 return render_not_found("object not found")
247 extra_attrs = { href: url_for(action: :show, id: @object) }
248 @object.textile_attributes.each do |textile_attr|
249 extra_attrs.merge!({ "#{textile_attr}Textile" => view_context.render_markup(@object.attributes[textile_attr]) })
251 render json: @object.attributes.merge(extra_attrs)
254 if params['tab_pane']
255 render_pane(if params['tab_pane'].is_a? Hash then params['tab_pane']["name"] else params['tab_pane'] end)
256 elsif request.method.in? ['GET', 'HEAD']
259 redirect_to (params[:return_to] ||
260 polymorphic_url(@object,
261 anchor: params[:redirect_to_anchor]))
269 params[:limit] ||= 40
273 find_objects_for_index if !@objects
275 content: render_to_string(partial: "choose_rows.html",
277 next_page_href: next_page_href(partial: params[:partial])
282 find_objects_for_index if !@objects
283 render partial: 'choose', locals: {multiple: params[:multiple]}
290 return render_not_found("object not found")
295 @object = model_class.new
299 @updates ||= params[@object.resource_param_name.to_sym]
300 @updates.keys.each do |attr|
301 if @object.send(attr).is_a? Hash
302 if @updates[attr].is_a? String
303 @updates[attr] = Oj.load @updates[attr]
305 if params[:merge] || params["merge_#{attr}".to_sym]
306 # Merge provided Hash with current Hash, instead of
308 @updates[attr] = @object.send(attr).with_indifferent_access.
309 deep_merge(@updates[attr].with_indifferent_access)
313 if @object.update_attributes @updates
316 self.render_error status: 422
321 @new_resource_attrs ||= params[model_class.to_s.underscore.singularize]
322 @new_resource_attrs ||= {}
323 @new_resource_attrs.reject! { |k,v| k.to_s == 'uuid' }
324 @object ||= model_class.new @new_resource_attrs, params["options"]
328 render_error status: 422
332 # Clone the given object, merging any attribute values supplied as
333 # with a create action.
335 @new_resource_attrs ||= params[model_class.to_s.underscore.singularize]
336 @new_resource_attrs ||= {}
337 @object = @object.dup
338 @object.update_attributes @new_resource_attrs
339 if not @new_resource_attrs[:name] and @object.respond_to? :name
340 if @object.name and @object.name != ''
341 @object.name = "Copy of #{@object.name}"
353 f.json { render json: @object }
355 redirect_to(params[:return_to] || :back)
360 self.render_error status: 422
365 Thread.current[:user]
369 controller_name.classify.constantize
372 def breadcrumb_page_name
373 (@breadcrumb_page_name ||
374 (@object.friendly_link_name if @object.respond_to? :friendly_link_name) ||
383 %w(Attributes Advanced)
388 def strip_token_from_path(path)
389 path.sub(/([\?&;])api_token=[^&;]*[&;]?/, '\1')
392 def redirect_to_login
395 if request.method.in? ['GET', 'HEAD']
396 redirect_to arvados_api_client.arvados_login_url(return_to: strip_token_from_path(request.url))
398 flash[:error] = "Either you are not logged in, or your session has timed out. I can't automatically log you in and re-attempt this request."
403 @errors = ['You do not seem to be logged in. You did not supply an API token with this request, and your session (if any) has timed out.']
404 self.render_error status: 422
407 false # For convenience to return from callbacks
410 def using_specific_api_token(api_token, opts={})
412 [:arvados_api_token, :user].each do |key|
413 start_values[key] = Thread.current[key]
415 if opts.fetch(:load_user, true)
416 load_api_token(api_token)
418 Thread.current[:arvados_api_token] = api_token
419 Thread.current[:user] = nil
424 start_values.each_key { |key| Thread.current[key] = start_values[key] }
429 def accept_uuid_as_id_param
430 if params[:id] and params[:id].match /\D/
431 params[:uuid] = params.delete :id
435 def find_object_by_uuid
439 elsif not params[:uuid].is_a?(String)
440 @object = model_class.where(uuid: params[:uuid]).first
441 elsif params[:uuid].empty?
443 elsif (model_class != Link and
444 resource_class_for_uuid(params[:uuid]) == Link)
445 @name_link = Link.find(params[:uuid])
446 @object = model_class.find(@name_link.head_uuid)
448 @object = model_class.find(params[:uuid])
450 rescue ArvadosApiClient::NotFoundException, RuntimeError => error
451 if error.is_a?(RuntimeError) and (error.message !~ /^argument to find\(/)
454 render_not_found(error)
461 Rails.cache.delete_matched(/^request_#{Thread.current.object_id}_/)
463 Rails.cache.delete_matched(/^request_#{Thread.current.object_id}_/)
466 # Set up the thread with the given API token and associated user object.
467 def load_api_token(new_token)
468 Thread.current[:arvados_api_token] = new_token
470 Thread.current[:user] = nil
472 Thread.current[:user] = User.current
476 # If there's a valid api_token parameter, set up the session with that
477 # user's information. Return true if the method redirects the request
478 # (usually a post-login redirect); false otherwise.
479 def setup_user_session
480 return false unless params[:api_token]
481 Thread.current[:arvados_api_token] = params[:api_token]
484 rescue ArvadosApiClient::NotLoggedInException
485 false # We may redirect to login, or not, based on the current action.
487 session[:arvados_api_token] = params[:api_token]
488 # If we later have trouble contacting the API server, we still want
489 # to be able to render basic user information in the UI--see
490 # render_exception above. We store that in the session here. This is
491 # not intended to be used as a general-purpose cache. See #2891.
495 first_name: user.first_name,
496 last_name: user.last_name,
497 is_active: user.is_active,
498 is_admin: user.is_admin,
502 if !request.format.json? and request.method.in? ['GET', 'HEAD']
503 # Repeat this request with api_token in the (new) session
504 # cookie instead of the query string. This prevents API
505 # tokens from appearing in (and being inadvisedly copied
506 # and pasted from) browser Location bars.
507 redirect_to strip_token_from_path(request.fullpath)
513 Thread.current[:arvados_api_token] = nil
517 # Save the session API token in thread-local storage, and yield.
518 # This method also takes care of session setup if the request
519 # provides a valid api_token parameter.
520 # If a token is unavailable or expired, the block is still run, with
522 def set_thread_api_token
523 if Thread.current[:arvados_api_token]
524 yield # An API token has already been found - pass it through.
526 elsif setup_user_session
527 return # A new session was set up and received a response.
531 load_api_token(session[:arvados_api_token])
533 rescue ArvadosApiClient::NotLoggedInException
534 # If we got this error with a token, it must've expired.
535 # Retry the request without a token.
536 unless Thread.current[:arvados_api_token].nil?
541 # Remove token in case this Thread is used for anything else.
546 # Redirect to login/welcome if client provided expired API token (or none at all)
547 def require_thread_api_token
548 if Thread.current[:arvados_api_token]
550 elsif session[:arvados_api_token]
551 # Expired session. Clear it before refreshing login so that,
552 # if this login procedure fails, we end up showing the "please
553 # log in" page instead of getting stuck in a redirect loop.
554 session.delete :arvados_api_token
557 redirect_to welcome_users_path(return_to: request.fullpath)
561 def ensure_current_user_is_admin
562 unless current_user and current_user.is_admin
563 @errors = ['Permission denied']
564 self.render_error status: 401
568 helper_method :unsigned_user_agreements
569 def unsigned_user_agreements
570 @signed_ua_uuids ||= UserAgreement.signatures.map &:head_uuid
571 @unsigned_user_agreements ||= UserAgreement.all.map do |ua|
572 if not @signed_ua_uuids.index ua.uuid
573 Collection.find(ua.uuid)
578 def check_user_agreements
579 if current_user && !current_user.is_active
580 if not current_user.is_invited
581 return redirect_to inactive_users_path(return_to: request.fullpath)
583 if unsigned_user_agreements.empty?
584 # No agreements to sign. Perhaps we just need to ask?
585 current_user.activate
586 if !current_user.is_active
587 logger.warn "#{current_user.uuid.inspect}: " +
588 "No user agreements to sign, but activate failed!"
591 if !current_user.is_active
592 redirect_to user_agreements_path(return_to: request.fullpath)
598 def check_user_profile
599 if request.method.downcase != 'get' || params[:partial] ||
600 params[:tab_pane] || params[:action_method] ||
601 params[:action] == 'setup_popup'
605 if missing_required_profile?
606 redirect_to profile_user_path(current_user.uuid, return_to: request.fullpath)
611 helper_method :missing_required_profile?
612 def missing_required_profile?
613 missing_required = false
615 profile_config = Rails.configuration.user_profile_form_fields
616 if current_user && profile_config
617 current_user_profile = current_user.prefs[:profile]
618 profile_config.kind_of?(Array) && profile_config.andand.each do |entry|
620 if !current_user_profile ||
621 !current_user_profile[entry['key'].to_sym] ||
622 current_user_profile[entry['key'].to_sym].empty?
623 missing_required = true
634 return Rails.configuration.arvados_theme
637 @@notification_tests = []
639 @@notification_tests.push lambda { |controller, current_user|
640 AuthorizedKey.limit(1).where(authorized_user_uuid: current_user.uuid).each do
643 return lambda { |view|
644 view.render partial: 'notifications/ssh_key_notification'
648 @@notification_tests.push lambda { |controller, current_user|
649 Collection.limit(1).where(created_by: current_user.uuid).each do
652 return lambda { |view|
653 view.render partial: 'notifications/collections_notification'
657 @@notification_tests.push lambda { |controller, current_user|
658 PipelineInstance.limit(1).where(created_by: current_user.uuid).each do
661 return lambda { |view|
662 view.render partial: 'notifications/pipelines_notification'
666 def check_user_notifications
667 return if params['tab_pane']
669 @notification_count = 0
672 if current_user.andand.is_active
673 @showallalerts = false
674 @@notification_tests.each do |t|
675 a = t.call(self, current_user)
677 @notification_count += 1
678 @notifications.push a
683 if @notification_count == 0
684 @notification_count = ''
688 helper_method :all_projects
690 @all_projects ||= Group.
691 filter([['group_class','=','project']]).order('name')
694 helper_method :my_projects
696 return @my_projects if @my_projects
699 all_projects.each do |g|
700 root_of[g.uuid] = g.owner_uuid
706 root_of = root_of.each_with_object({}) do |(child, parent), h|
708 h[child] = root_of[parent]
715 @my_projects = @my_projects.select do |g|
716 root_of[g.uuid] == current_user.uuid
720 helper_method :projects_shared_with_me
721 def projects_shared_with_me
722 my_project_uuids = my_projects.collect &:uuid
723 all_projects.reject { |x| x.uuid.in? my_project_uuids }
726 helper_method :recent_jobs_and_pipelines
727 def recent_jobs_and_pipelines
729 PipelineInstance.limit(10)).
731 (x.finished_at || x.started_at rescue nil) || x.modified_at || x.created_at
735 helper_method :running_pipelines
736 def running_pipelines
737 pi = PipelineInstance.order(["started_at asc", "created_at asc"]).filter([["state", "in", ["RunningOnServer", "RunningOnClient"]]])
740 pl.components.each do |k,v|
741 if v.is_a? Hash and v[:job]
742 jobs[v[:job][:uuid]] = {}
748 Job.filter([["uuid", "in", jobs.keys]]).each do |j|
753 pl.components.each do |k,v|
754 if v.is_a? Hash and v[:job]
755 v[:job] = jobs[v[:job][:uuid]]
764 helper_method :finished_pipelines
765 def finished_pipelines lim
766 PipelineInstance.limit(lim).order(["finished_at desc"]).filter([["state", "in", ["Complete", "Failed", "Paused"]], ["finished_at", "!=", nil]])
769 helper_method :recent_collections
770 def recent_collections lim
771 c = Collection.limit(lim).order(["modified_at desc"]).filter([["owner_uuid", "is_a", "arvados#group"]])
773 Group.filter([["uuid", "in", c.map(&:owner_uuid)]]).each do |g|
776 {collections: c, owners: own}
779 helper_method :my_project_tree
785 helper_method :shared_project_tree
786 def shared_project_tree
791 def build_project_trees
792 return if @my_project_tree and @shared_project_tree
793 parent_of = {current_user.uuid => 'me'}
794 all_projects.each do |ob|
795 parent_of[ob.uuid] = ob.owner_uuid
797 children_of = {false => [], 'me' => [current_user]}
798 all_projects.each do |ob|
799 if ob.owner_uuid != current_user.uuid and
800 not parent_of.has_key? ob.owner_uuid
801 parent_of[ob.uuid] = false
803 children_of[parent_of[ob.uuid]] ||= []
804 children_of[parent_of[ob.uuid]] << ob
806 buildtree = lambda do |children_of, root_uuid=false|
808 children_of[root_uuid].andand.each do |ob|
809 tree[ob] = buildtree.call(children_of, ob.uuid)
813 sorted_paths = lambda do |tree, depth=0|
815 tree.keys.sort_by { |ob|
816 ob.is_a?(String) ? ob : ob.friendly_link_name
818 paths << {object: ob, depth: depth}
819 paths += sorted_paths.call tree[ob], depth+1
824 sorted_paths.call buildtree.call(children_of, 'me')
825 @shared_project_tree =
826 sorted_paths.call({'Projects shared with me' =>
827 buildtree.call(children_of, false)})
830 helper_method :get_object
832 if @get_object.nil? and @objects
833 @get_object = @objects.each_with_object({}) do |object, h|
834 h[object.uuid] = object
841 helper_method :project_breadcrumbs
842 def project_breadcrumbs
844 current = @name_link || @object
846 # Halt if a group ownership loop is detected. API should refuse
847 # to produce this state, but it could still arise from a race
848 # condition when group ownership changes between our find()
850 break if crumbs.collect(&:uuid).include? current.uuid
852 if current.is_a?(Group) and current.group_class == 'project'
853 crumbs.prepend current
855 if current.is_a? Link
856 current = Group.find?(current.tail_uuid)
858 current = Group.find?(current.owner_uuid)
864 helper_method :current_project_uuid
865 def current_project_uuid
866 if @object.is_a? Group and @object.group_class == 'project'
868 elsif @name_link.andand.tail_uuid
870 elsif @object and resource_class_for_uuid(@object.owner_uuid) == Group
877 # helper method to get links for given object or uuid
878 helper_method :links_for_object
879 def links_for_object object_or_uuid
880 raise ArgumentError, 'No input argument' unless object_or_uuid
881 preload_links_for_objects([object_or_uuid])
882 uuid = object_or_uuid.is_a?(String) ? object_or_uuid : object_or_uuid.uuid
883 @all_links_for[uuid] ||= []
886 # helper method to preload links for given objects and uuids
887 helper_method :preload_links_for_objects
888 def preload_links_for_objects objects_and_uuids
889 @all_links_for ||= {}
891 raise ArgumentError, 'Argument is not an array' unless objects_and_uuids.is_a? Array
892 return @all_links_for if objects_and_uuids.empty?
894 uuids = objects_and_uuids.collect { |x| x.is_a?(String) ? x : x.uuid }
896 # if already preloaded for all of these uuids, return
897 if not uuids.select { |x| @all_links_for[x].nil? }.any?
898 return @all_links_for
902 @all_links_for[x] = []
905 # TODO: make sure we get every page of results from API server
906 Link.filter([['head_uuid', 'in', uuids]]).each do |link|
907 @all_links_for[link.head_uuid] << link
912 # helper method to get a certain number of objects of a specific type
913 # this can be used to replace any uses of: "dataclass.limit(n)"
914 helper_method :get_n_objects_of_class
915 def get_n_objects_of_class dataclass, size
916 @objects_map_for ||= {}
918 raise ArgumentError, 'Argument is not a data class' unless dataclass.is_a? Class and dataclass < ArvadosBase
919 raise ArgumentError, 'Argument is not a valid limit size' unless (size && size>0)
921 # if the objects_map_for has a value for this dataclass, and the
922 # size used to retrieve those objects is equal, return it
923 size_key = "#{dataclass.name}_size"
924 if @objects_map_for[dataclass.name] && @objects_map_for[size_key] &&
925 (@objects_map_for[size_key] == size)
926 return @objects_map_for[dataclass.name]
929 @objects_map_for[size_key] = size
930 @objects_map_for[dataclass.name] = dataclass.limit(size)
933 # helper method to get collections for the given uuid
934 helper_method :collections_for_object
935 def collections_for_object uuid
936 raise ArgumentError, 'No input argument' unless uuid
937 preload_collections_for_objects([uuid])
938 @all_collections_for[uuid] ||= []
941 # helper method to preload collections for the given uuids
942 helper_method :preload_collections_for_objects
943 def preload_collections_for_objects uuids
944 @all_collections_for ||= {}
946 raise ArgumentError, 'Argument is not an array' unless uuids.is_a? Array
947 return @all_collections_for if uuids.empty?
949 # if already preloaded for all of these uuids, return
950 if not uuids.select { |x| @all_collections_for[x].nil? }.any?
951 return @all_collections_for
955 @all_collections_for[x] = []
958 # TODO: make sure we get every page of results from API server
959 Collection.where(uuid: uuids).each do |collection|
960 @all_collections_for[collection.uuid] << collection
965 # helper method to get log collections for the given log
966 helper_method :log_collections_for_object
967 def log_collections_for_object log
968 raise ArgumentError, 'No input argument' unless log
970 preload_log_collections_for_objects([log])
973 fixup = /([a-f0-9]{32}\+\d+)(\+?.*)/.match(log)
974 if fixup && fixup.size>1
978 @all_log_collections_for[uuid] ||= []
981 # helper method to preload collections for the given uuids
982 helper_method :preload_log_collections_for_objects
983 def preload_log_collections_for_objects logs
984 @all_log_collections_for ||= {}
986 raise ArgumentError, 'Argument is not an array' unless logs.is_a? Array
987 return @all_log_collections_for if logs.empty?
991 fixup = /([a-f0-9]{32}\+\d+)(\+?.*)/.match(log)
992 if fixup && fixup.size>1
999 # if already preloaded for all of these uuids, return
1000 if not uuids.select { |x| @all_log_collections_for[x].nil? }.any?
1001 return @all_log_collections_for
1005 @all_log_collections_for[x] = []
1008 # TODO: make sure we get every page of results from API server
1009 Collection.where(uuid: uuids).each do |collection|
1010 @all_log_collections_for[collection.uuid] << collection
1012 @all_log_collections_for
1015 # helper method to get object of a given dataclass and uuid
1016 helper_method :object_for_dataclass
1017 def object_for_dataclass dataclass, uuid
1018 raise ArgumentError, 'No input argument dataclass' unless (dataclass && uuid)
1019 preload_objects_for_dataclass(dataclass, [uuid])
1023 # helper method to preload objects for given dataclass and uuids
1024 helper_method :preload_objects_for_dataclass
1025 def preload_objects_for_dataclass dataclass, uuids
1028 raise ArgumentError, 'Argument is not a data class' unless dataclass.is_a? Class
1029 raise ArgumentError, 'Argument is not an array' unless uuids.is_a? Array
1031 return @objects_for if uuids.empty?
1033 # if already preloaded for all of these uuids, return
1034 if not uuids.select { |x| @objects_for[x].nil? }.any?
1038 dataclass.where(uuid: uuids).each do |obj|
1039 @objects_for[obj.uuid] = obj
1044 def wiselinks_layout