Difference between revisions of "API:EPrints/DataObj/SavedSearch"

From EPrints Documentation
Jump to: navigation, search
(New page: <!-- Pod2Wiki=_preamble_ This page has been automatically generated from the EPrints source. Any wiki changes made between the 'Pod2Wiki=*' and 'End of Pod2Wiki' comments will be lost. -...)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
 
<!-- Pod2Wiki=_preamble_  
 
<!-- Pod2Wiki=_preamble_  
This page has been automatically generated from the EPrints source. Any wiki changes made between the 'Pod2Wiki=*' and 'End of Pod2Wiki' 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.
  -->{{Pod2Wiki}}{{API:Source|file=EPrints/DataObj/SavedSearch.pm|package_name=EPrints::DataObj::SavedSearch}}[[Category:API|SavedSearch]]<!-- End of Pod2Wiki -->
+
  -->
<!-- Pod2Wiki=head_name -->=NAME=
+
__NOTOC__
'''EPrints::DataObj::SavedSearch''' - Single saved search.
+
{{API}}{{Pod2Wiki}}{{API:Source|file=EPrints/DataObj/SavedSearch.pm|package_name=EPrints::DataObj::SavedSearch}}[[Category:API|SavedSearch]]<div><!-- Edit below this comment -->
  
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=head_description -->=DESCRIPTION=
 
A saved search is a sub class of EPrints::DataObj.
 
  
Each one belongs to one and only one user, although one user may own multiple saved searches.
+
<!-- Pod2Wiki=head_name --></div>
 +
==NAME==
 +
'''EPrints::DataObj::SavedSearch''' - Single saved search.
  
<!-- End of Pod2Wiki -->
+
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
<!-- Pod2Wiki=item_get_system_field_info -->==get_system_field_info==
+
<h4><span style='display:none'>User Comments</span></h4>
 +
<!-- Edit below this comment -->
  
  $field_config = EPrints::DataObj::SavedSearch-&gt;get_system_field_info
 
  
Return an array describing the system metadata of the saved search. dataset.
+
<!-- Pod2Wiki=head_description --></div>
 +
==DESCRIPTION==
 +
A saved search is a sub class of EPrints::DataObj.
  
<!-- End of Pod2Wiki -->
+
Each one belongs to one and only one user, although one user may own multiple saved searches.
<!-- Pod2Wiki=item_new -->==new==
 
  
  $saved_search = EPrints::DataObj::SavedSearch-&gt;new( $session, $id )
+
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<h4><span style='display:none'>User Comments</span></h4>
 +
<!-- Edit below this comment -->
  
Return new Saved Search object, created by loading the Saved Search with id $id from the database.
 
  
<!-- End of Pod2Wiki -->
+
<!-- Pod2Wiki=item_get_system_field_info --></div>
<!-- Pod2Wiki=item_new_from_data -->==new_from_data==
+
===$field_config = EPrints::DataObj::SavedSearch-&gt;get_system_field_info===
  
  $saved_search = EPrints::DataObj::SavedSearch-&gt;new_from_data( $session, $data )
+
Return an array describing the system metadata of the saved search. dataset.
 
 
Construct a new EPrints::DataObj::SavedSearch object based on the $data hash  reference of metadata.
 
 
 
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=item_get_defaults -->==get_defaults==
 
  
  $defaults = EPrints::DataObj::SavedSearch-&gt;get_defaults( $session, $data )
+
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<h4><span style='display:none'>User Comments</span></h4>
 +
<!-- Edit below this comment -->
  
Return default values for this object based on the starting data.
 
  
<!-- End of Pod2Wiki -->
+
<!-- Pod2Wiki=item_get_dataset_id --></div>
<!-- Pod2Wiki=item_remove -->==remove==
+
===$dataset = EPrints::DataObj::SavedSearch-&gt;get_dataset_id===
  
  $success = $saved_search-&gt;remove
+
Returns the id of the [[API:EPrints/DataSet|EPrints::DataSet]] object to which this record belongs.
  
Remove the saved search.
+
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<h4><span style='display:none'>User Comments</span></h4>
 +
<!-- Edit below this comment -->
  
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=item_commit -->==commit==
 
  
  $success = $saved_search-&gt;commit( [$force] )
+
<!-- Pod2Wiki=item_commit --></div>
 +
===$success = $saved_search-&gt;commit( [$force] )===
  
 
Write this object to the database.
 
Write this object to the database.
Line 55: Line 53:
 
If $force isn't true then it only actually modifies the database if one or more fields have been changed.
 
If $force isn't true then it only actually modifies the database if one or more fields have been changed.
  
<!-- End of Pod2Wiki -->
+
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
<!-- Pod2Wiki=item_get_user -->==get_user==
+
<h4><span style='display:none'>User Comments</span></h4>
 +
<!-- Edit below this comment -->
 +
 
  
  $user = $saved_search-&gt;get_user
+
<!-- Pod2Wiki=item_get_user --></div>
 +
===$user = $saved_search-&gt;get_user===
  
 
Return the EPrints::User which owns this saved search.
 
Return the EPrints::User which owns this saved search.
  
<!-- End of Pod2Wiki -->
+
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
<!-- Pod2Wiki=item_make_searchexp -->==make_searchexp==
+
<h4><span style='display:none'>User Comments</span></h4>
 +
<!-- Edit below this comment -->
 +
 
  
  $searchexp = $saved_search-&gt;make_searchexp
+
<!-- Pod2Wiki=item_make_searchexp --></div>
 +
