Jump to content
Wiki Home
EPrints Home
Bazaar
Files
Main menu
Main menu
move to sidebar
hide
Navigation
Front Page
EPrints 3 Manual
EPrints Training Course
EPrints Glossary
Installing EPrints
How-to Configure EPrints
EPrints 3.2+ API
EPrints 3 Reference
EPrints Plugins
Wiki
All categories
Recent changes
Main Page
Help
EPrints Documentation
Search
Search
Appearance
Log in
Request account
Personal tools
Log in
Request account
Pages for logged out editors
learn more
Contributions
Talk
Editing
API:EPrints/DataSet
(section)
Page
Discussion
British English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==METHODS== <!-- Edit below this comment --> <!-- Pod2Wiki= --> <!-- Pod2Wiki=head_class_methods --> ===Class Methods=== <!-- Edit below this comment --> <!-- Pod2Wiki= --> <!-- Pod2Wiki=head_object_methods --> ===Object Methods=== $id = $ds->base_id <pre> $ds = $repo->dataset( "inbox" ); $id = $ds->base_id; # returns "eprint"</pre> Returns the identifier of the base dataset for this dataset (same as [[API:EPrints/DataSet#id|id]] unless this dataset is virtual). $metafield = $ds->field( $fieldname ) Returns the [[API:EPrints/MetaField|EPrints::MetaField]] from this dataset with the given name, or undef. $id = $ds->id Return the id of this dataset. $n = $ds->count( $session ) Return the number of records in this dataset. @fields = $ds->fields Returns a list of the [[API:EPrints/MetaField|EPrints::MetaField]]s belonging to this dataset. $field = $ds->key_field Return the [[API:EPrints/MetaField|EPrints::MetaField]] representing the primary key field. Always the first field. $dataobj = $ds->make_dataobj( $epdata ) Return an object of the class associated with this dataset, always a subclass of [[API:EPrints/DataObj|EPrints::DataObj]]. $epdata is a hash of values for fields in this dataset. Returns $epdata if no class is associated with this dataset. $obj = $ds->create_dataobj( $data ) Returns a new object in this dataset based on $data or undef on failure. If $data describes sub-objects then those will also be created. $dataobj = $ds->dataobj( $id ) Returns the object from this dataset with the given id, or undefined. $repository = $ds->repository Returns the [[API:EPrints/Repository|EPrints::Repository]] to which this dataset belongs. $searchexp = $ds->prepare_search( %options ) Returns a [[API:EPrints/Search|EPrints::Search]] for this dataset with %options. $list = $ds->search( %options ) Short-cut to [[API:EPrints/DataSet#prepare_search|prepare_search]]( %options )->execute. * satisfy_all <pre> satisfy_all"=>1</pre> : Satify all conditions specified. 0 means satisfy any of the conditions specified. Default is 1 * staff <pre> "staff"=>1</pre> : Do search as an adminstrator means you get everything back * custom_order <pre> "custom_order" => "field1/-field2/field3"</pre> : Order the search results by field order. prefixing the field name with a "-" results in reverse ordering * filters <pre> "filters" => \@( { meta_fields=>[ "field1", "field2" "document.field3" ], merge=>"ANY", match=>"EX", value=>"bees" }, { meta_fields=>[ "field4" ], value=> qw( honey ), match=>"IN" } );</pre> : This searchs for 'bees' in <code>field1</code> or <code>field2</code> or <code>document.field3</code>, and 'honey' in <code>field4</code> : For details on the <code>merge</code> and <code>match</code> parameters, refer to [[API:EPrints/Search/Field|EPrints::Search::Field]] <pre> "limit" => 10</pre> Only return 10 results <!-- Edit below this comment --> <!-- Pod2Wiki= --> <!-- Pod2Wiki=head_list --> ===list=== <source lang="perl">$list = $ds->list( $ids ) </source> Returns a [[API:EPrints/List|EPrints::List]] for this dataset for the given $ids list. <!-- Edit below this comment --> <!-- Pod2Wiki= --> <!-- Pod2Wiki=head_search_config --> ===search_config=== <source lang="perl">$sconf = $dataset->search_config( $searchid ) </source> Retrieve the search configuration $searchid for this dataset. This typically contains a set of fields to search over, order values and rendering parameters. <!-- Edit below this comment --> <!-- Pod2Wiki= --> <!-- Pod2Wiki=head_copyright -->
Summary:
Please note that all contributions to EPrints Documentation may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
EPrints Documentation:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)