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/List
(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= --> $list = EPrints::List->new( repository => $repository, dataset => $dataset,ids => $ids, [order => $order] ); $list = EPrints::List->new( repository => $repository, dataset => $dataset,[desc => $desc],[desc_order => $desc_order],cache_id => $cache_id ); Note the new() method will be called very rarely since lists will usually created by an [[API:EPrints/Search|EPrints::Search]]. Creates a new list object in memory only. Lists will be cached if any method requiring order is called, or an explicit cache() method is called. encoded is the serialised version of the searchExpression which created this list, if there was one. If keep_cache is set then the cache will not be disposed of at the end of the current $session. If cache_id is set then keep_cache is automatically true. $new_list = $list->reorder( $new_order ); Create a new list from this one, but sorted in a new way. $new_list = $list->reorder( "-creation_date" ); # makes a new list ordered by reverse order creation_date $new_list = $list->union( $list2, [$order] ); Create a new list from this one plus another one. If order is not set then this list will not be in any certain order. $list2 - the list which is to be combined to the calling list $order - a field which the the resulting list will be ordered on. (optional) $new_list = $list->remainder( $list2, [$order] ); Create a new list from $list with elements from $list2 removed. If order is not set then this list will not be in any certain order. Remove all items in $list2 from $list and return the result as a new EPrints::List. $list2 - the eprints you want to remove from the calling list $order - the field the remaining list is to be ordered by $new_list = $list->intersect( $list2, [$order] ); Create a new list containing only the items which are in both lists. If order is not set then this list will not be in any certain order. $list2 - a list to intersect with the calling list $order - the field the resulting list will be ordered on $list->cache Cause this list to be cached in the database. <!-- Pod2Wiki=end --> InternalDoc $cache_id = $list->get_cache_id Return the ID of the cache table for this list, or undef. <!-- Pod2Wiki=end --> InternalDoc $list->dispose Clean up the cache table if appropriate. <!-- Pod2Wiki=end --> InternalDoc $n = $list->count Return the number of values in this list. $dataobj = $list->item( $offset ) Returns the item at offset $offset. Returns undef if $offset is out of range of the current list of items. @dataobjs = $list->slice( [$offset], [$count] ) Returns the DataObjs in this list as an array. $offset - what index through the list to start from. $count - the maximum to return. $ids = $list->ids( [$offset], [$count] ) Return a reference to an array containing the object ids of the items in the list. You can specify a range of ids using $offset and $count. This is more efficient if you just need the ids. $offset - what index through the list to start from. $count - the maximum to return. $list->map( $function, $info ) Map the given function pointer to all the items in the list, in order. This loads the items in batches of 100 to reduce memory requirements. $info is a datastructure which will be passed to the function each time and is useful for holding or collecting state. Example: <pre> my $info = { matches => 0 }; $list->map( \&deal, $info ); print "Matches: ".$info->{matches}."\n"; sub deal { my( $session, $dataset, $eprint, $info ) = @_; if( $eprint->get_value( "a" ) eq $eprint->get_value( "b" ) ) { $info->{matches} += 1; } }</pre> $plugin_output = $list->export( $plugin_id, %params ) Apply an output plugin to this list of items. If the param "fh" is set it will send the results to a filehandle rather than return them as a string. $plugin_id - the ID of the Export plugin which is to be used to process the list. e.g. "BibTeX" $param{"fh"} = "temp_dir/my_file.txt"; - the file the results are to be output to, useful for output too large to fit into memory. <pre></pre> $xhtml = $list->render_description Return a DOM XHTML description of this list, if available, or an empty fragment. <!-- 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)