Difference between revisions of "Multipart field"

From EPrints Documentation
Jump to: navigation, search
(Used modified deprecated template)
(Re-instated this field type as it is the super class of Name field.)
 
Line 2: Line 2:
  
  
{{Deprecated|The Multipart field type is far inferior to a [[Compound field]] type that should be used instead.|metadata field type}}
+
== Description ==
 +
This field is similar to a [[Compound field]] but only intended for single sets of values (i.e. <tt>multiple => 0</tt>).  So that it can be used to build complex fields like the [[Name field]].
 +
 
 +
== Inheritance ==
 +
* [[Metadata]]
 +
*** [[Multipart field]]
 +
 
 +
== Additional Properties ==
 +
{| border="1" cellpadding="3" cellspacing="0"
 +
! Name !! Default Value !! Required !! Description !! Notes
 +
|-
 +
| '''fields''' || n/a || YES || The sub-fields of the main field ||
 +
|-
 +
| '''fields_cache''' || n/a || NO  || A cache of the sub-fields || This property is generated from <code>fields</code>.
 +
|-
 +
| '''fields_index''' || <tt>{}</tt> || NO || Index of <tt>sub_name</tt> to field object || This property is generated from <code>fields</code>.
 +
|}
 +
 
 +
== Required Phrases ==
 +
In addition tothe [[Metadata#Required_Phrases|standard metadata field phrases]]<code>type</code>.  The sub-field names in the form:
 +
  datasetid + "_fieldname_" + fieldname + "_" + subfieldname
 +
Individual fieldhelp phrases are not required the help for sub-fields should be included in the fieldhelp for the main field.
 +
 
 +
== Database ==
 +
Multipart fields are stored in the database as multiple fields, whose types are determined in the sub-field configuration.
 +
 
 +
== API ==
 +
See [[API:EPrints/MetaField/Multipart|API page]].
 +
 
 +
== Examples ==
 +
Most basic example.
 +
{
 +
    name => 'email',
 +
    type => 'multipart',
 +
    fields => [
 +
        {
 +
            sub_name => 'subject'
 +
            type => 'text'
 +
        },
 +
        {
 +
            sub_name => 'body'
 +
            type => 'longtext'
 +
        },
 +
}

Latest revision as of 16:38, 15 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 field is similar to a Compound field but only intended for single sets of values (i.e. multiple => 0). So that it can be used to build complex fields like the Name field.

Inheritance

Additional Properties

Name Default Value Required Description Notes
fields n/a YES The sub-fields of the main field
fields_cache n/a NO A cache of the sub-fields This property is generated from fields.
fields_index {} NO Index of sub_name to field object This property is generated from fields.

Required Phrases

In addition tothe standard metadata field phrasestype. The sub-field names in the form:

 datasetid + "_fieldname_" + fieldname + "_" + subfieldname

Individual fieldhelp phrases are not required the help for sub-fields should be included in the fieldhelp for the main field.

Database

Multipart fields are stored in the database as multiple fields, whose types are determined in the sub-field configuration.

API

See API page.

Examples

Most basic example.

{
    name => 'email',
    type => 'multipart',
    fields => [
        {
            sub_name => 'subject'
            type => 'text'
        },
        {
            sub_name => 'body'
            type => 'longtext'
        },
}