ontologies_controller.rb revision d5d671c1deb163607d1aadb5860e226a58237248
#
# Controller for ontologies
#
types = OntologyType.select([:name, :id]).order(:name).all.map {|type| {"name" => type.name, "value" => type.id.to_s} }
repositories = Repository.select([:name, :id]).order(:name).all.map {|repository| {"name" => "in " + repository.name, "value" => repository.id.to_s} }
projects = Project.select([:name, :id]).order(:name).all.map {|project| {"name" => "from " + project.name, "value" => project.id.to_s} }
formalities = FormalityLevel.select([:name, :id]).order(:name).all.map {|formality| {"name" => "in " + formality.name, "value" => formality.id.to_s} }
licenses = LicenseModel.select([:name, :id]).order(:name).all.map {|license| {"name" => "under " + license.name, "value" => license.id.to_s} }
tasks = Task.select([:name, :id]).order(:name).all.map {|task| {"name" => "for " + task.name, "value" => task.id.to_s} }
@filters_map = {
'OntologyType' => [
],
'Repository' => [
],
'Project' => [
],
'FormalityLevel' => [
],
'LicenseModel' => [
],
'Task' => [
]
}
if in_repository?
else
end
end
@c_vertices = []
if vert
end
end
@c_vertices = []
if vert
end
end
end
end
if !params[:repository_id]
# redirect for legacy routing
return
end
respond_to do |format|
format.html do
if !resource.distributed?
else
end
end
format.json do
end
end
end
# retry a specific ontology
scope = scope.where(id: id)
end
redirect_to (id ? [parent, scope.first!, :ontology_versions] : [parent, :ontologies])
end
respond_to do |format|
format.json do
end
end
end
end
end
end
end
end
@a ||= []
vertex.children.each { |child| build_categories_tree(child) unless child.children.empty?; @a << child }
@a
end
def user_selected_categories
params[:category_ids].keys unless params[:category_ids].nil?
end
end