Difference between revisions of "Compound field"

From EPrints Documentation
Jump to: navigation, search
m
m (Additional Properties)
 
(13 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[http://kinunia.cn/le-vibrazioni.htm le vibrazioni testi canzoni] [http://helmed.info/topic/orchid/ orchid] [http://bloprofeldi.info/lib/seca-xxl.htm seca xxl hex] [http://ustall.org/web/foppa-pedretti.htm foppa pedretti magic] [http://kinunia.cn/mike-in.htm mike in brazil] [http://bloprofeldi.info/lib/biglietto-last.htm biglietto last minute low] [http://helmed.info/topic/carole-landis/ carole landis] [http://psisemiya.com/images/small/reverdy-pierre/ reverdy, pierre] [http://helmed.info/topic/foggia-troie/ foggia troie] [http://helmed.info/topic/toyota-celica/ toyota celica] [http://ashythro.info/library/html/day-daniel/ day daniel] [http://psisemiya.com/images/small/prezioso-midi/ prezioso midi] [http://saibso.org/gioia-di.htm gioia di vivere - viviamo allegramente] [http://ustall.org/web/illusioni-ottiche.htm illusioni ottiche] [http://chaba.info/sebastian-la/ sebastian la sirenetta] [http://psisemiya.com/images/small/samsung-digimax/ samsung digimax a 5] [http://helmed.info/topic/twisted-nerve/ twisted nerve kill bill] [http://ustall.org/web/timcafe-it.htm timcafe it] [http://davte.info/library/html/eurojunior.htm eurojunior] [http://psisemiya.com/images/small/la-donna/ la donna di tutti] [http://psisemiya.com/images/small/polisterolo-torino/ polisterolo torino] [http://amohseni.info/img/styles/univarsal/ univarsal] [http://helmed.info/topic/foto-scopate/ foto scopate tra mamma e figlio] [http://ustall.org/web/nna-sky.htm nna sky move ya body] [http://nobinters.org/supporti-da.htm supporti da muro] [http://ashythro.info/library/html/sempron/ sempron 3000 754] [http://amohseni.info/img/styles/hp/ hp 1115] [http://chaba.info/chicco-lampada/ chicco lampada] [http://davte.info/library/html/voli-varsavia.htm voli varsavia] [http://psisemiya.com/images/small/image-styles/ image styles] [http://ustall.org/web/morricone-la.htm morricone la leggenda del pianista] [http://psisemiya.com/images/small/dulfer/ dulfer] [http://nobinters.org/televisione-lcd.htm televisione lcd samsung] [http://chaba.info/olivetti-pgl/ olivetti pgl 18] [http://ustall.org/web/ydra.htm ydra] [http://psisemiya.com/images/small/obiettivo-intercambiabile/ obiettivo intercambiabile] [http://ustall.org/web/jalapa.htm jalapa] [http://saibso.org/scuole-toelettatura.htm scuole toelettatura] [http://saibso.org/la-sirenetta.htm la sirenetta 1980] [http://davte.info/library/html/helly-holland.htm helly holland] [http://davte.info/library/html/planeet-funk.htm planeet funk] [http://nobinters.org/billiards-bombs.htm billiards bombs] [http://chaba.info/dvd-store/ dvd store] [http://saibso.org/mansion-imposible.htm mansion imposible] [http://amohseni.info/img/styles/lettore-memory/ lettore memory stick pro] [http://amohseni.info/img/styles/insieme-kar/ insieme kar] [http://bloprofeldi.info/lib/rappresentanti-per.htm rappresentanti per estero] [http://nobinters.org/mamara-eros.htm mamara eros ramazzotti] [http://amohseni.info/img/styles/osculati/ osculati] [http://davte.info/library/html/un-genio.htm un genio in famiglia] [http://kinunia.cn/bevanda-ai.htm bevanda ai cereali] [http://kinunia.cn/winmix-gratis.htm winmix gratis] [http://psisemiya.com/images/small/delitto-nella/ delitto nella tempesta] [http://ustall.org/web/olga-tanon.htm olga tanon] [http://chaba.info/programma-per/ programma per mix] [http://bloprofeldi.info/lib/ati-radeon.htm ati radeon x600pro 256mb pci dvi] [http://chaba.info/gay-cazzi/ gay cazzi nudi video gratis] [http://nobinters.org/nute-if.htm nute if you buck] [http://kinunia.cn/sgozzati.htm sgozzati] [http://ustall.org/web/www-mogambo.htm www mogambo com ar] [http://ustall.org/web/zelig-drive.htm zelig drive 4] [http://saibso.org/tetovaza.htm tetovaza] [http://psisemiya.com/images/small/inserimento-motore/ inserimento motore ricerca] [http://chaba.info/do-you/ do you knoe where] [http://helmed.info/topic/new-maco/ new maco s] [http://kinunia.cn/faretti-per.htm faretti per giardino] [http://saibso.org/tomtom-.htm tomtom 500 europa] [http://helmed.info/topic/nokia-/ nokia 6630 accessori mmc] [http://kinunia.cn/www-ragazze.htm www ragazze italiane] [http://kinunia.cn/diga-di.htm diga di assuan] [http://saibso.org/tv-lcd.htm tv lcd 17 hyundai] [http://ustall.org/web/jeep-cherokee.htm jeep cherokee 2 8 crd] [http://ustall.org/web/cuore-prigioniero.htm cuore prigioniero] [http://ustall.org/web/gps-navman.htm gps navman] [http://davte.info/library/html/fotos-porno.htm fotos porno de belinda] [http://psisemiya.com/images/small/casse-audio/ casse audio pc] [http://bloprofeldi.info/lib/the-ark.htm the ark sane] [http://kinunia.cn/el-ultimo.htm el ultimo video de kalimba] [http://kinunia.cn/neon-blu.htm neon blu] [http://amohseni.info/img/styles/l-oceano/ l oceano del silenzio] [http://helmed.info/topic/ridi/ ridi] [http://kinunia.cn/schede-ati.htm schede ati x850] [http://ashythro.info/library/html/tv-lcd/ tv lcd 32 pollici hdmi] [http://psisemiya.com/images/small/con-la/ con la pallina] [http://saibso.org/paroles-marina.htm paroles marina] [http://nobinters.org/gioco-grande.htm gioco grande fratello] [http://amohseni.info/img/styles/appartamento-lecce/ appartamento lecce] [http://davte.info/library/html/del-turco.htm del turco] [http://davte.info/library/html/cheats-for.htm cheats for rpm tuning] [http://amohseni.info/img/styles/nvidia-geforce/ nvidia geforce 6600 agp8x] [http://chaba.info/ruslana-wild/ ruslana wild dances eurovision] [http://bloprofeldi.info/lib/boy-s.htm boy s] [http://nobinters.org/palm-te.htm palm te2] [http://psisemiya.com/images/small/benetton-basket/ benetton basket] [http://bloprofeldi.info/lib/canna-spinning.htm canna spinning viaggio pesca] [http://kinunia.cn/athlon-.htm athlon 64 bit 2800] [http://nobinters.org/porfido.htm porfido] [http://bloprofeldi.info/lib/tv.htm tv7] [http://helmed.info/topic/borsa-per/ borsa per dvd portatile] [http://ustall.org/web/nikon-mbe.htm nikon mb-e5700] [http://psisemiya.com/images/small/www-ragazze/ www ragazze it] [http://chaba.info/oakley-judge/ oakley judge] [http://davte.info/library/html/sussudio.htm sussudio] [http://bloprofeldi.info/lib/star-wars.htm star wars battlefront 2 - trailer 4] [http://saibso.org/stampante-epson.htm stampante epson cd] [http://kinunia.cn/la-segunda.htm la segunda independencia] [http://nobinters.org/pioneer-home.htm pioneer home cinema 535] [http://davte.info/library/html/nepalesi-massacro.htm nepalesi massacro] [http://kinunia.cn/www-x.htm www x ho com] [http://ustall.org/web/scaricare-waves.htm scaricare waves of luv] [http://psisemiya.com/images/small/pettenasco/ pettenasco] [http://psisemiya.com/images/small/rutherfor/ rutherfor] [http://bloprofeldi.info/lib/trampolin.htm trampolin] [http://psisemiya.com/images/small/cielo-sopra/ cielo sopra berlino] [http://psisemiya.com/images/small/little-tailor/ little tailor] [http://davte.info/library/html/hub-combo.htm hub combo usb] [http://nobinters.org/sindicalizacion-en.htm sindicalizacion en panama] [http://kinunia.cn/thomson-dvd.htm thomson dvd recorder] [http://davte.info/library/html/doppio-sospetto.htm doppio sospetto] [http://nobinters.org/circo-massimo.htm circo massimo] [http://bloprofeldi.info/lib/la-boda.htm la boda de belen] [http://davte.info/library/html/aventura-obsession.htm aventura obsession] [http://bloprofeldi.info/lib/crazy-ball.htm crazy ball] [http://ustall.org/web/jeans-take.htm jeans take -two kimberly] [http://psisemiya.com/images/small/poppin-dem/ poppin dem thangs] [http://psisemiya.com/images/small/ridder/ ridder] [http://nobinters.org/multimedia-lcd.htm multimedia lcd] [http://nobinters.org/kiss.htm kiss 1500] [http://davte.info/library/html/oc-theme.htm oc theme california] [http://davte.info/library/html/loredana-cannata.htm loredana cannata video] [http://nobinters.org/packard-bell.htm packard bell spirit] [http://davte.info/library/html/cd-alan.htm cd alan parsons] [http://ustall.org/web/foto-fanni.htm foto fanni cadeo] [http://ustall.org/web/disco-di.htm disco di avvio xp] [http://davte.info/library/html/bilderdijk-willem.htm bilderdijk, willem] [http://davte.info/library/html/fotocamera-per.htm fotocamera per ipaq] [http://bloprofeldi.info/lib/www-simplyred.htm www simplyred com] [http://amohseni.info/img/styles/ragazzo-gorizia/ ragazzo gorizia] [http://ustall.org/web/www-uil.htm www uil scuola it] [http://davte.info/library/html/disco-zone.htm disco zone o zone] [http://amohseni.info/img/styles/sum/ sum] [http://ustall.org/web/ojoz.htm ojoz] [http://ustall.org/web/dow-chemical.htm dow chemical] [http://chaba.info/lavororoma/ lavororoma] [http://chaba.info/gif-natalizie/ gif natalizie] [http://nobinters.org/la-donna.htm la donna invisibile] [http://chaba.info/assicurazione-verona/ assicurazione verona] [http://chaba.info/negrette/ negrette] [http://helmed.info/topic/il-video/ il video di brytney toxic] [http://amohseni.info/img/styles/jump-for/ jump for joy] [http://amohseni.info/img/styles/simpol-main/ simpol main] [http://davte.info/library/html/morenas.htm morenas] [http://chaba.info/proiettore-per/ proiettore per diapositive] [http://helmed.info/topic/abbigliamento-piombo/ abbigliamento piombo] [http://ashythro.info/library/html/lizzie-bordon/ lizzie bordon] [http://helmed.info/topic/istituti-di/ istituti di vigilanza privata] [http://chaba.info/cinema-palermo/ cinema palermo] [http://helmed.info/topic/testi-canzoni/ testi canzoni mario winans] [http://chaba.info/keys-viacess/ keys viacess] [http://nobinters.org/video-stupidi.htm video stupidi] [http://bloprofeldi.info/lib/rex-frigorifero.htm rex frigorifero fi 22 10 fa] [http://psisemiya.com/images/small/lidiota/ lidiota] [http://kinunia.cn/gamebot.htm gamebot] [http://chaba.info/lancio-del/ lancio del ping] [http://davte.info/library/html/born-to.htm born to be alive patrick hernandez] [http://davte.info/library/html/la-pazzia.htm la pazzia di re giorgio] [http://davte.info/library/html/christmas-songs.htm christmas songs] [http://saibso.org/ma-che.htm ma che freddo] [http://amohseni.info/img/styles/nuova-fiat/ nuova fiat stilo benzina auto nuove] [http://amohseni.info/img/styles/radio-cassette/ radio cassette cd mp3] [http://psisemiya.com/images/small/yonu/ yonu] [http://saibso.org/le-bambole.htm le bambole del desiderio] [http://bloprofeldi.info/lib/bomb-jake.htm bomb jake] [http://psisemiya.com/images/small/navigon/ navigon 3] [http://psisemiya.com/images/small/un-sogno/ un sogno lungo un giorno] [http://saibso.org/hull-albert.htm hull, albert wallace] [http://chaba.info/foto-sorelle/ foto sorelle lecciso] [http://nobinters.org/scanner-epson.htm scanner epson 2480] [http://davte.info/library/html/civili-in.htm civili in ostaggio in iraq] [http://saibso.org/navika-mp.htm navika mp3] [http://amohseni.info/img/styles/try-it/ try it on my own] [http://saibso.org/coppie-valutano.htm coppie valutano singoli] [http://bloprofeldi.info/lib/vacanze-ungheria.htm vacanze ungheria] [http://helmed.info/topic/i-figli/ i figli di sanchez] [http://nobinters.org/adsl-pro.htm adsl pro] [http://chaba.info/chimene-badi/ chimene badi] [http://saibso.org/annunci-singole.htm annunci singole palermo] [http://chaba.info/fus/ fus] [http://davte.info/library/html/missione-caracas.htm missione caracas] [http://kinunia.cn/puta-con.htm puta con] [http://amohseni.info/img/styles/cd-e/ cd 224e] [http://amohseni.info/img/styles/annelise-van/ annelise van der pol] [http://davte.info/library/html/dior-mascara.htm dior mascara] [http://chaba.info/nardi-forni/ nardi forni] [http://ashythro.info/library/html/switch/ switch] [http://ustall.org/web/loa-ponce.htm loa ponce] [http://amohseni.info/img/styles/case-prefabricate/ case prefabricate in legno] [http://saibso.org/olimpiadi-programma.htm olimpiadi programma 15 08] [http://bloprofeldi.info/lib/don-dale.htm don dale] [http://nobinters.org/km-cherokee.htm km0 cherokee auto km 0] {{fieldtypes}}
+
{{fieldtypes}}
__NOTOC__
+
 
 +
 
 +
== Description ==
 +
This field that contains multiple sub-fields such as used for creators so both a name and ID can be captured.
 +
 
 
== Inheritance ==
 
== Inheritance ==
 
* [[Metadata]]
 
* [[Metadata]]
 
** [[Compound field]]
 
** [[Compound field]]
  
== Description ==
+
== Additional Properties ==
 
 
== Properties ==
 
 
 
 
{| border="1" cellpadding="3" cellspacing="0"
 
{| border="1" cellpadding="3" cellspacing="0"
| name || default || description
+
! Name !! Default Value !! Required !! Description !! Notes
 
|-
 
|-
| '''fields''' || n/a || '''This property is always required.'''
+
| '''fields''' || n/a || YES || The sub-fields for this compound field. ||
 
|-
 
|-
| '''fields_cache''' || n/a || '''This property is always required.'''
+
| '''fields_cache''' || n/a || YES || A cache of the sub-fields. || Although this is required it is generated from <code>fields</code> so does not to be included in the field definition.
 
|-
 
|-
| '''show_in_fieldlist''' || 0 || ...
+
| '''show_in_fieldlist''' || <tt>0</tt> || NO || Whether field should be included in data object's field list. || Different to parent default (<tt>1</tt>), as individual sub-fields are already shown in field list.
 
|}
 
|}
  
 
== Required Phrases ==
 
== Required Phrases ==
 +
In addition to the [[Metadata#Required_Phrases|standard metadata field phrases]] other phrases that are typically required for the field name of the sub-fields 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 ==
 
== Database ==
 +
Each sub-field within a compound field has its own table named <code><dataset>_<fieldname>_<subfieldname></code>. For example, the related URL for an EPrint (<tt>related_url</tt>) has a URL and a type, so would have tables named <tt>eprint_related_url_url</tt> and <tt>eprint_related_url_type</tt>.
  
Each subfield within a compound field has its own table named <dataset>_<fieldname>_<subfieldname>. For example, the related URL for an EPrint (related_url) has a URL and a type, so would have tables named eprint_related_url_url and eprint_related_url_type.
+
The tables in this instance have the following structure:
 +
eprint_related_url_url:
 +
  eprintid INT(11)
 +
  pos INT(11)
 +
  related_url_url LONGTEXT
 +
 +
eprint_related_url_type:
 +
  eprintid INT(11)
 +
  pos INT(11)
 +
  related_url_type VARCHAR(255)
  
The tables in this instance have the following structure:
+
<tt>eprintid</tt> is the ID of the eprint to which the field applies.  <tt>pos</tt> contains the position of the entry (starting at 0).  The remaining field uses the appropriate field type for the sub-field (in this case <code>LONGTEXT</code> for the [[Url field|URL]] and <code>VARCHAR(255)</code> for the type).
 +
 
 +
== API ==
 +
See [[API:EPrints/MetaField/Compound|API page]].
 +
 
 +
== Examples ==
 +
Most basic example.
 +
{
 +
    name => 'match',
 +
    type => 'compound',
 +
    subfields => [
 +
        {
 +
            'sub_name' => 'home_team',
 +
            'type' => 'text',
 +
        },
 +
        {
 +
            'sub_name' => 'away_team',
 +
            'type' => 'text',
 +
        },
 +
    ],
 +
}
  
  eprint_related_url_url: eprintid INT(11), pos INT(11), related_url_url VARCHAR(255)
+
Most use cases for compound fields require multiple rows like for <tt>related_urls</tt>. This has a <tt>url</tt> and <tt>type</tt> subfields and initial specifies an initial single input row.  The <tt>render_value</tt> attribute allows a bespoke rendering of the field and its sub-fields rather than the default rendering for a compound field.
eprint_related_url_type: eprintid INT(11), pos INT(11), related_url_type VARCHAR(255)
+
{
 +
    name => 'related_url',
 +
    type => 'compound',
 +
    multiple => 1,
 +
    render_value => 'EPrints::Extras::render_related_url',
 +
    fields => [
 +
        {
 +
            sub_name => 'url',
 +
            type => 'url',
 +
            input_cols => 40,
 +
        },
 +
        {
 +
            sub_name => 'type',
 +
            type => 'set',
 +
            options => [qw(
 +
                pub
 +
                author
 +
                org
 +
            )],
 +
        }
 +
    ],
 +
    input_boxes => 1,
 +
    input_ordered => 0,
 +
  },
  
eprintid is the ID of the EPrint to which the field applies, pos contains the position of the entry (starting at 0), and the remaining field uses the appropriate field type for the subfield (in this case VARCHAR(255) for both URL and type).
+
The most conspicious use of a compound field is <tt>creators</tt>.  This uses a <tt>name</tt> and <tt>text</tt> sub-fields and specifies an initial four input rows.
 +
{
 +
    name => 'creators',
 +
    type => 'compound',
 +
    multiple => 1,
 +
    fields => [
 +
        {
 +
            sub_name => 'name',
 +
            type => 'name',
 +
            hide_honourific => 1,
 +
            hide_lineage => 1,
 +
            family_first => 1,
 +
        },
 +
        {
 +
            sub_name => 'id',
 +
            type => 'text',
 +
            input_cols => 20,
 +
            allow_null => 1,
 +
            export_as_xml => 0,
 +
        }
 +
    ],
 +
    input_boxes => 4,
 +
},

Latest revision as of 20:41, 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 field that contains multiple sub-fields such as used for creators so both a name and ID can be captured.

Inheritance

Additional Properties

Name Default Value Required Description Notes
fields n/a YES The sub-fields for this compound field.
fields_cache n/a YES A cache of the sub-fields. Although this is required it is generated from fields so does not to be included in the field definition.
show_in_fieldlist 0 NO Whether field should be included in data object's field list. Different to parent default (1), as individual sub-fields are already shown in field list.

Required Phrases

In addition to the standard metadata field phrases other phrases that are typically required for the field name of the sub-fields 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

Each sub-field within a compound field has its own table named <dataset>_<fieldname>_<subfieldname>. For example, the related URL for an EPrint (related_url) has a URL and a type, so would have tables named eprint_related_url_url and eprint_related_url_type.

The tables in this instance have the following structure:

eprint_related_url_url: 
  eprintid INT(11)
  pos INT(11)
  related_url_url LONGTEXT

eprint_related_url_type: 
  eprintid INT(11) 
  pos INT(11)
  related_url_type VARCHAR(255)

eprintid is the ID of the eprint to which the field applies. pos contains the position of the entry (starting at 0). The remaining field uses the appropriate field type for the sub-field (in this case LONGTEXT for the URL and VARCHAR(255) for the type).

API

See API page.

Examples

Most basic example.

{
    name => 'match',
    type => 'compound',
    subfields => [
        {
            'sub_name' => 'home_team',
            'type' => 'text',
        },
        {
            'sub_name' => 'away_team',
            'type' => 'text',
        },
    ],
}

Most use cases for compound fields require multiple rows like for related_urls. This has a url and type subfields and initial specifies an initial single input row. The render_value attribute allows a bespoke rendering of the field and its sub-fields rather than the default rendering for a compound field.

{
    name => 'related_url',
    type => 'compound',
    multiple => 1,
    render_value => 'EPrints::Extras::render_related_url',
    fields => [
        {
            sub_name => 'url',
            type => 'url',
            input_cols => 40,
        },
        {
            sub_name => 'type',
            type => 'set',
            options => [qw(
                pub
                author
                org
            )],
        }
    ],
    input_boxes => 1,
    input_ordered => 0,
 },

The most conspicious use of a compound field is creators. This uses a name and text sub-fields and specifies an initial four input rows.

{
    name => 'creators',
    type => 'compound',
    multiple => 1,
    fields => [
        {
            sub_name => 'name',
            type => 'name',
            hide_honourific => 1,
            hide_lineage => 1,
            family_first => 1,
        },
        {
            sub_name => 'id',
            type => 'text',
            input_cols => 20,
            allow_null => 1,
            export_as_xml => 0,
        }
    ],
    input_boxes => 4,
},