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

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. -...)
 
 
(6 intermediate revisions by 3 users 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.4 source. Any wiki changes made between the 'Pod2Wiki=*' and 'Edit below this comment' comments will be lost.
  -->{{Pod2Wiki}}{{API:Source|file=EPrints/DataObj/Cachemap.pm|package_name=EPrints::DataObj::Cachemap}}[[Category:API|Cachemap]]<!-- End of Pod2Wiki -->
+
  -->{{API}}{{Pod2Wiki}}{{API:Source|file=EPrints/DataObj/Cachemap.pm|package_name=EPrints::DataObj::Cachemap}}[[Category:API|CACHEMAP]][[Category:API:EPrints/DataObj|CACHEMAP]]<div><!-- Edit below this comment -->
<!-- Pod2Wiki=head_name -->=NAME=
 
'''EPrints::DataObj::Cachemap''' - cache tables
 
  
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=head_description -->=DESCRIPTION=
 
This is an internal class that shouldn't be used outside [[API:EPrints/Database|EPrints::Database]].
 
  
<!-- End of Pod2Wiki -->
+
<!-- Pod2Wiki=_private_ --><!-- Pod2Wiki=head_name -->
<!-- Pod2Wiki=head_methods -->=METHODS=
+
==NAME==
<!-- End of Pod2Wiki -->
+
'''EPrints::DataObj::Cachemap''' - Cache tables
<!-- Pod2Wiki=item_get_system_field_info -->==get_system_field_info==
 
  
  $thing = EPrints::DataObj::Access-&gt;get_system_field_info
+
<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 -->
  
Core fields.
 
  
<!-- End of Pod2Wiki -->
+
<!-- Pod2Wiki= -->
<!-- Pod2Wiki=head_constructor_methods -->==Constructor Methods==
+
</div>
<!-- End of Pod2Wiki -->
+
<!-- Pod2Wiki=head_description -->
<!-- Pod2Wiki=item_new -->===new===
+
==DESCRIPTION==
 +
This is an internal class that shouldn't be used outside  [[API:EPrints/Database|EPrints::Database]].
  
  $thing = EPrints::DataObj::Cachemap-&gt;new( $session, $cachemapid )
+
<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 -->
  
The data object identified by $cachemapid.
 
  
<!-- End of Pod2Wiki -->
+
<!-- Pod2Wiki= -->
<!-- Pod2Wiki=item_new_from_data -->===new_from_data===
+
</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 -->
  
  $thing = EPrints::DataObj::Cachemap-&gt;new_from_data( $session, $known )
 
  
A new <tt>EPrints::DataObj::Cachemap</tt> object containing data $known (a hash reference).
+
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=item_cachemapid -->
 +
===cachemapid (int)===
  
<!-- End of Pod2Wiki -->
+
The unique numerical ID of this cachemap object.
<!-- Pod2Wiki=head_class_methods -->==Class Methods==
 
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=item_remove_all -->===remove_all===
 
  
  EPrints::DataObj::Cachemap::remove_all( $session )
+
<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 -->
  
Remove all records from the cachemap dataset.
 
  
<!-- End of Pod2Wiki -->
+
<!-- Pod2Wiki= -->
<!-- Pod2Wiki=item_get_defaults -->===get_defaults===
+
</div>
 +
<!-- Pod2Wiki=item_created -->
 +
===created (int)===
  
  $defaults = EPrints::DataObj::Cachemap-&gt;get_defaults( $session, $data )
+
The time the cachemap record was created in seconds since start of  last epoch.
  
Return default values for this object based on the starting data.
+
<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 -->
  
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=head_object_methods -->==Object Methods==
 
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=item_remove -->===remove===
 
  
  $foo = $thing-&gt;remove()
+
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=item_lastused -->
 +
===lastused (int)===
  
Remove this record from the data set (see [[API:EPrints/Database|EPrints::Database]]).
+
The time the cachemap record was last used in seconds since start of last epoch.
  
<!-- 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_see_also -->=SEE ALSO=
+
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
 +
 
 +
 
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=item_searchexap -->
 +
===searchexap (longtext)===
 +
 
 +
A serialisation of the search carried out that is stored in this cachemap record.
 +
 
 +
<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_oneshot -->
 +
===oneshot (boolean)===
 +
 
 +
DEPRECATED. A boolean to record whether the cache is for single use where it will be created, used and immediately deleted.  Such as  type of caching is no longer required.
 +
 
 +
<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)===
 +
 
 +
Reference to the userid of the user who caused the cachemap record to be created, if this is known.
 +
 
 +
<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_instance_variables -->
 +
==INSTANCE VARIABLES==
 +
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%; '>
 +
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
 +
 
 +
 
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=head_methods -->
 +
==METHODS==
 +
<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_constructor_methods -->
 +
===Constructor Methods===
 +
<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_create_from_data -->
 +
====create_from_data====
 +
 
 +
EPrints::DataObj::Cachemap-&gt;create_from_data( $session, $data, $dataset )
 +
Creates a new cachemap data object in the database.
 +
 
 +
<tt>$dataset</tt> is the dataset it will belong to.
 +
 
 +
