Difference between revisions of "User fields.pl"

From EPrints Documentation
Jump to: navigation, search
(Added actually file name in bold.)
(Added cfgd and dirs templates)
Line 1: Line 1:
 +
{{dirs}}
 +
{{cfgd}}
 +
 
'''user_fields.pl''' defines all the optional fields which an User object has. These fields all have mappings to the database. There are a variety of field types which you can see here [[:Category:EPrints_Metadata_Fields|here]].  
 
'''user_fields.pl''' defines all the optional fields which an User object has. These fields all have mappings to the database. There are a variety of field types which you can see here [[:Category:EPrints_Metadata_Fields|here]].  
  

Revision as of 08:06, 31 January 2022

EPrints 3 Reference: Directory Structure - Metadata Fields - Repository Configuration - XML Config Files - XML Export Format - EPrints data structure - Core API - Data Objects


Back to cfg.d

user_fields.pl defines all the optional fields which an User object has. These fields all have mappings to the database. There are a variety of field types which you can see here here.

Users have various field types which enforce various constraints. Each field type has its own method of storing in the database, retrieving the value from the database, rendering the value in HTML, and rendering the input component HTML for use in workflows, etc.

Note removing fields from user_fields.pl does not usually cause data to be deleted from the database. To add or remove fields from eprint_fields.pl you must run:

EPRINTS_PATH/bin/epadmin update_database_structure <ARCHIVE_NAME> 

and then reload your configuration (or restart the webserver).

Field Definition

The field list is represented by an arrayref of hashrefs. Each hashref has at minimum a name, which is the field name used when referring to the field (e.g. in search) and a type, which describes the type of data the field will hold. Depending on a field's type there may also be other compulsory fields and some optional ones. See the details of field definition on the page for that type.

$c->{fields}->{user} = [
     {
         name => 'name',
         type => 'name',
         render_order => 'gf',
     },
     ...
];