Difference between revisions of "Itemref field"

From EPrints Documentation
Jump to: navigation, search
(Additional Properties)
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
{{fieldtypes}}
 +
 +
 +
== Description ==
 +
This field allows another data object to be referenced, which belongs to a specified datasetid.
 +
 +
== Inheritance ==
 
* [[Metadata]]
 
* [[Metadata]]
 
** [[Int field]]
 
** [[Int field]]
 
*** [[Itemref field]]
 
*** [[Itemref field]]
  
== Description ==
+
== Additional Properties ==
 
+
As for [[Int field#Additional_Properties|Int fields]] except for:
== Properties ==
 
 
 
As for [[int field]]s with the following differences...
 
  
 
{| border="1" cellpadding="3" cellspacing="0"
 
{| border="1" cellpadding="3" cellspacing="0"
| name || default || description
+
! Name !! Default Value !! Required !! Description !! Notes
 +
|-
 +
| '''datasetid''' || n/a || YES || The ID of the dataset from which an data object (item) is referenced. ||
 +
|-
 +
| '''get_item''' || <tt>undef</tt> || NO || How to get the data object (item) referenced, if it is not just as case of looking up its ID against the value in this field. ||
 
|-
 
|-
| '''datasetid''' || n/a || '''This property is always required.'''
+
| '''render_item''' || <tt>undef</tt> || NO || How to render the data object (item) referenced if it is not by using the data object's <tt>render_citation_link</tt> method. ||
 
|}
 
|}
  
 
== Required Phrases ==
 
== Required Phrases ==
 +
No additional phrases beyond those required for [[Int field#Required_Phrases|Int fields]].
 +
 +
== Database ==
 +
Itemref fields are stored in the database as
 +
fieldname INT(11)
 +
 +
== API ==
 +
See [[API:EPrints/MetaField/Itemref|API page]].
 +
 +
== Examples ==
 +
Most basic example.
 +
{
 +
    name => 'userid',
 +
    type => 'itemref',
 +
    datasetid => 'user',
 +
},
 +
To specify one eprint succeeds another.  This may not always be required and if you clone the eprint record the new eprint should not succeed the same eprint.
 +
{
 +
    name => 'succeeds',
 +
    type => 'itemref',
 +
    required => 0,
 +
    datasetid => 'eprint',
 +
    can_clone => 0,
 +
}
 +
You might create a data object that groups together several eprints
 +
{
 +
    name => 'items',
 +
    type => 'itemref',
 +
    datasetid => 'eprint',
 +
    multiple => 1,
 +
    required => 1,
 +
}

Latest revision as of 07:37, 12 April 2023

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


Metadata Fields: Arclanguage - Base64 - Bigint - Boolean - Compound - Counter - Dataobjref - Date - Decimal - Email - Fields - Float - Id - Idci - Image - Int - Itemref - Keywords - Langid - Longtext - Longtext_counter - Multilang - Multipart - Name - Namedset - Pagerange - Recaptcha - Recaptcha3 - Relation - Search - Secret - Set - Storable - Subject - Subobject - Text - Time - Timestamp - Url - Uuid


Description

This field allows another data object to be referenced, which belongs to a specified datasetid.

Inheritance

Additional Properties

As for Int fields except for:

Name Default Value Required Description Notes
datasetid n/a YES The ID of the dataset from which an data object (item) is referenced.
get_item undef NO How to get the data object (item) referenced, if it is not just as case of looking up its ID against the value in this field.
render_item undef NO How to render the data object (item) referenced if it is not by using the data object's render_citation_link method.

Required Phrases

No additional phrases beyond those required for Int fields.

Database

Itemref fields are stored in the database as

fieldname INT(11)

API

See API page.

Examples

Most basic example.

{
    name => 'userid',
    type => 'itemref',
    datasetid => 'user',
},

To specify one eprint succeeds another. This may not always be required and if you clone the eprint record the new eprint should not succeed the same eprint.

{
    name => 'succeeds', 
    type => 'itemref',
    required => 0,
    datasetid => 'eprint', 
    can_clone => 0,
}

You might create a data object that groups together several eprints

{
    name => 'items',
    type => 'itemref', 
    datasetid => 'eprint', 
    multiple => 1, 
    required => 1,
}