+ %w(Files Provenance_graph Used_by Advanced)
+ end
+
+ def set_persistent
+ case params[:value]
+ when 'persistent', 'cache'
+ persist_links = Link.filter([['owner_uuid', '=', current_user.uuid],
+ ['link_class', '=', 'resources'],
+ ['name', '=', 'wants'],
+ ['tail_uuid', '=', current_user.uuid],
+ ['head_uuid', '=', @object.uuid]])
+ logger.debug persist_links.inspect
+ else
+ return unprocessable "Invalid value #{value.inspect}"
+ end
+ if params[:value] == 'persistent'
+ if not persist_links.any?
+ Link.create(link_class: 'resources',
+ name: 'wants',
+ tail_uuid: current_user.uuid,
+ head_uuid: @object.uuid)
+ end
+ else
+ persist_links.each do |link|
+ link.destroy || raise
+ end
+ end
+
+ respond_to do |f|
+ f.json { render json: @object }
+ end
+ end
+
+ def choose
+ params[:limit] ||= 20
+ @objects = Link.
+ filter([['link_class','=','name'],
+ ['head_uuid','is_a','arvados#collection']])
+ find_objects_for_index
+ @next_page_href = (next_page_offset and
+ url_for(offset: next_page_offset, partial: true))
+ @name_links = @objects
+ @objects = Collection.
+ filter([['uuid','in',@name_links.collect(&:head_uuid)]])
+ super