Difference between revisions of "Document fields default.pl"

From EPrints Documentation
Jump to: navigation, search
(Created page with '{{dirs}} {{cfgd}} * $data is a hash of the metadata which will make up the document object. Each field name is a key in the hash. * $session is a [[API:EPrints/Repository|Reposi…')
 
Line 1: Line 1:
 
{{dirs}}
 
{{dirs}}
 
{{cfgd}}
 
{{cfgd}}
 +
 +
The set_document_defaults function sets the default values for a Document. This usually happens when a Document is created but before it is given to the user to edit.
  
 
* $data is a hash of the metadata which will make up the document object. Each field name is a key in the hash.
 
* $data is a hash of the metadata which will make up the document object. Each field name is a key in the hash.

Revision as of 14:54, 18 August 2010

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

The set_document_defaults function sets the default values for a Document. This usually happens when a Document is created but before it is given to the user to edit.

  • $data is a hash of the metadata which will make up the document object. Each field name is a key in the hash.
  • $session is a Repository object (in 3.2 or later)
  • $eprint is the EPrint object to which the document belongs

Example

$c->{set_document_defaults} = sub
{
        my( $data, $session, $eprint ) = @_;

        $data->{language} = $session->get_langid();
        $data->{security} = "public";
};