Difference between revisions of "Subobject field"

From EPrints Documentation
Jump to: navigation, search
(Description)
(Examples: Added any parent example)
 
(7 intermediate revisions by 2 users not shown)
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 Value !! Required !! Description !! Notes
 +
|-
 +
| '''datasetid'''  || n/a || YES || ID of the dataset that a sub-object must belong. ||
 +
|-
 +
| '''dataset_fieldname''' || <tt>datasetid</tt> || NO || The name of the field to store the dataset ID. ||
 +
|-
 +
| '''dataobj_fieldname''' || <tt>objectid</tt> || NO || The name of the field to store the data object ID. ||
 
|-
 
|-
| '''datasetid''' || n/a || '''This property is always required.'''
+
| '''show_in_fieldlist''' || <tt>0</tt> || NO || Whether field should be included in parent data object's field list. || Different from [[Metadata]] default (<tt>1</tt>).
 
|-
 
|-
| '''show_in_fieldlist''' || 0 || ...
+
| '''match''' || <tt>IN</tt> || NO || How to match values in search results. || Different from [[Metadata]] default (<tt>EQ</tt>). Treat the search value as a list of whitespace-separated words rather than a single string.
 
|}
 
|}
  
 
== Required Phrases ==
 
== 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',
 +
}
 +
#Associate sub-objects that can belong to any type of parent object.
 +
{
 +
    name => 'files',
 +
    type=> 'subobject',
 +
    multiple => 1,
 +
    datasetid => 'file',
 +
    dataset_fieldname => 'thingtype',
 +
    dataobj_fieldname => 'thingid',
 +
}

Latest revision as of 13:51, 29 November 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 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 Value Required Description Notes
datasetid n/a YES ID of the dataset that a sub-object must belong.
dataset_fieldname datasetid NO The name of the field to store the dataset ID.
dataobj_fieldname objectid NO The name of the field to store the data object ID.
show_in_fieldlist 0 NO Whether field should be included in parent data object's field list. Different from Metadata default (1).
match IN NO How to match values in search results. Different from Metadata default (EQ). Treat the search value as a list of whitespace-separated words rather than a single string.

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',
}
  1. Associate sub-objects that can belong to any type of parent object.
{
    name => 'files', 
    type=> 'subobject', 
    multiple => 1,
    datasetid => 'file',
    dataset_fieldname => 'thingtype',
    dataobj_fieldname => 'thingid',
}