uklibraries / metadata_editor

Metadata editor satisfying the KDL metadata guidelines
0 stars 0 forks source link

Add user-manageable controlled vocabulary for source #22

Closed cokernel closed 11 years ago

cokernel commented 11 years ago

The KDL metadata guidelines specify that the source field has the schema "A formal identifier (recommended), Free text". Right now the source field in the metadata editor accepts free text only.

To fix this, a Source model should be added to the metadata editor. Each Source should belong to a Repository in the same way Records do. A user who can edit a repository should be allowed to create new sources under that repository.

When editing a record, a user should be able to browse sources and add a new source if it is not already in the vocabulary.

rrmait0 commented 11 years ago

This is being placed in _form.html.erb

<%= f.input :source, tooltip: I18n.t('records.source') %>
<%= f.association :repository, tooltip: I18n.t('records.repository'),
      input_html: { class: 'chosen-select' } %>

Is this correct? Should we remove the source?

rrmait0 commented 11 years ago

The show should display the repository in the source?

cokernel commented 11 years ago

The source line should be marked as an association in the Record form:

<%= f.association :source, tooltip: I18n.t('records.source'), 
      input_html: { class: 'chosen-select' } %>

It will probably reduce confusion if both Source and Record display their Repository if that field is set.

rrmait0 commented 11 years ago

Thanks for the clarification. Something has to be changed in the model for this association to work. It is giving a Runtime error message: Association: source not found.

rrmait0 commented 11 years ago

From what I understand a new model has to be created called source. The source field in record has to be removed.

rrmait0 commented 11 years ago

I created the new model source but there is not a db fixture for source.

cokernel commented 11 years ago

@rrmait0, you are correct that satisfying this request will require creating a Source model and removing the source column from the Record model.

As for your second question, there is no need to seed the database with sources because repository managers will be responsible for that. We are only seeding the database with program-wide controlled vocabularies.

cokernel commented 11 years ago

I mistakenly closed this issue. The Source model has been created, but we still need the rest of the feature to be implemented.

cokernel commented 11 years ago

@rrmait0, I've deployed a rough sketch (#48) of an authorization model for the metadata editor. You can self-register, but I did not implement user administration. You can use the rails console to set your own roles_mask: the bit for admin is 1 and the bit for site manager is 2 (roles_mask should be the sum of the roles you want).

I did not have time to do any work on Sources. I recommend looking at the implementation of Record permissions for some ideas:

cokernel commented 11 years ago

This is handled in #56.