Difference between revisions of "API:EPrints/MetaField"
Line 1: | Line 1: | ||
<!-- Pod2Wiki=_preamble_ | <!-- Pod2Wiki=_preamble_ | ||
This page has been automatically generated from the EPrints 3.2 source. Any wiki changes made between the 'Pod2Wiki=*' and 'Edit below this comment' comments will be lost. | This page has been automatically generated from the EPrints 3.2 source. Any wiki changes made between the 'Pod2Wiki=*' and 'Edit below this comment' comments will be lost. | ||
− | --> | + | -->{{API}}{{Pod2Wiki}}{{API:Source|file=EPrints/MetaField.pm|package_name=EPrints::MetaField}}[[Category:API|MetaField]]<div><!-- Edit below this comment --> |
− | |||
− | {{API}}{{Pod2Wiki}}{{API:Source|file=EPrints/MetaField.pm|package_name=EPrints::MetaField}}[[Category:API|MetaField]]<div><!-- Edit below this comment --> | ||
− | <!-- Pod2Wiki= | + | <!-- Pod2Wiki=_private_ --><!-- Pod2Wiki=head_name --> |
==NAME== | ==NAME== | ||
'''EPrints::MetaField''' - A single metadata field. | '''EPrints::MetaField''' - A single metadata field. | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
− | + | <span style='display:none'>User Comments</span> | |
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
− | <!-- Pod2Wiki= | + | <!-- Pod2Wiki= --> |
+ | </div> | ||
+ | <!-- Pod2Wiki=head_description --> | ||
==DESCRIPTION== | ==DESCRIPTION== | ||
Theis object represents a single metadata field, not the value of that field. A field belongs (usually) to a dataset and has a large number of properties. Optional and required properties vary between types. | Theis object represents a single metadata field, not the value of that field. A field belongs (usually) to a dataset and has a large number of properties. Optional and required properties vary between types. | ||
Line 24: | Line 24: | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
− | + | <span style='display:none'>User Comments</span> | |
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
− | <!-- Pod2Wiki= | + | <!-- Pod2Wiki= --> |
+ | </div> | ||
+ | <!-- Pod2Wiki=item_new --> | ||
===$field = EPrints::MetaField->new( %properties )=== | ===$field = EPrints::MetaField->new( %properties )=== | ||
Line 36: | Line 38: | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
− | + | <span style='display:none'>User Comments</span> | |
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
− | <!-- Pod2Wiki= | + | <!-- Pod2Wiki= --> |
+ | </div> | ||
+ | <!-- Pod2Wiki=item_final --> | ||
===$field->final=== | ===$field->final=== | ||
Line 46: | Line 50: | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
− | + | <span style='display:none'>User Comments</span> | |
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
− | <!-- Pod2Wiki= | + | <!-- Pod2Wiki= --> |
+ | </div> | ||
+ | <!-- Pod2Wiki=item_set_property --> | ||
===$field->set_property( $property, $value )=== | ===$field->set_property( $property, $value )=== | ||
Line 62: | Line 68: | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
− | + | <span style='display:none'>User Comments</span> | |
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
− | <!-- Pod2Wiki= | + | <!-- Pod2Wiki= --> |
+ | </div> | ||
+ | <!-- Pod2Wiki=item_clone --> | ||
===$newfield = $field->clone=== | ===$newfield = $field->clone=== | ||
Line 72: | Line 80: | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
− | + | <span style='display:none'>User Comments</span> | |
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
− | <!-- Pod2Wiki= | + | <!-- Pod2Wiki= --> |
+ | </div> | ||
+ | <!-- Pod2Wiki=item_repository --> | ||
===$repository = $field->repository=== | ===$repository = $field->repository=== | ||
Line 82: | Line 92: | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
− | + | <span style='display:none'>User Comments</span> | |
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
− | <!-- Pod2Wiki= | + | <!-- Pod2Wiki= --> |
+ | </div> | ||
+ | <!-- Pod2Wiki=item_dataset --> | ||
===$dataset = $field->dataset=== | ===$dataset = $field->dataset=== | ||
Line 92: | Line 104: | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
− | + | <span style='display:none'>User Comments</span> | |
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
− | <!-- Pod2Wiki= | + | <!-- Pod2Wiki= --> |
+ | </div> | ||
+ | <!-- Pod2Wiki=item_render_name --> | ||
===$xhtml = $field->render_name=== | ===$xhtml = $field->render_name=== | ||
Line 102: | Line 116: | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
− | + | <span style='display:none'>User Comments</span> | |
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
− | <!-- Pod2Wiki= | + | <!-- Pod2Wiki= --> |
+ | </div> | ||
+ | <!-- Pod2Wiki=item_display_name --> | ||
===$label = $field->display_name( $session )=== | ===$label = $field->display_name( $session )=== | ||
Line 114: | Line 130: | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
− | + | <span style='display:none'>User Comments</span> | |
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
− | <!-- Pod2Wiki= | + | <!-- Pod2Wiki= --> |
+ | </div> | ||
+ | <!-- Pod2Wiki=item_render_help --> | ||
===$xhtml = $field->render_help=== | ===$xhtml = $field->render_help=== | ||
Line 124: | Line 142: | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
− | + | <span style='display:none'>User Comments</span> | |
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
− | <!-- Pod2Wiki= | + | <!-- Pod2Wiki= --> |
+ | </div> | ||
+ | <!-- Pod2Wiki=item_render_input_field --> | ||
===$xhtml = $field->render_input_field( $session, $value, [$dataset], [$staff], [$hidden_fields], $obj, [$basename] )=== | ===$xhtml = $field->render_input_field( $session, $value, [$dataset], [$staff], [$hidden_fields], $obj, [$basename] )=== | ||
Line 136: | Line 156: | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
− | + | <span style='display:none'>User Comments</span> | |
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
− | <!-- Pod2Wiki= | + | <!-- Pod2Wiki= --> |
+ | </div> | ||
+ | <!-- Pod2Wiki=item_form_value --> | ||
===$value = $field->form_value( $session, $object, [$prefix] )=== | ===$value = $field->form_value( $session, $object, [$prefix] )=== | ||
Line 146: | Line 168: | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
− | + | <span style='display:none'>User Comments</span> | |
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
− | <!-- Pod2Wiki= | + | <!-- Pod2Wiki= --> |
+ | </div> | ||
+ | <!-- Pod2Wiki=item_name --> | ||
===$name = $field->name=== | ===$name = $field->name=== | ||
Line 156: | Line 180: | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
− | + | <span style='display:none'>User Comments</span> | |
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
− | <!-- Pod2Wiki= | + | <!-- Pod2Wiki= --> |
+ | </div> | ||
+ | <!-- Pod2Wiki=item_type --> | ||
===$type = $field->type=== | ===$type = $field->type=== | ||
Line 166: | Line 192: | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
− | + | <span style='display:none'>User Comments</span> | |
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
− | <!-- Pod2Wiki= | + | <!-- Pod2Wiki= --> |
+ | </div> | ||
+ | <!-- Pod2Wiki=item_property --> | ||
===$value = $field->property( $property )=== | ===$value = $field->property( $property )=== | ||
Line 178: | Line 206: | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
− | + | <span style='display:none'>User Comments</span> | |
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
− | <!-- Pod2Wiki= | + | <!-- Pod2Wiki= --> |
+ | </div> | ||
+ | <!-- Pod2Wiki=item_is_type --> | ||
===$boolean = $field->is_type( @typenames )=== | ===$boolean = $field->is_type( @typenames )=== | ||
Line 188: | Line 218: | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
− | + | <span style='display:none'>User Comments</span> | |
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
− | <!-- Pod2Wiki= | + | <!-- Pod2Wiki= --> |
+ | </div> | ||
+ | <!-- Pod2Wiki=item_render_value --> | ||
===$xhtml = $field->render_value( $session, $value, [$alllangs], [$nolink], $object )=== | ===$xhtml = $field->render_value( $session, $value, [$alllangs], [$nolink], $object )=== | ||
Line 200: | Line 232: | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
− | + | <span style='display:none'>User Comments</span> | |
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
− | <!-- Pod2Wiki= | + | <!-- Pod2Wiki= --> |
+ | </div> | ||
+ | <!-- Pod2Wiki=item_render_value_no_multiple --> | ||
===$xhtml = $field->render_value_no_multiple( $session, $value, $alllangs, $nolink, $object )=== | ===$xhtml = $field->render_value_no_multiple( $session, $value, $alllangs, $nolink, $object )=== | ||
Line 212: | Line 246: | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
− | + | <span style='display:none'>User Comments</span> | |
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
− | <!-- Pod2Wiki= | + | <!-- Pod2Wiki= --> |
+ | </div> | ||
+ | <!-- Pod2Wiki=item_render_value_withopts --> | ||
===$xhtml = $field->render_value_withopts( $session, $value, $nolink, $object )=== | ===$xhtml = $field->render_value_withopts( $session, $value, $nolink, $object )=== | ||
Line 226: | Line 262: | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
− | + | <span style='display:none'>User Comments</span> | |
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
− | <!-- Pod2Wiki= | + | <!-- Pod2Wiki= --> |
+ | </div> | ||
+ | <!-- Pod2Wiki=item_sort_values --> | ||
===$out_list = $field->sort_values( $session, $in_list )=== | ===$out_list = $field->sort_values( $session, $in_list )=== | ||
Line 236: | Line 274: | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
− | + | <span style='display:none'>User Comments</span> | |
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
− | <!-- Pod2Wiki= | + | <!-- Pod2Wiki= --> |
+ | </div> | ||
+ | <!-- Pod2Wiki=item_list_values --> | ||
===@values = $field->list_values( $value )=== | ===@values = $field->list_values( $value )=== | ||
Line 251: | Line 291: | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
− | + | <span style='display:none'>User Comments</span> | |
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
− | <!-- Pod2Wiki= | + | <!-- Pod2Wiki= --> |
+ | </div> | ||
+ | <!-- Pod2Wiki=item_most_local --> | ||
===$value = $field->most_local( $session, $value )=== | ===$value = $field->most_local( $session, $value )=== | ||
Line 261: | Line 303: | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
− | + | <span style='display:none'>User Comments</span> | |
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
− | <!-- Pod2Wiki= | + | <!-- Pod2Wiki= --> |
+ | </div> | ||
+ | <!-- Pod2Wiki=item_call_property --> | ||
===$value2 = $field->call_property( $property, @args )=== | ===$value2 = $field->call_property( $property, @args )=== | ||
Line 273: | Line 317: | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
− | + | <span style='display:none'>User Comments</span> | |
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
− | <!-- Pod2Wiki= | + | <!-- Pod2Wiki= --> |
+ | </div> | ||
+ | <!-- Pod2Wiki=item_value_from_sql_row --> | ||
===$val = $field->value_from_sql_row( $session, $row )=== | ===$val = $field->value_from_sql_row( $session, $row )=== | ||
Line 283: | Line 329: | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
− | + | <span style='display:none'>User Comments</span> | |
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
− | <!-- Pod2Wiki= | + | <!-- Pod2Wiki= --> |
+ | </div> | ||
+ | <!-- Pod2Wiki=item_sql_row_from_value --> | ||
===@row = $field->sql_row_from_value( $session, $value )=== | ===@row = $field->sql_row_from_value( $session, $value )=== | ||
Line 303: | Line 351: | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
− | + | <span style='display:none'>User Comments</span> | |
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
− | <!-- Pod2Wiki= | + | <!-- Pod2Wiki= --> |
+ | </div> | ||
+ | <!-- Pod2Wiki=item_get_sql_properties --> | ||
===%opts = $field->get_sql_properties( $session )=== | ===%opts = $field->get_sql_properties( $session )=== | ||
Line 313: | Line 363: | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
− | + | <span style='display:none'>User Comments</span> | |
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
− | <!-- Pod2Wiki= | + | <!-- Pod2Wiki= --> |
+ | </div> | ||
+ | <!-- Pod2Wiki=item_get_sql_type --> | ||
===@types = $field->get_sql_type( $session )=== | ===@types = $field->get_sql_type( $session )=== | ||
Line 323: | Line 375: | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
− | + | <span style='display:none'>User Comments</span> | |
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
− | <!-- Pod2Wiki= | + | <!-- Pod2Wiki= --> |
+ | </div> | ||
+ | <!-- Pod2Wiki=item_create_ordervalues_field --> | ||
===$field = $field->create_ordervalues_field( $session [, $langid ] )=== | ===$field = $field->create_ordervalues_field( $session [, $langid ] )=== | ||
Line 333: | Line 387: | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
− | + | <span style='display:none'>User Comments</span> | |
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
− | <!-- Pod2Wiki= | + | <!-- Pod2Wiki= --> |
+ | </div> | ||
+ | <!-- Pod2Wiki=item_get_sql_index --> | ||
===$sql = $field->get_sql_index=== | ===$sql = $field->get_sql_index=== | ||
Line 343: | Line 399: | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
− | + | <span style='display:none'>User Comments</span> | |
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
− | <!-- Pod2Wiki= | + | <!-- Pod2Wiki= --> |
+ | </div> | ||
+ | <!-- Pod2Wiki=item_render_single_value --> | ||
===$xhtml_dom = $field->render_single_value( $session, $value )=== | ===$xhtml_dom = $field->render_single_value( $session, $value )=== | ||
Line 353: | Line 411: | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
− | + | <span style='display:none'>User Comments</span> | |
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
− | <!-- Pod2Wiki= | + | <!-- Pod2Wiki= --> |
+ | </div> | ||
+ | <!-- Pod2Wiki=item_render_input_field_actual --> | ||
===$xhtml = $field->render_input_field_actual( $session, $value, [$dataset], [$staff], [$hidden_fields], [$obj], [$basename] )=== | ===$xhtml = $field->render_input_field_actual( $session, $value, [$dataset], [$staff], [$hidden_fields], [$obj], [$basename] )=== | ||
Line 367: | Line 427: | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
− | + | <span style='display:none'>User Comments</span> | |
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
− | <!-- Pod2Wiki= | + | <!-- Pod2Wiki= --> |
+ | </div> | ||
+ | <!-- Pod2Wiki=item_get_sql_names --> | ||
===@sqlnames = $field->get_sql_names=== | ===@sqlnames = $field->get_sql_names=== | ||
Line 377: | Line 439: | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
− | + | <span style='display:none'>User Comments</span> | |
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
− | <!-- Pod2Wiki= | + | <!-- Pod2Wiki= --> |
+ | </div> | ||
+ | <!-- Pod2Wiki=item_is_browsable --> | ||
===$boolean = $field->is_browsable=== | ===$boolean = $field->is_browsable=== | ||
Line 387: | Line 451: | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
− | + | <span style='display:none'>User Comments</span> | |
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
− | <!-- Pod2Wiki= | + | <!-- Pod2Wiki= --> |
+ | </div> | ||
+ | <!-- Pod2Wiki=item_all_values --> | ||
===$values = $field->all_values( %opts )=== | ===$values = $field->all_values( %opts )=== | ||
Line 399: | Line 465: | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
− | + | <span style='display:none'>User Comments</span> | |
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
− | <!-- Pod2Wiki= | + | <!-- Pod2Wiki= --> |
+ | </div> | ||
+ | <!-- Pod2Wiki=item_get_id_from_value --> | ||
===$id = $field->get_id_from_value( $session, $value )=== | ===$id = $field->get_id_from_value( $session, $value )=== | ||
Line 409: | Line 477: | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
− | + | <span style='display:none'>User Comments</span> | |
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
− | <!-- Pod2Wiki= | + | <!-- Pod2Wiki= --> |
+ | </div> | ||
+ | <!-- Pod2Wiki=item_get_value_from_id --> | ||
===$value = $field->get_value_from_id( $session, $id )=== | ===$value = $field->get_value_from_id( $session, $id )=== | ||
Line 419: | Line 489: | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
− | + | <span style='display:none'>User Comments</span> | |
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
− | <!-- Pod2Wiki= | + | <!-- Pod2Wiki= --> |
+ | </div> | ||
+ | <!-- Pod2Wiki=item_render_value_label --> | ||
===$xhtml = $field->render_value_label( $value )=== | ===$xhtml = $field->render_value_label( $value )=== | ||
Line 429: | Line 501: | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
− | + | <span style='display:none'>User Comments</span> | |
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
− | <!-- Pod2Wiki= | + | <!-- Pod2Wiki= --> |
+ | </div> | ||
+ | <!-- Pod2Wiki=item_ordervalue --> | ||
===$ov = $field->ordervalue( $value, $session, $langid, $dataset )=== | ===$ov = $field->ordervalue( $value, $session, $langid, $dataset )=== | ||
Line 439: | Line 513: | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
− | + | <span style='display:none'>User Comments</span> | |
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
− | <!-- Pod2Wiki= | + | <!-- Pod2Wiki= --> |
+ | </div> | ||
+ | <!-- Pod2Wiki=item_xml_to_epdata --> | ||
===$epdata = $field->xml_to_epdata( $session, $xml, %opts )=== | ===$epdata = $field->xml_to_epdata( $session, $xml, %opts )=== | ||
Line 449: | Line 525: | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
− | + | <span style='display:none'>User Comments</span> | |
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
− | <!-- Pod2Wiki= | + | <!-- Pod2Wiki= --> |
+ | </div> | ||
+ | <!-- Pod2Wiki=item_get_default_value --> | ||
===$value = $field->get_default_value( $session )=== | ===$value = $field->get_default_value( $session )=== | ||
Line 461: | Line 539: | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
− | + | <span style='display:none'>User Comments</span> | |
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
− | <!-- Pod2Wiki= | + | <!-- Pod2Wiki= --> |
+ | </div> | ||
+ | <!-- Pod2Wiki=item_get_index_codes --> | ||
===( $terms, $grep_terms, $ignored ) = $field->get_index_codes( $session, $value )=== | ===( $terms, $grep_terms, $ignored ) = $field->get_index_codes( $session, $value )=== | ||
Line 471: | Line 551: | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
− | + | <span style='display:none'>User Comments</span> | |
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
− | <!-- Pod2Wiki= | + | <!-- Pod2Wiki= --> |
+ | </div> | ||
+ | <!-- Pod2Wiki=item_split_search_value --> | ||
===@terms = $field->split_search_value( $session, $value )=== | ===@terms = $field->split_search_value( $session, $value )=== | ||
Line 481: | Line 563: | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
− | + | <span style='display:none'>User Comments</span> | |
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
− | <!-- Pod2Wiki= | + | <!-- Pod2Wiki= --> |
+ | </div> | ||
+ | <!-- Pod2Wiki=item_get_search_conditions --> | ||
===$cond = $field->get_search_conditions( $session, $dataset, $value, $match, $merge, $mode )=== | ===$cond = $field->get_search_conditions( $session, $dataset, $value, $match, $merge, $mode )=== | ||
Line 491: | Line 575: | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
− | + | <span style='display:none'>User Comments</span> | |
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
− | <!-- Pod2Wiki= | + | <!-- Pod2Wiki= --> |
+ | </div> | ||
+ | <!-- Pod2Wiki=item_get_search_conditions_not_ex --> | ||
===$cond = $field->get_search_conditions_not_ex( $session, $dataset, $value, $match, $merge, $mode )=== | ===$cond = $field->get_search_conditions_not_ex( $session, $dataset, $value, $match, $merge, $mode )=== | ||
Line 501: | Line 587: | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
− | + | <span style='display:none'>User Comments</span> | |
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
+ | <!-- Pod2Wiki= --> | ||
+ | </div> | ||
<!-- Pod2Wiki=_postamble_ --><!-- Edit below this comment --> | <!-- Pod2Wiki=_postamble_ --><!-- Edit below this comment --> |
Revision as of 14:56, 25 February 2010
EPrints 3 Reference: Directory Structure - Metadata Fields - Repository Configuration - XML Config Files - XML Export Format - EPrints data structure - Core API - Data Objects
Latest Source Code (3.4, 3.3) | Revision Log | Before editing this page please read Pod2Wiki
Contents
- 1 NAME
- 2 DESCRIPTION
- 2.1 $field = EPrints::MetaField->new( %properties )
- 2.2 $field->final
- 2.3 $field->set_property( $property, $value )
- 2.4 $newfield = $field->clone
- 2.5 $repository = $field->repository
- 2.6 $dataset = $field->dataset
- 2.7 $xhtml = $field->render_name
- 2.8 $label = $field->display_name( $session )
- 2.9 $xhtml = $field->render_help
- 2.10 $xhtml = $field->render_input_field( $session, $value, [$dataset], [$staff], [$hidden_fields], $obj, [$basename] )
- 2.11 $value = $field->form_value( $session, $object, [$prefix] )
- 2.12 $name = $field->name
- 2.13 $type = $field->type
- 2.14 $value = $field->property( $property )
- 2.15 $boolean = $field->is_type( @typenames )
- 2.16 $xhtml = $field->render_value( $session, $value, [$alllangs], [$nolink], $object )
- 2.17 $xhtml = $field->render_value_no_multiple( $session, $value, $alllangs, $nolink, $object )
- 2.18 $xhtml = $field->render_value_withopts( $session, $value, $nolink, $object )
- 2.19 $out_list = $field->sort_values( $session, $in_list )
- 2.20 @values = $field->list_values( $value )
- 2.21 $value = $field->most_local( $session, $value )
- 2.22 $value2 = $field->call_property( $property, @args )
- 2.23 $val = $field->value_from_sql_row( $session, $row )
- 2.24 @row = $field->sql_row_from_value( $session, $value )
- 2.25 %opts = $field->get_sql_properties( $session )
- 2.26 @types = $field->get_sql_type( $session )
- 2.27 $field = $field->create_ordervalues_field( $session [, $langid ] )
- 2.28 $sql = $field->get_sql_index
- 2.29 $xhtml_dom = $field->render_single_value( $session, $value )
- 2.30 $xhtml = $field->render_input_field_actual( $session, $value, [$dataset], [$staff], [$hidden_fields], [$obj], [$basename] )
- 2.31 @sqlnames = $field->get_sql_names
- 2.32 $boolean = $field->is_browsable
- 2.33 $values = $field->all_values( %opts )
- 2.34 $id = $field->get_id_from_value( $session, $value )
- 2.35 $value = $field->get_value_from_id( $session, $id )
- 2.36 $xhtml = $field->render_value_label( $value )
- 2.37 $ov = $field->ordervalue( $value, $session, $langid, $dataset )
- 2.38 $epdata = $field->xml_to_epdata( $session, $xml, %opts )
- 2.39 $value = $field->get_default_value( $session )
- 2.40 ( $terms, $grep_terms, $ignored ) = $field->get_index_codes( $session, $value )
- 2.41 @terms = $field->split_search_value( $session, $value )
- 2.42 $cond = $field->get_search_conditions( $session, $dataset, $value, $match, $merge, $mode )
- 2.43 $cond = $field->get_search_conditions_not_ex( $session, $dataset, $value, $match, $merge, $mode )
NAME
EPrints::MetaField - A single metadata field.
DESCRIPTION
Theis object represents a single metadata field, not the value of that field. A field belongs (usually) to a dataset and has a large number of properties. Optional and required properties vary between types.
"type" is the most important property, it is the type of the metadata field. For example: "text", "name" or "date".
A full description of metadata types and properties is in the eprints documentation and will not be duplicated here.
$field = EPrints::MetaField->new( %properties )
Create a new metafield. %properties is a hash of the properties of the field, with the addition of "dataset", or if "dataset" is not set then "confid" and "repository" must be provided instead.
Some field types require certain properties to be explicitly set. See the main documentation.
$field->final
This method tells the metafield that it is now read only. Any call to set_property will produce a abort error.
$field->set_property( $property, $value )
Set the named property to the given value.
This should not be called on metafields unless they've been cloned first.
This method will cause an abort error if the metafield is read only.
In these cases a cloned version of the field should be used.
$newfield = $field->clone
Clone the field, so the clone can be edited without affecting the original. Does not deep copy properties which are references - these should be set to new values, rather than the contents altered. Eg. don't push to a cloned options list, replace it.
$repository = $field->repository
Return the EPrints::Repository to which this field belongs.
$dataset = $field->dataset
Return the EPrints::DataSet to which this field belongs, or undef.
$xhtml = $field->render_name
Render the name of this field as an XHTML object.
$label = $field->display_name( $session )
DEPRECATED! Can't be removed because it's used in 2.2's default ArchiveRenderConfig.pm
Return the UTF-8 encoded name of this field, in the language of the $session.
$xhtml = $field->render_help
Return the help information for a user inputing some data for this field as an XHTML chunk.
Return the XHTML of the fields for an form which will allow a user to input metadata to this field. $value is the default value for this field.
The actual function called may be overridden from the config.
$value = $field->form_value( $session, $object, [$prefix] )
Get a value for this field from the CGI parameters, assuming that the form contained the input fields for this metadata field.
$name = $field->name
Return the name of this field.
$type = $field->type
Return the type of this field.
$value = $field->property( $property )
Return the value of the given property.
Special note about "required" property: It only indicates if the field is always required. You must query the dataset to check if it is required for a specific type.
$boolean = $field->is_type( @typenames )
Return true if the type of this field is one of @typenames.
$xhtml = $field->render_value( $session, $value, [$alllangs], [$nolink], $object )
Render the given value of this given string as XHTML DOM. If $alllangs is true and this is a multilang field then render all language versions, not just the current language (for editorial checking). If $nolink is true then don't make this field a link, for example subject fields might otherwise link to the subject view page.
If render_value or render_single_value properties are set then these control the rendering instead.
$xhtml = $field->render_value_no_multiple( $session, $value, $alllangs, $nolink, $object )
Render the XHTML for a non-multiple value. Can be either a from a non-multiple field, or a single value from a multiple field.
Usually just used internally.
$xhtml = $field->render_value_withopts( $session, $value, $nolink, $object )
Render a single value but adding the render_opts features.
This uses either the field specific render_single_value or, if one is configured, the render_single_value specified in the config.
Usually just used internally.
$out_list = $field->sort_values( $session, $in_list )
Sorts the in_list into order, based on the "order values" of the values in the in_list. Assumes that the values are not a list of multiple values. [ [], [], [] ], but rather a list of single values.
@values = $field->list_values( $value )
Return a list of every distinct value in this field.
- for simple fields: return ( $value ) - for multiple fields: return @{$value}
This function is used by the item_matches method in Search.
$value = $field->most_local( $session, $value )
If this field is a multilang field then return the version of the value most useful for the language of the session. In order of preference: The language of the session, the default language for the repository, any language at all. If it is not a multilang field then just return $value.
$value2 = $field->call_property( $property, @args )
Call the method described by $property. Pass it the arguments and return the result.
The property may contain either a code reference, or the scalar name of a method.
$val = $field->value_from_sql_row( $session, $row )
Shift and return the value of this field from the database input $row.
@row = $field->sql_row_from_value( $session, $value )
Return a list of values to insert into the database based on $value.
The values will normally be passed to DBI/bind_param:
$sth->bind_param( $idx, $row[0] )
If the value is an array ref it gets expanded:
$sth->bind_param( $idx, @{$row[0]} )
This is necessary to support binding LOB data under various databases.
%opts = $field->get_sql_properties( $session )
Map the relevant SQL properties for this field to options passed to EPrints::Database::get_column_type().
@types = $field->get_sql_type( $session )
Return the SQL column types of this field, used for creating tables.
$field = $field->create_ordervalues_field( $session [, $langid ] )
Return a new field object that this field can use to store order values, optionally for language $langid.
$sql = $field->get_sql_index
Return the columns that an index should be created over.
$xhtml_dom = $field->render_single_value( $session, $value )
Returns the XHTML representation of the value. The value will be non-multiple. Just the simple value.
Return the XHTML of the fields for an form which will allow a user to input metadata to this field. $value is the default value for this field.
Unlike render_input_field, this function does not use the render_input property, even if it's set.
The $obj is the current state of the object this field is associated with, if any.
@sqlnames = $field->get_sql_names
Return the names of this field's columns as they appear in a SQL table.
$boolean = $field->is_browsable
Return true if this field can be "browsed". ie. Used as a view.
$values = $field->all_values( %opts )
Return a reference to an array of all the values of this field. For fields like "subject" or "set" it returns all the variations. For fields like "text" return all the distinct values from the database.
Results are sorted according to the ordervalues of the current session.
$id = $field->get_id_from_value( $session, $value )
Returns a unique id for $value or "NULL" if $value is undefined.
$value = $field->get_value_from_id( $session, $id )
Returns the value from $id or undef if $id is "NULL".
$xhtml = $field->render_value_label( $value )
Return an XHTML DOM object describing the given value. Normally this is just the value, but in the case of something like a "set" field this returns the name of the option in the current language.
$ov = $field->ordervalue( $value, $session, $langid, $dataset )
Return a string representing this value which can be used to sort it into order by comparing it alphabetically.
$epdata = $field->xml_to_epdata( $session, $xml, %opts )
Populates $epdata based on $xml.
$value = $field->get_default_value( $session )
Return the default value for this field. This is only applicable to very simple cases such as timestamps, auto-incremented values etc.
Any complex initialisation should be done in the "set_eprint_automatic_fields" callback (or the equivalent for the given object).
( $terms, $grep_terms, $ignored ) = $field->get_index_codes( $session, $value )
Get indexable terms from $value. $terms is a reference to an array of strings to index. $grep_terms is a reference to an array of terms to add to the grep index. $ignored is a reference to an array of terms that should be ignored (e.g. stop words in a free-text field).
@terms = $field->split_search_value( $session, $value )
Split $value into terms that can be used to search against this field.
$cond = $field->get_search_conditions( $session, $dataset, $value, $match, $merge, $mode )
Return a Search::Condition for $value based on this field.
$cond = $field->get_search_conditions_not_ex( $session, $dataset, $value, $match, $merge, $mode )
Return the search condition for a search which is not-exact ($match ne "EX").