Skip to content
Christoph Wiemers edited this page May 14, 2013 · 11 revisions

Why are there three different language settings?

For some thesauri, it makes sense to distinguish primary and secondary languages - e.g. if preferred labels should always be in English while other languages are allowed for alternative labels. Similarly, the selection of label languages does not necessarily apply to notes.

Thus iQvoc's instance configuration distinguishes the following settings:

  • selectable languages for preferred labels (languages.pref_labeling)
  • selectable languages for alternative labels (languages.further_labelings.Labeling::SKOS::AltLabel by default)
  • selectable languages for notes (languages.notes)

Note that the selection of primary (i.e. pref. label) languages determines the available interface languages and is used for routing in the locale part of the URI.

The first value in pref_labeling_languages also determines the default UI localization when calling unlocalized URIs.

How to extend the concept user interface? (in progress)

In case you use iQvoc as a Framework you will come to the point, where you extend iQvoc with your own model classes. That will lead you to add new user interface elements to the default show view of your concept. This text will guide you through the basic principles of extending the user interface.

Let's start with an Example. Let's say you have some event data you want to manage with iQvoc. Each event has a beginning and an ending. If you want to build that with iQvoc, you create a Concept::Event class, which inherits from Concept::SKOS::Base. Afterwards you probably create TemporalEntity class, which inherits from ActiveRecord::Base. You maybe end up with something like.

class Concept::Event < Concept::SKOS::Base
  accepts_nested_attributes_for :temporal_entities
end
class TemporalEntity < ActiveRecord::Base
	belongs_to :event, :class_name => 'Concept::Event'

  def self.partial_name(obj)
  	'partials/temporal_entity/base'
  end
end

class CreateTemporalEntities < ActiveRecord::Migration
  def up
    create_table :temporal_entities do |t|
      t.date :beginning
      t.date :ending
      t.references :event
      t.string :type
    end
  end

  def down
    drop_table :temporal_entities
  end
end

The TemporalEntity class has two attributes beginning and ending for saving the time interval. TemporalEntity model has a belongs_to relationship with Concept::Event. In iQvoc every model knows it's show partial by convention. It is stored as a simple path string in the partial_name class method. In case of Concept::Event, we inherit that method, but for TemporalEntity, we have to declare it. The root of the paths is the partials folder, which is located in the views folder. Last but not least we have to create our partial. At this point we have setup our basic structure, what we want to do now, is to add the time interval to our show concept view.

Before we start with the necessary steps, let's have deeper look at how partials will be rendered.

Next up

  • explain process of rendering partials see chat log
  • explain additional_association_class_names