Eprint fields default.pl
Revision as of 00:10, 31 January 2022 by Drn@ecs.soton.ac.uk (talk | contribs)
EPrints 3 Reference: Directory Structure - Metadata Fields - Repository Configuration - XML Config Files - XML Export Format - EPrints data structure - Core API - Data Objects
eprint_fields_default.pl contains configuration to set the default values for eprint fields through the set_eprint_defaults function. This usually happens when a EPrint is created but before it is given to the user to edit.
- $data is a hash reference of the metadata which will make up the document object. Each field name is a key in the hash.
- $repository is a Repository object.
Example
In this example, the default for type is set to article.
$c->{set_eprint_defaults} = sub { my( $data, $repository ) = @_; $data->{type} = "article"; };
N.B. There are also a number of defaults set by the EPrints::DataObj::EPrint::get_defaults method:
- dir is set to the path where files for the EPrint will be stored (e.g. EPrints 12345 will be stored in disk0/00/01/23/45).
- status_changed which is set to value of lastmod which has already been set to the current time.
- datestamp which is set to value of lastmod if eprint_status is already set to archive, (e.g. if the EPrint is being imported).