Sha256: 6692fdc08dc5e355356484a0edb9db3f5c552db1b368e949d5a532e5241e1fcd

Contents?: true

Size: 1.1 KB

Versions: 21

Compression:

Stored size: 1.1 KB

Contents

# encoding: UTF-8

# Copyright 2011 innoQ Deutschland GmbH
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

require 'iqvoc/skos_importer'

class ImportController < ApplicationController

  before_filter do
    authorize! :import, Concept::Base
  end

  def index
  end

  def import
    content = params[:ntriples_file] && params[:ntriples_file].read
    strio = StringIO.new
    begin
      Iqvoc::SkosImporter.new(content.to_s.split("\n"), params[:default_namespace], Logger.new(strio))
      @messages = strio.string
    rescue Exception => e
      @messages = e.to_s + "\n\n" + e.backtrace.join("\n")
    end
  end

end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
iqvoc-4.1.0 app/controllers/import_controller.rb
iqvoc-4.0.9 app/controllers/import_controller.rb
iqvoc-4.0.8 app/controllers/import_controller.rb
iqvoc-4.0.7 app/controllers/import_controller.rb
iqvoc-4.0.6 app/controllers/import_controller.rb
iqvoc-4.0.5 app/controllers/import_controller.rb
iqvoc-4.0.4 app/controllers/import_controller.rb
iqvoc-4.0.3 app/controllers/import_controller.rb
iqvoc-4.0.2 app/controllers/import_controller.rb
iqvoc-4.0.1 app/controllers/import_controller.rb
iqvoc-4.0.0 app/controllers/import_controller.rb
iqvoc-3.5.7 app/controllers/import_controller.rb
iqvoc-3.5.6 app/controllers/import_controller.rb
iqvoc-3.5.5 app/controllers/import_controller.rb
iqvoc-3.5.4 app/controllers/import_controller.rb
iqvoc-3.5.3 app/controllers/import_controller.rb
iqvoc-3.5.2 app/controllers/import_controller.rb
iqvoc-3.5.1 app/controllers/import_controller.rb
iqvoc-3.5.0 app/controllers/import_controller.rb
iqvoc-3.4.0 app/controllers/import_controller.rb