Difference between revisions of "Subobject field"

From EPrints Documentation
Jump to: navigation, search
(Required Phrases)
(Amended structure to standardise for metadata field type.)
Line 1: Line 1:
* [[Metadata]]
+
{{fieldtypes}}
** [[Set field]]
+
 
*** [[Subobject field]]
+
 
 
== Description ==
 
== Description ==
 
 
This is a type repesenting a [[Data Object]] (or objects) which is a sub-part of this object, not just related to it in some way.
 
This is a type repesenting a [[Data Object]] (or objects) which is a sub-part of this object, not just related to it in some way.
  
Line 10: Line 9:
 
It's used to define [[Document Object]]s as part of [[EPrint Object]]s and [[Saved Search Object]]s as part of [[User Object]]s.
 
It's used to define [[Document Object]]s as part of [[EPrint Object]]s and [[Saved Search Object]]s as part of [[User Object]]s.
  
== Properties ==
+
== Inheritance ==
 
+
* [[Metadata]]
As for [[set field]]s with the following differences...
+
** [[Subobject field]]
  
 +
== Additional Properties ==
 
{| border="1" cellpadding="3" cellspacing="0"
 
{| border="1" cellpadding="3" cellspacing="0"
 
| name || default || description  
 
| name || default || description  
Line 19: Line 19:
 
| '''datasetid''' || n/a || '''This property is always required.'''
 
| '''datasetid''' || n/a || '''This property is always required.'''
 
|-
 
|-
| '''show_in_fieldlist''' || 0 || ...
+
| '''dataset_fieldname''' || datasetid || ...
 +
|-
 +
| '''dataobj_fieldname''' || objectid || ...
 +
|-
 +
| '''show_in_fieldlist''' || 0 || '''Different default.'''
 +
|-
 +
| '''match''' || IN || '''Different default.'''
 
|}
 
|}
 +
 +
== Required Phrases ==
 +
No additional phrases beyond the [[Metadata#Required_Phrases|standard metadata field phrases]].
 +
 +
== Database ==
 +
A subobject field does not actually add anu extra fields or tables to the database it just uses existing fields to associated two different data objects.
 +
 +
== API ==
 +
See [[API:EPrints/MetaField/Subobject|API page]].
 +
 +
== Examples ==
 +
Most basic example.
 +
{
 +
    name => 'primary_file',
 +
    type => 'subobject',
 +
    datasetid => 'file',
 +
}
 +
Associate multiple sub-objects.
 +
{
 +
    name => 'files',
 +
    type => 'subobject',
 +
    datasetid => 'file',
 +
    multiple => 1,
 +
}
 +
Associate sub-objects that can only belong to one type of parent object.
 +
{
 +
    name => 'documents',
 +
    type=> 'subobject',
 +
    datasetid => 'document',
 +
    multiple => 1,
 +
    dataobj_fieldname => 'eprintid',
 +
    dataset_fieldname => '',
 +
}

Revision as of 08:53, 11 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 - Relation - Search - Secret - Set - Storable - Subject - Subobject - Text - Time - Timestamp - Url - Uuid


Description

This is a type repesenting a Data Object (or objects) which is a sub-part of this object, not just related to it in some way.

This is used by the system and not intended for use in user defined fields.

It's used to define Document Objects as part of EPrint Objects and Saved Search Objects as part of User Objects.

Inheritance

Additional Properties

name default description
datasetid n/a This property is always required.
dataset_fieldname datasetid ...
dataobj_fieldname objectid ...
show_in_fieldlist 0 Different default.
match IN Different default.

Required Phrases

No additional phrases beyond the standard metadata field phrases.

Database

A subobject field does not actually add anu extra fields or tables to the database it just uses existing fields to associated two different data objects.

API

See API page.

Examples

Most basic example.

{
    name => 'primary_file', 
    type => 'subobject', 
    datasetid => 'file',
}

Associate multiple sub-objects.

{
    name => 'files', 
    type => 'subobject', 
    datasetid => 'file',
    multiple => 1,
}

Associate sub-objects that can only belong to one type of parent object.

{
    name => 'documents', 
    type=> 'subobject', 
    datasetid => 'document',
    multiple => 1,
    dataobj_fieldname => 'eprintid',
    dataset_fieldname => ,
}