<tt>$data</tt> is the data structured as with [[API:EPrints/DataObj#new_from_data|EPrints::DataObj#new_from_data]].
 +
 
 +
This will create sub-objects as well.
 +
 
 +
Call this via:
 +
 
 +
$dataset-&gt;create_object( $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%; '>
 +
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
 +
 
 +
 
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=head_class_methods -->
 +
===Class Methods===
 +
<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_get_system_field_info -->
 +
====get_system_field_info====
 +
 
 +
$fields = EPrints::DataObj::Access-&gt;get_system_field_info
 +
Returns an array describing the system metadata of the cachemap dataset.
 +
 
 +
<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_get_dataset_id -->
 +
====get_dataset_id====
 +
 
 +
$dataset = EPrints::DataObj::Cachemap-&gt;get_dataset_id
 +
Returns the ID of the [[API:EPrints/DataSet|EPrints::DataSet]] object to which this record  belongs.
 +
 
 +
<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_get_defaults -->
 +
====get_defaults====
 +
 
 +
$defaults = EPrints::DataObj::Cachemap-&gt;get_defaults( $session, $data )
 +
Return default values for this object based on the starting <tt>$data</tt>.
 +
 
 +
<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_cleanup -->
 +
====cleanup====
 +
 
 +
$dropped = EPrints::DataObj::Cachemap-&gt;cleanup( $repo )
 +
Clean up old caches for specified <tt>$repo</tt>.
 +
 
 +
Returns the number of caches dropped.
 +
 
 +
<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_object_methods -->
 +
===Object Methods===
 +
<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_remove -->
 +
====remove====
 +
 
 +
$rc = $cachemap-&gt;remove
 +
Remove this record from the data set and the cache table from the  database.
 +
 
 +
Returns a code based of success of removing record / cache table.
 +
 
 +
<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_get_sql_table_name -->
 +
====get_sql_table_name====
 +
 
 +
$sql_name = $cachemap-&gt;get_sql_table_name
 +
Returns the name of the cache table for this cachemap record.
 +
 
 +
<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_create_sql_table -->
 +
====create_sql_table====
 +
 
 +
$ok = $cachemap-&gt;create_sql_table( $dataset )
 +
Create the cachemap database table that can store IDs for the  specified <tt>$dataset</tt>.
 +
 
 +
Returns code based on the success of creating cache table.
 +
 
 +
<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_see_also -->
 +
==SEE ALSO==
 
[[API:EPrints/DataObj|EPrints::DataObj]] and [[API:EPrints/DataSet|EPrints::DataSet]].
 
[[API:EPrints/DataObj|EPrints::DataObj]] and [[API:EPrints/DataSet|EPrints::DataSet]].
  
<!-- 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=
+
<span style='display:none'>User Comments</span>
{{API:Undocumented Methods}}<!-- End of Pod2Wiki -->
+
<!-- Edit below this comment -->
<!-- Pod2Wiki=item_get_sql_table_name -->==get_sql_table_name==
+
 
 +
 
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=head_copyright -->
 +
==COPYRIGHT==
 +
{{API:Copyright}}
 +
<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 -->
 +
 
  
<!-- End of Pod2Wiki -->
+
<!-- Pod2Wiki= -->
<!-- Pod2Wiki=_postamble_ --><!-- End of Pod2Wiki -->
+
</div>
 +
<!-- Pod2Wiki=_postamble_ --><!-- Edit below this comment -->

Latest revision as of 16:35, 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


API: Core API

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


NAME

EPrints::DataObj::Cachemap - Cache tables

User Comments


DESCRIPTION

This is an internal class that shouldn't be used outside EPrints::Database.

User Comments


CORE METADATA FIELDS

User Comments


cachemapid (int)

The unique numerical ID of this cachemap object.

User Comments


created (int)

The time the cachemap record was created in seconds since start of last epoch.

User Comments


lastused (int)

The time the cachemap record was last used in seconds since start of last epoch.

User Comments


searchexap (longtext)

A serialisation of the search carried out that is stored in this cachemap record.

User Comments


oneshot (boolean)

DEPRECATED. A boolean to record whether the cache is for single use where it will be created, used and immediately deleted. Such as type of caching is no longer required.

User Comments


REFERENCES AND RELATED OBJECTS

User Comments


userid (itemref)

Reference to the userid of the user who caused the cachemap record to be created, if this is known.

User Comments


INSTANCE VARIABLES

See EPrints::DataObj.

User Comments


METHODS

User Comments


Constructor Methods

User Comments


create_from_data

EPrints::DataObj::Cachemap->create_from_data( $session, $data, $dataset )

Creates a new cachemap data object in the database.

$dataset is the dataset it will belong to.

$data is the data structured as with EPrints::DataObj#new_from_data.

This will create sub-objects as well.

Call this via:

$dataset->create_object( $session, $data )
 

User Comments


Class Methods

User Comments


get_system_field_info

$fields = EPrints::DataObj::Access->get_system_field_info

Returns an array describing the system metadata of the cachemap dataset.

User Comments


get_dataset_id

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

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

User Comments


get_defaults

$defaults = EPrints::DataObj::Cachemap->get_defaults( $session, $data )

Return default values for this object based on the starting $data.

User Comments


cleanup

$dropped = EPrints::DataObj::Cachemap->cleanup( $repo )

Clean up old caches for specified $repo.

Returns the number of caches dropped.

User Comments


Object Methods

User Comments


remove

$rc = $cachemap->remove

Remove this record from the data set and the cache table from the database.

Returns a code based of success of removing record / cache table.

User Comments


get_sql_table_name

$sql_name = $cachemap->get_sql_table_name

Returns the name of the cache table for this cachemap record.

User Comments


create_sql_table

$ok = $cachemap->create_sql_table( $dataset )

Create the cachemap database table that can store IDs for the specified $dataset.

Returns code based on the success of creating cache table.

User Comments


SEE ALSO

EPrints::DataObj and EPrints::DataSet.

User Comments


COPYRIGHT

© Copyright 2000-2024 University of Southampton.

EPrints 3.4 is supplied by EPrints Services.

http://www.eprints.org/eprints-3.4/

LICENSE

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/.

User Comments