API:EPrints/DataObj/SavedSearch: Difference between revisions
No edit summary |
No edit summary |
||
| (One intermediate revision by the same user not shown) | |||
| Line 17: | Line 17: | ||
<!-- Pod2Wiki=head_description --> | <!-- Pod2Wiki=head_description --> | ||
==DESCRIPTION== | ==DESCRIPTION== | ||
A saved search is a sub class of [[API:EPrints/DataObj|EPrints::DataObj]]. | A saved search is a sub class of [[API:EPrints/DataObj/SubObject|EPrints::DataObj::SubObject]]. | ||
Each one belongs to one and only one user, although one user may own multiple saved searches. | Each one belongs to one and only one user, although one user may own multiple saved searches. | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | |||
<span style='display:none'>User Comments</span> | |||
<!-- Edit below this comment --> | |||
<!-- Pod2Wiki= --> | |||
</div> | |||
<!-- Pod2Wiki=head_core_metadata_fields --> | |||
==CORE METADATA FIELDS== | |||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | |||
<span style='display:none'>User Comments</span> | |||
<!-- Edit below this comment --> | |||
<!-- Pod2Wiki= --> | |||
</div> | |||
<!-- Pod2Wiki=item_id --> | |||
===id (counter)=== | |||
The ID of 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%; '> | |||
<span style='display:none'>User Comments</span> | |||
<!-- Edit below this comment --> | |||
<!-- Pod2Wiki= --> | |||
</div> | |||
<!-- Pod2Wiki=item_name --> | |||
===name (text)=== | |||
A name assigned to 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%; '> | |||
<span style='display:none'>User Comments</span> | |||
<!-- Edit below this comment --> | |||
<!-- Pod2Wiki= --> | |||
</div> | |||
<!-- Pod2Wiki=item_spec --> | |||
===spec (search)=== | |||
A serialization of the search specification. | |||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | |||
<span style='display:none'>User Comments</span> | |||
<!-- Edit below this comment --> | |||
<!-- Pod2Wiki= --> | |||
</div> | |||
<!-- Pod2Wiki=item_frequency --> | |||
===frequency (set)=== | |||
How often to send saves search email updates. | |||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | |||
<span style='display:none'>User Comments</span> | |||
<!-- Edit below this comment --> | |||
<!-- Pod2Wiki= --> | |||
</div> | |||
<!-- Pod2Wiki=item_mailempty --> | |||
===mailempty (boolean)=== | |||
Whether to send saved search email updates if there are no results. | |||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | |||
<span style='display:none'>User Comments</span> | |||
<!-- Edit below this comment --> | |||
<!-- Pod2Wiki= --> | |||
</div> | |||
<!-- Pod2Wiki=item_additional_recipients --> | |||
===additional_recipients (text)=== | |||
Additional email addresses to send updates about saved search results. | |||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | |||
<span style='display:none'>User Comments</span> | |||
<!-- Edit below this comment --> | |||
<!-- Pod2Wiki= --> | |||
</div> | |||
<!-- Pod2Wiki=item_public --> | |||
===public (boolean)=== | |||
If the saved search results should be publicly accessible. | |||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | |||
<span style='display:none'>User Comments</span> | |||
<!-- Edit below this comment --> | |||
<!-- Pod2Wiki= --> | |||
</div> | |||
<!-- Pod2Wiki=head_references_and_related_objects --> | |||
==REFERENCES AND RELATED OBJECTS== | |||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | |||
<span style='display:none'>User Comments</span> | |||
<!-- Edit below this comment --> | |||
<!-- Pod2Wiki= --> | |||
</div> | |||
<!-- Pod2Wiki=item_userid --> | |||
===userid (itemref)=== | |||
The ID of the user to whom created this 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%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
| Line 30: | Line 144: | ||
<!-- Pod2Wiki=head_instance_variables --> | <!-- Pod2Wiki=head_instance_variables --> | ||
==INSTANCE VARIABLES== | ==INSTANCE VARIABLES== | ||
Also see [[API:<EPrints/DataObj#INSTANCE_VARIABLES|EPrints::DataObj]]. | |||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
<span style='display:none'>User Comments</span> | <span style='display:none'>User Comments</span> | ||
| Line 234: | Line 350: | ||
<!-- Pod2Wiki= --> | <!-- Pod2Wiki= --> | ||
</div> | </div> | ||
<!-- Pod2Wiki= | <!-- Pod2Wiki=head_utility_methods --> | ||
=== | ===Utility Methods=== | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
<span style='display:none'>User Comments</span> | <span style='display:none'>User Comments</span> | ||
| Line 277: | Line 393: | ||
<!-- Pod2Wiki=head_see_also --> | <!-- Pod2Wiki=head_see_also --> | ||
==SEE ALSO== | ==SEE ALSO== | ||
[[API:EPrints/DataObj|EPrints::DataObj]] and [[API:EPrints/DataSet|EPrints::DataSet]]. | [[API:EPrints/DataObj/SubObject|EPrints::DataObj::SubObject]], [[API:EPrints/DataObj|EPrints::DataObj]] and [[API:EPrints/DataSet|EPrints::DataSet]]. | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
Latest revision as of 17:29, 10 January 2022
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::SavedSearch - Single saved search.
DESCRIPTION[edit]
A saved search is a sub class of EPrints::DataObj::SubObject.
Each one belongs to one and only one user, although one user may own multiple saved searches.
CORE METADATA FIELDS[edit]
id (counter)[edit]
The ID of the saved search,
name (text)[edit]
A name assigned to the saved search.
spec (search)[edit]
A serialization of the search specification.
frequency (set)[edit]
How often to send saves search email updates.
mailempty (boolean)[edit]
Whether to send saved search email updates if there are no results.
additional_recipients (text)[edit]
Additional email addresses to send updates about saved search results.
public (boolean)[edit]
If the saved search results should be publicly accessible.
REFERENCES AND RELATED OBJECTS[edit]
userid (itemref)[edit]
The ID of the user to whom created this saved search.
INSTANCE VARIABLES[edit]
Also see [[API:<EPrints/DataObj#INSTANCE_VARIABLES|EPrints::DataObj]].
$self->{user}[edit]
The user who owns this saved search.
METHODS[edit]
Constructor Methods[edit]
create[edit]
$saved_search = EPrints::DataObj::SavedSearch->create( $session, $userid )
Creates a new saved search, belonging to user with ID $userid.
Class Methods[edit]
get_system_field_info[edit]
$field_config = EPrints::DataObj::SavedSearch->get_system_field_info
Returns an array describing the system metadata of the saved search dataset.
get_dataset_id[edit]
$dataset = EPrints::DataObj::SavedSearch->get_dataset_id
Returns the ID of the EPrints::DataSet object to which this record belongs.
Object Methods[edit]
get_dataset[edit]
$dataset = $saved_search->get_dataset
Get the dataset that this saved search covers.
commit[edit]
$success = $saved_search->commit( [ $force ] )
Writes this object to the database.
If $force is not true then it only actually modifies the database if one or more fields have been changed.
Returns true if commit was successfully. Otherwise, returns false.
get_user[edit]
$user = $saved_search->get_user
Returns the EPrints::DataObj::User which owns this saved search.
make_searchexp[edit]
$searchexp = $saved_search->make_searchexp
Returns an EPrints::Search describing how to find the data objects which are in the scope of this saved search.
send_out_alert[edit]
$saved_search->send_out_alert
Sends out an email for this subscription. If there are no matching new data objects then an email is only sent if the saved search has mailempty set to true.
has_owner[edit]
$boolean = $saved_search->has_owner( $possible_owner )
Returns true if $possible_owner is the same as the owner of this saved search. Otherwise, returns false.
parent[edit]
$parent = $saved_search->parent
Returns the parent data object for this saved search. I.e. the user who owns this saved search. This is similar to get_user but is not as fault tolerant and does set instance variable:
$self->{user}
get_url[edit]
$url = $saved_search->get_url( [ $staff ] )
Gets the URL for this saved search. Currently $staff will not effect the URL but in future this may return a specialised URL for staff only.
Utility Methods[edit]
process_set[edit]
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.
get_last_timestamp[edit]
$timestamp = EPrints::DataObj::SavedSearch::get_last_timestamp( $session, $frequency );
Static method.
Return sthe timestamp of the last time this $frequency of alert was sent.
SEE ALSO[edit]
EPrints::DataObj::SubObject, 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/.