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
NAME[edit]
EPrints::DataObj::MetaField - metadata fields
DESCRIPTION[edit]
This is an internal class that should not be used outside EPrints::Database.
CORE METADATA FIELDS[edit]
metafieldid (counter)[edit]
The unique identifer for the metafield.
mfdatasetid (set)[edit]
The dataset two which this metafield belongs.
name (text)[edit]
The name of this metafield.
type (set)[edit]
The type of this metafield.
provenance (set)[edit]
The provenance of this metafield.
phrase_name (multilang, multiple)[edit]
The phrase name(s)(labels) potentially in multiple languages for this metafield.
phrase_help (multilang, multiple)[edit]
The phrase help text(s) potentially in multiple languages for this metafield.
required (boolean)[edit]
Whether this metafield is required for the dataset.
multiple (boolean)[edit]
Whether this metafield can have multiple values for a data object.
allow_null (boolean)[edit]
Whether this metafield can have a null value.
export_as_xml (boolean)[edit]
Whether this metafield can be exported in XML.
volatile (boolean)[edit]
Whether this metafield stores a volatile data.
min_resolution (set)[edit]
The minimum time resolution (second, minute, hour, day, month or year) for this metafield if it is a timestamp/datestamp.
sql_index (boolean)[edit]
Whether an SQL index should be created for this metafield.
render_input (text)[edit]
A different or bespoke function to render the input field for this metafield.
render_value (text)[edit]
A different or bespoke function to render the value for this metafield.
input_ordered (boolean)[edit]
Whether the input for this metafield is ordered.
maxlength (int)[edit]
The maximum length for this metafield if it is a text or subclass of a text field.
browse_link (boolean)[edit]
The link to a browse view for this metafield if it is a subject metafield.
top (text)[edit]
The top subject in the subject tree that should be used as options for this subject metafield.
datasetid (text)[edit]
The dataset ID for this metafield, if it is a search, subobject, dataobjref, fields, itemref or file field.
set_name (text)[edit]
The name of the file that contains the options for this namedset metafield.
options (text)[edit]
The commas separated list of options for this set metafield.
render_order (set)[edit]
The order to render a name if this metafield is for a name.
hide_honourific (boolean)[edit]
Whether to hide the honourfic sub-field if this is a name metafield.
hide_lineage (boolean)[edit]
Whether to hide the lineage sub-field if this is a name metafield.
family_first (boolean)[edit]
Whether to render the family name sub-field before the given name if this is a name metafield.
input_style (set)[edit]
A particular style for displaying the input form element for this metafield.
input_rows (int)[edit]
The number of input rows for this metafield.
input_cols (int)[edit]
The number of input columns for this metafield.
input_boxes (int)[edit]
The number of input boxes for this metafield.
sql_counter (text)[edit]
The name to give to the sql counter for this counter metafield. Typically the same as the metafield's name.
default_value (text)[edit]
The default value for this metafield.
REFERENCES AND RELATED OBJECTS[edit]
parent (itemref)[edit]
The parent metafield this metafield belongs to, if it is a sub-field.
fields (subobject, multiple)[edit]
Sub-fields of this metafield.
INSTANCE VARIABLES[edit]
See EPrints::DataObj.
METHODS[edit]
Utility Methods[edit]
dataset_ids[edit]
@ids = EPrints::DataObj::MetaField::dataset_ids( $repo )
Returns array of all dataset IDs for non-virtual datasets in $repo.
render_dataset_id[edit]
$dataset_label = EPrints::DataObj::MetaField::render_dataset_id( $repo, $id )
Returns XHTML DOM rendering of phrase for dataset with $id.
options_fromform[edit]
$options = EPrints::DataObj::MetaField::options_fromform( $value )
Returns an array reference of options from the comma-separated $value provided.
options_toform[edit]
$options_str = EPrints::DataObj::MetaField::options_toform( $value )
Returns a comma-separated string of options from the array reference $value provided.
boolean_fromform[edit]
$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[edit]
$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[edit]
new_from_field[edit]
$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[edit]
get_system_field_info[edit]
$thing = EPrints::DataObj::MetaField->get_system_field_info
Returns an array describing the system metadata fields of the metafield dataset.
get_dataset_id[edit]
$dataset = EPrints::DataObj::MetaField->get_dataset_id
Returns the ID of the EPrints::DataSet object to which this record belongs.
get_parent_dataset_id[edit]
$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[edit]
$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[edit]
get_property_defaults[edit]
$defaults = $metafield->get_property_defaults( $repo, $type )
Gets the property defaults for metafield $type.
dump[edit]
$str = $metafield->dump
Dump the fields configuration as used in cfg.d.
get_parent_id[edit]
$parent = $metafield->get_parent_id
Returns the parent ID for this metafield.
Alias for:
$metafield->value( "parent" );
remove[edit]
$ok = $metafield->remove
Remove the field and any sub-fields from the database.
config_path[edit]
$path = $metafield->config_path
Returns the root directory of the repository configuration path.
config_filename[edit]
$filename = $metafield->config_filename( $dataset )
Returns the location of the cfg.d config file for the provided $dataset.
phrases_filename[edit]
$filename = $metafield->phrases_filename( $langid )
Returns the location of the XML phrases file for provided $lang.
workflow_filename[edit]
$filename = $metafield->workflow_filename( $dataset )
Returns the location of the workflow file for the provided $dataset.
add_to_phrases[edit]
$ok = $metafield->add_to_phrases
Adds the phrases defined by this metafield to the system.
remove_from_dataset[edit]
$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[edit]
$ok = $metafield->add_to_database
Add this metafield to the database.
Returns boolean dependent on success adding to the database.
remove_from_database[edit]
$ok = $metafield->remove_from_database
Remove this field from the database.
Returns boolean dependent on success removing from the database.
add_to_workflow[edit]
$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[edit]
$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[edit]
$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[edit]
$field = $metafield->make_field_object
Makes and returns a new field object based on this metafield.
add_to_repository[edit]
$ok = $metafield->add_to_repository
Adds this field to the repository.
Returns boolean dependent on success adding to the repository.
remove_from_repository[edit]
$ok = $mf->remove_from_repository
Remove this field from the repository.
Returns boolean dependent on success removing from the repository.
validate[edit]
$problems = $metafield->validate( $repository )
Returns any problems associated with this metafield as an array reference.
render_citation[edit]
$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[edit]
EPrints::DataObj and EPrints::DataSet.
COPYRIGHT[edit]
© Copyright 2000-2024 University of Southampton.
EPrints 3.4 is supplied by EPrints Services.
http://www.eprints.org/eprints-3.4/
LICENSE[edit]
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/.