Dataobjref field

From EPrints Documentation
Revision as of 20:45, 10 April 2023 by Drn@ecs.soton.ac.uk (talk | contribs) (Drn@ecs.soton.ac.uk moved page Dataobjref Field to Dataobjref field without leaving a redirect)
Jump to: navigation, search

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, which belongs to a specified datasetid to be referenced. This is a bit like an Itemref field but allows multiple fields from another data object to be stored with the ID of the data object referenced.

Inheritance

Additional Properties

As for Compound fields except for:

name default description
datasetid n/a This property is always required.
input_lookup_url lookup/dataobjref The CGI script path to use to lookup data objects.

Required Phrases

No additional phrases beyond those required for Compound fields.

Database

Itemref fields are stored in the database as

fieldname INT(11)

API

See API page.

Examples

Most basic example. (Captures an associated user title with its ID).

{
    name => 'userid',
    type => 'dataobjref',
    datasetid => 'user',
    fields => [ 
        { 
            sub_name => 'title', 
            type => 'text',
        } 
    ],
}

Capture multiple data object references.

{
    name => 'funders',
    type => 'dataobjref,
    datasetid => 'funder',
    multiple => 1,
    fields => [
        { 
            sub_name => 'name',
            type => 'text' 
        },
    ],
}

Use bespoke lookup URL.

{
    name => 'eprintid',
    type => 'dataobjref',
    datasetid => 'eprint',
    input_lookup_url => 'lookup/mydataobjref',
    fields => [ 
        { 
            sub_name => 'title', 
            type => 'text',
        },
        { 
            sub_name => 'date', 
            type => 'date',
        } ,
    ],
}