|
1 | 1 | # user_defined_in_basic |
2 | 2 | An ArchivesSpace plugin that displays selected user defined fields in the basic information section |
| 3 | + |
| 4 | + |
| 5 | +## How to install it |
| 6 | + |
| 7 | +To install, just activate the plugin in your config/config.rb file by |
| 8 | +including an entry such as: |
| 9 | + |
| 10 | + # If you have other plugins loaded, just add 'user_defined_in_basic' to |
| 11 | + # the list |
| 12 | + AppConfig[:plugins] = ['local', 'other_plugins', 'user_defined_in_basic'] |
| 13 | + |
| 14 | +And then clone the `user_defined_in_basic` repository into your |
| 15 | +ArchivesSpace plugins directory. For example: |
| 16 | + |
| 17 | + cd /path/to/your/archivesspace/plugins |
| 18 | + git clone https://github.com/hudmol/user_defined_in_basic.git |
| 19 | + |
| 20 | +Or if you are after a particular release, download and unzip it from here: |
| 21 | + |
| 22 | +https://github.com/hudmol/user_defined_in_basic/releases |
| 23 | + |
| 24 | + |
| 25 | +## How to configure it |
| 26 | + |
| 27 | +Add an entry to your `config.rb` like this: |
| 28 | + |
| 29 | + AppConfig[:user_defined_in_basic] = { |
| 30 | + 'accession' => ['boolean_1', 'enum_2', 'real_2'], |
| 31 | + 'digital_object' => [], |
| 32 | + 'resource' => ['string_2', 'date_1', 'boolean_1'] |
| 33 | + } |
| 34 | + |
| 35 | +If you don't have a `:user_defined_in_basic` entry the plugin won't do anything. |
| 36 | +It will log a warning at startup. |
| 37 | + |
| 38 | +The three keys shown (`accession`, `resource`, and `digital_object`) are the |
| 39 | +record types that can have a `user_defined` subrecord. For each key specified |
| 40 | +a `user_defined` subrecord will be automatically added when a new record |
| 41 | +is created through the staff UI, or will be added to an existing record when |
| 42 | +it is edited if it doesn't already have one. Also, the remove button is disabled. |
| 43 | + |
| 44 | +So, in the example shown, no fields are moved to the `Basic Information` section |
| 45 | +for `digital_object` (because the field list is empty), but the presence of the |
| 46 | +`digital_object` key guarantees the addition of a `user_defined` subrecord. To |
| 47 | +disable this behavior, simply remove the key. |
| 48 | + |
| 49 | +For each record type, specify the `user_defined` fields that you would like to |
| 50 | +see in the `Basic Information`. |
| 51 | + |
| 52 | +The fields specified will be moved to the `Basic Information` section and will |
| 53 | +appear in the order specified. |
| 54 | + |
| 55 | +If you specify a key other than the three record types supported, or a field |
| 56 | +that doesn't exist in the `user_defined` record, a warning will be logged at |
| 57 | +startup. |
| 58 | + |
0 commit comments