===$searchexp = $saved_search-&gt;make_searchexp===
  
 
Return a EPrints::Search describing how to find the eprints which are in the scope of this saved search.
 
Return a EPrints::Search describing how to find the eprints which are in the scope of this saved search.
  
<!-- End of Pod2Wiki -->
+
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
<!-- Pod2Wiki=item_send_out_alert -->==send_out_alert==
+
<h4><span style='display:none'>User Comments</span></h4>
 +
<!-- Edit below this comment -->
 +
 
  
  $saved_search-&gt;send_out_alert
+
<!-- Pod2Wiki=item_send_out_alert --></div>
 +
===$saved_search-&gt;send_out_alert===
  
 
Send out an email for this subcription. If there are no matching new items then an email is only sent if the saved search has mailempty set to true.
 
Send out an email for this subcription. If there are no matching new items then an email is only sent if the saved search has mailempty set to true.
  
<!-- End of Pod2Wiki -->
+
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
<!-- Pod2Wiki=item_process_set -->==process_set==
+
<h4><span style='display:none'>User Comments</span></h4>
 +
<!-- Edit below this comment -->
 +
 
  
  EPrints::DataObj::SavedSearch::process_set( $session, $frequency );
+
<!-- Pod2Wiki=item_process_set --></div>
 +
===EPrints::DataObj::SavedSearch::process_set( $session, $frequency );===
  
 
Static method. Calls send_out_alert on every saved search  with a frequency matching $frequency.
 
Static method. Calls send_out_alert on every saved search  with a frequency matching $frequency.
Line 85: Line 95:
 
Also saves a file logging that the alerts for this frequency was sent out at the current time.
 
Also saves a file logging that the alerts for this frequency was sent out at the current time.
  
<!-- End of Pod2Wiki -->
+
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
<!-- Pod2Wiki=item_get_last_timestamp -->==get_last_timestamp==
+
<h4><span style='display:none'>User Comments</span></h4>
 +
<!-- Edit below this comment -->
 +
 
  
  $timestamp = EPrints::DataObj::SavedSearch::get_last_timestamp( $session, $frequency );
+
<!-- Pod2Wiki=item_get_last_timestamp --></div>
 +
===$timestamp = EPrints::DataObj::SavedSearch::get_last_timestamp( $session, $frequency );===
  
 
Static method. Return the timestamp of the last time this frequency  of alert was sent.
 
Static method. Return the timestamp of the last time this frequency  of alert was sent.
  
<!-- End of Pod2Wiki -->
+
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
<!-- Pod2Wiki=item_has_owner -->==has_owner==
+
<h4><span style='display:none'>User Comments</span></h4>
 +
<!-- Edit below this comment -->
 +
 
  
  $boolean = $user-&gt;has_owner( $possible_owner )
+
<!-- Pod2Wiki=item_has_owner --></div>
 +
===$boolean = $user-&gt;has_owner( $possible_owner )===
  
 
True if the users are the same record.
 
True if the users are the same record.
  
<!-- End of Pod2Wiki -->
+
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
<!-- Pod2Wiki=head_undocumented_methods -->=UNDOCUMENTED METHODS=
+
<h4><span style='display:none'>User Comments</span></h4>
{{API:Undocumented Methods}}<!-- End of Pod2Wiki -->
+
<!-- Edit below this comment -->
<!-- Pod2Wiki=item_create -->==create==
 
  
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=item_get_url -->==get_url==
 
  
<!-- End of Pod2Wiki -->
+
<!-- Pod2Wiki=_postamble_ --><!-- Edit below this comment -->
<!-- Pod2Wiki=_postamble_ --><!-- End of Pod2Wiki -->
 

Revision as of 16:34, 12 February 2010


EPrints 3 Reference: Directory Structure - Metadata Fields - Repository Configuration - XML Config Files - XML Export Format - EPrints data structure - Core API - Data Objects


API: Core API

Latest Source Code (3.4, 3.3) | Revision Log | Before editing this page please read Pod2Wiki


NAME

EPrints::DataObj::SavedSearch - Single saved search.

User Comments


DESCRIPTION

A saved search is a sub class of EPrints::DataObj.

Each one belongs to one and only one user, although one user may own multiple saved searches.

User Comments


$field_config = EPrints::DataObj::SavedSearch->get_system_field_info

Return an array describing the system metadata of the saved search. dataset.

User Comments


$dataset = EPrints::DataObj::SavedSearch->get_dataset_id

Returns the id of the EPrints::DataSet object to which this record belongs.

User Comments


$success = $saved_search->commit( [$force] )

Write this object to the database.

If $force isn't true then it only actually modifies the database if one or more fields have been changed.

User Comments


$user = $saved_search->get_user

Return the EPrints::User which owns this saved search.

User Comments


$searchexp = $saved_search->make_searchexp

Return a EPrints::Search describing how to find the eprints which are in the scope of this saved search.

User Comments


$saved_search->send_out_alert

Send out an email for this subcription. If there are no matching new items then an email is only sent if the saved search has mailempty set to true.

User Comments


EPrints::DataObj::SavedSearch::process_set( $session, $frequency );

Static method. Calls send_out_alert on every saved search with a frequency matching $frequency.

Also saves a file logging that the alerts for this frequency was sent out at the current time.

User Comments


$timestamp = EPrints::DataObj::SavedSearch::get_last_timestamp( $session, $frequency );

Static method. Return the timestamp of the last time this frequency of alert was sent.

User Comments


$boolean = $user->has_owner( $possible_owner )

True if the users are the same record.

User Comments