+ %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] ||= 40
+
+ @filters += [['link_class','=','name'],
+ ['head_uuid','is_a','arvados#collection']]
+
+ @objects = Link
+ find_objects_for_index
+
+ @name_links = @objects
+
+ @objects = Collection.
+ filter([['uuid','in',@name_links.collect(&:head_uuid)]])
+ super