API:EPrints/DataObj/MetaField
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
- 3 CORE METADATA FIELDS
- 3.1 metafieldid (counter)
- 3.2 mfdatasetid (set)
- 3.3 name (text)
- 3.4 type (set)
- 3.5 provenance (set)
- 3.6 phrase_name (multilang, multiple)
- 3.7 phrase_help (multilang, multiple)
- 3.8 required (boolean)
- 3.9 multiple (boolean)
- 3.10 allow_null (boolean)
- 3.11 export_as_xml (boolean)
- 3.12 volatile (boolean)
- 3.13 min_resolution (set)
- 3.14 sql_index (boolean)
- 3.15 render_input (text)
- 3.16 render_value (text)
- 3.17 input_ordered (boolean)
- 3.18 maxlength (int)
- 3.19 browse_link (boolean)
- 3.20 top (text)
- 3.21 datasetid (text)
- 3.22 set_name (text)
- 3.23 options (text)
- 3.24 render_order (set)
- 3.25 hide_honourific (boolean)
- 3.26 hide_lineage (boolean)
- 3.27 family_first (boolean)
- 3.28 input_style (set)
- 3.29 input_rows (int)
- 3.30 input_cols (int)
- 3.31 input_boxes (int)
- 3.32 sql_counter (text)
- 3.33 default_value (text)
- 4 REFERENCES AND RELATED OBJECTS
- 5 INSTANCE VARIABLES
- 6 METHODS
- 6.1 Utility Methods
- 6.2 Constructor Methods
- 6.3 Class Methods
- 6.4 Object Methods
- 6.4.1 get_property_defaults
- 6.4.2 dump
- 6.4.3 get_parent_id
- 6.4.4 remove
- 6.4.5 config_path
- 6.4.6 config_filename
- 6.4.7 phrases_filename
- 6.4.8 workflow_filename
- 6.4.9 add_to_phrases
- 6.4.10 remove_from_dataset
- 6.4.11 add_to_database
- 6.4.12 remove_from_database
- 6.4.13 add_to_workflow
- 6.4.14 remove_from_workflow
- 6.4.15 perl_struct
- 6.4.16 make_field_object
- 6.4.17 add_to_repository
- 6.4.18 remove_from_repository
- 6.4.19 validate
- 6.4.20 render_citation
- 7 SEE ALSO
- 8 COPYRIGHT
NAME
EPrints::DataObj::MetaField - metadata fields
DESCRIPTION
This is an internal class that should not be used outside EPrints::Database.
CORE METADATA FIELDS
metafieldid (counter)
The unique identifer for the metafield.
mfdatasetid (set)
The dataset two which this metafield belongs.
name (text)
The name of this metafield.
type (set)
The type of this metafield.
provenance (set)
The provenance of this metafield.
phrase_name (multilang, multiple)
The phrase name(s)(labels) potentially in multiple languages for this metafield.
phrase_help (multilang, multiple)
The phrase help text(s) potentially in multiple languages for this metafield.
required (boolean)
Whether this metafield is required for the dataset.
multiple (boolean)
Whether this metafield can have multiple values for a data object.
allow_null (boolean)
Whether this metafield can have a null value.
export_as_xml (boolean)
Whether this metafield can be exported in XML.
volatile (boolean)
Whether this metafield stores a volatile data.
min_resolution (set)
The minimum time resolution (second, minute, hour, day, month or year) for this metafield if it is a timestamp/datestamp.
sql_index (boolean)
Whether an SQL index should be created for this metafield.
render_input (text)
A different or bespoke function to render the input field for this metafield.
render_value (text)
A different or bespoke function to render the value for this metafield.
input_ordered (boolean)
Whether the input for this metafield is ordered.
maxlength (int)
The maximum length for this metafield if it is a text or subclass of a text field.
browse_link (boolean)
The link to a browse view for this metafield if it is a subject metafield.
top (text)
The top subject in the subject tree that should be used as options for this subject metafield.
datasetid (text)
The dataset ID for this metafield, if it is a search, subobject, dataobjref, fields, itemref or file field.
set_name (text)
The name of the file that contains the options for this namedset metafield.
options (text)
The commas separated list of options for this set metafield.
render_order (set)
The order to render a name if this metafield is for a name.
hide_honourific (boolean)
Whether to hide the honourfic sub-field if this is a name metafield.
hide_lineage (boolean)
Whether to hide the lineage sub-field if this is a name metafield.
family_first (boolean)
Whether to render the family name sub-field before the given name if this is a name metafield.
input_style (set)
A particular style for displaying the input form element for this metafield.
input_rows (int)
The number of input rows for this metafield.
input_cols (int)
The number of input columns for this metafield.
input_boxes (int)
The number of input boxes for this metafield.
sql_counter (text)
The name to give to the sql counter for this counter metafield. Typically the same as the metafield's name.
default_value (text)
The default value for this metafield.
REFERENCES AND RELATED OBJECTS
parent (itemref)
The parent metafield this metafield belongs to, if it is a sub-field.
fields (subobject, multiple)
Sub-fields of this metafield.
INSTANCE VARIABLES
See EPrints::DataObj.
METHODS
Utility Methods
dataset_ids
@ids = EPrints::DataObj::MetaField::dataset_ids( $repo )
Returns array of all dataset IDs for non-virtual datasets in $repo.
render_dataset_id
$dataset_label = EPrints::DataObj::MetaField::render_dataset_id( $repo, $id )
Returns XHTML DOM rendering of phrase for dataset with $id.
options_fromform
$options = EPrints::DataObj::MetaField::options_fromform( $value )
Returns an array reference of options from the comma-separated $value provided.
options_toform
$options_str = EPrints::DataObj::MetaField::options_toform( $value )
Returns a comma-separated string of options from the array reference $value provided.
boolean_fromform
$boolean = EPrints::DataObj::MetaField::boolean_fromform( $value )
Returns true or false, (literally 1 or 0) depending on the $value representation of a boolean in a form.
boolean_toform
$boolean_str = EPrints::DataObj::MetaField::boolean_toform( $value )
Returns a string representation of a boolean ("TRUE", "FALSE" or undef) depending on the to form $value provided.
Constructor Methods
new_from_field
$metafield = EPrints::DataObj::MetaField->new_from_field( $repo, $field, [ $dataset ] )
Returns a new metafield data object based on $field.
$dataset is determined from dataset ID of class (i.e. metafield) if unset.
Class Methods
get_system_field_info
$thing = EPrints::DataObj::MetaField->get_system_field_info
Returns an array describing the system metadata fields of the metafield dataset.
get_dataset_id
$dataset = EPrints::DataObj::MetaField->get_dataset_id
Returns the ID of the EPrints::DataSet object to which this record belongs.
get_parent_dataset_id
$dataset = EPrints::DataObj::MetaField->get_parent_dataset_id
Returns the ID of the EPrints::DataSet object to which this record's parent belongs.
get_defaults
$defaults = EPrints::DataObj::MetaField->get_defaults( $repo, $data, [ $dataset ] )
Returns default values for this object based on the starting $data.
Get $dataset from class if not defined.
Object Methods
get_property_defaults
$defaults = $metafield->get_property_defaults( $repo, $type )
Gets the property defaults for metafield $type.
dump
$str = $metafield->dump
Dump the fields configuration as used in cfg.d.
get_parent_id
$parent = $metafield->get_parent_id
Returns the parent ID for this metafield.
Alias for:
$metafield->value( "parent" );
remove
$ok = $metafield->remove
Remove the field and any sub-fields from the database.
config_path
$path = $metafield->config_path
Returns the root directory of the repository configuration path.
config_filename
$filename = $metafield->config_filename( $dataset )
Returns the location of the cfg.d config file for the provided $dataset.
phrases_filename
$filename = $metafield->phrases_filename( $langid )
Returns the location of the XML phrases file for provided $lang.
workflow_filename
$filename = $metafield->workflow_filename( $dataset )
Returns the location of the workflow file for the provided $dataset.
add_to_phrases
$ok = $metafield->add_to_phrases
Adds the phrases defined by this metafield to the system.
remove_from_dataset
$ok = $metafield->remove_from_dataset
Remove this metafield from the dataset specified by its mfdatasetid value.
Returns boolean dependent on success removing from the dataset.
add_to_database
$ok = $metafield->add_to_database
Add this metafield to the database.
Returns boolean dependent on success adding to the database.
remove_from_database
$ok = $metafield->remove_from_database
Remove this field from the database.
Returns boolean dependent on success removing from the database.
add_to_workflow
$ok = $metafield->add_to_workflow
Add this metafield to the workflow in the Misc. section.
Returns boolean dependent on success adding to the workflow.
remove_from_workflow
$ok = $metafield->remove_from_workflow
Remove all occurrences of this field from the workflow. Will remove the local stage if it is empty.
Returns boolean dependent on success removing from the workflow.
perl_struct
$data = $metafield->perl_struct( $prefix )
Returns the Perl data structure representation of this field, as you would find defined in the configuration or EPrints::DataObj classes.
If $prefix is defined returns the Perl data structure for the fields property, where $prefix is the fieldname of the parent field.
make_field_object
$field = $metafield->make_field_object
Makes and returns a new field object based on this metafield.
add_to_repository
$ok = $metafield->add_to_repository
Adds this field to the repository.
Returns boolean dependent on success adding to the repository.
remove_from_repository
$ok = $mf->remove_from_repository
Remove this field from the repository.
Returns boolean dependent on success removing from the repository.
validate
$problems = $metafield->validate( $repository )
Returns any problems associated with this metafield as an array reference.
render_citation
$xhtml = $metafield->render_citation( [ $type, %params ] )
Returns a XHTML DOM rendering of the metafield using citation $type (of default if not provided) an specified %params.
SEE ALSO
EPrints::DataObj and EPrints::DataSet.
COPYRIGHT
© Copyright 2000-2024 University of Southampton.
EPrints 3.4 is supplied by EPrints Services.
http://www.eprints.org/eprints-3.4/
LICENSE
This file is part of EPrints 3.4 http://www.eprints.org/.
EPrints 3.4 and this file are released under the terms of the GNU Lesser General Public License version 3 as published by the Free Software Foundation unless otherwise stated.
EPrints 3.4 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with EPrints 3.4. If not, see http://www.gnu.org/licenses/.