ontologies_controller.rb revision 06cbff1e355ede78f5fa530b57a93e4dbc533840
d00f0155af9a9a671eb08a0dc30f5ea0a379c36cayznaga# Controller for ontologies
d00f0155af9a9a671eb08a0dc30f5ea0a379c36cayznagaclass OntologiesController < InheritedResources::Base
d00f0155af9a9a671eb08a0dc30f5ea0a379c36cayznaga before_filter :check_write_permission, except: [:index, :show, :oops_state]
d00f0155af9a9a671eb08a0dc30f5ea0a379c36cayznaga @c_vertices = Category.first.roots.first.children rescue []
d00f0155af9a9a671eb08a0dc30f5ea0a379c36cayznaga @c_vertices = Category.first.roots.first.children rescue []
d00f0155af9a9a671eb08a0dc30f5ea0a379c36cayznaga # redirect for legacy routing
d00f0155af9a9a671eb08a0dc30f5ea0a379c36cayznaga default_kind = resource.symbols.groups_by_kind.first.kind
d00f0155af9a9a671eb08a0dc30f5ea0a379c36cayznaga redirect_to locid_for(resource, :symbols, kind: default_kind)
d00f0155af9a9a671eb08a0dc30f5ea0a379c36cayznaga flash[:error] = "Can't delete #{Settings.OMS.with_indefinite_article}
d00f0155af9a9a671eb08a0dc30f5ea0a379c36cayznaga that is imported by another one."
d00f0155af9a9a671eb08a0dc30f5ea0a379c36cayznaga # retry a specific ontology
d00f0155af9a9a671eb08a0dc30f5ea0a379c36cayznaga redirect_to (id ? [parent, scope.first!, :ontology_versions] : [parent, :ontologies])
d00f0155af9a9a671eb08a0dc30f5ea0a379c36cayznaga authorize!(:show, Repository.find_by_path(params[:repository_id]))
d00f0155af9a9a671eb08a0dc30f5ea0a379c36cayznaga clazz = type=='DistributedOntology' ? DistributedOntology : SingleOntology
d00f0155af9a9a671eb08a0dc30f5ea0a379c36cayznaga vertex.children.each { |child| build_categories_tree(child) unless child.children.empty?; @a << child }
d00f0155af9a9a671eb08a0dc30f5ea0a379c36cayznaga def user_selected_categories
d00f0155af9a9a671eb08a0dc30f5ea0a379c36cayznaga params[:category_ids].keys unless params[:category_ids].nil?
d00f0155af9a9a671eb08a0dc30f5ea0a379c36cayznaga helper_method :repository
d00f0155af9a9a671eb08a0dc30f5ea0a379c36cayznaga def repository