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

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/History.pm|package_name=EPrints::DataObj::History}}[[Category:API|History]]<!-- End of Pod2Wiki -->
+
  -->{{API}}{{Pod2Wiki}}{{API:Source|file=EPrints/DataObj/History.pm|package_name=EPrints::DataObj::History}}[[Category:API|HISTORY]][[Category:API:EPrints/DataObj|HISTORY]]<div><!-- Edit below this comment -->
<!-- Pod2Wiki=head_name -->=NAME=
 
'''EPrints::DataObj::History''' - An element in the history of the arcvhive.
 
  
<!-- End of Pod2Wiki -->
+
 
<!-- Pod2Wiki=head_description -->=DESCRIPTION=
+
<!-- Pod2Wiki=_private_ --><!-- Pod2Wiki=head_name -->
 +
==NAME==
 +
'''EPrints::DataObj::History''' - An element in the history of the  archive.
 +
 
 +
<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_description -->
 +
==DESCRIPTION==
 
This class describes a single item in the history dataset. A history object describes a single action taken on a single item in another dataset.
 
This class describes a single item in the history dataset. A history object describes a single action taken on a single item in another dataset.
 +
 +
This class inherits from [[API:EPrints/DataObj/SubObject|EPrints::DataObj::SubObject]], which in  turn inherits from [[API:EPrints/DataObj|EPrints::DataObj]].
  
 
Changes to document are considered part of changes to the eprint it belongs to.
 
Changes to document are considered part of changes to the eprint it belongs to.
  
<!-- 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_metadata -->=METADATA=
+
<span style='display:none'>User Comments</span>
<!-- End of Pod2Wiki -->
+
<!-- Edit below this comment -->
<!-- Pod2Wiki=item_historyid -->==historyid==
+
 
 +
 
 +
<!-- 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_historyid -->
 +
===historyid (counter)===
 +
 
 +
The unique numerical ID of this history event.
  
  historyid (int)
+
<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 unique numerical ID of this history event.
 
  
<!-- End of Pod2Wiki -->
+
<!-- Pod2Wiki= -->
<!-- Pod2Wiki=item_userid -->==userid==
+
</div>
 +
<!-- Pod2Wiki=item_actor -->
 +
===actor (text)===
  
  userid (itemref)
+
A text representation of the actor reponsible for the action for this history event.  This may be the name of a script or application or a user's name.
  
The id of the user who caused this event. A value of zero or undefined indicates that there was no user responsible (ie. a script did it).
+
<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=item_datasetid -->==datasetid==
 
  
  datasetid (text)
+
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=item_datasetid -->
 +
===datasetid (id)===
  
The name of the dataset to which the modified item belongs. "eprint" is used for eprints, rather than the inbox, buffer etc.
+
The name of the dataset to which the modified item belongs. <tt>eprint</tt> is used for eprints, rather than the <tt>inbox</tt>, <tt>buffer</tt> etc.
  
<!-- 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_objectid -->==objectid==
+
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
  
  objectid (int)
+
 
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=item_objectid -->
 +
===objectid (int)===
  
 
The numerical ID of the object in the dataset.  
 
The numerical ID of the object in the 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=item_revision -->==revision==
+
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
  
  revision (int)
+
 
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=item_revision -->
 +
===revision (int)===
  
 
The revision of the object. This is the revision number after the action occured. Not all actions increase the revision number.
 
The revision of the object. This is the revision number after the action occured. Not all actions increase the revision number.
  
<!-- 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_timestamp -->==timestamp==
+
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
  
  timestamp (time)
+
 
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=item_timestamp -->
 +
===timestamp (timestamp)===
  
 
The moment at which this thing happened.
 
The moment at which this thing happened.
  
<!-- 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_action -->==action==
+
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
 +
 
 +
 
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=item_action -->
 +
===action (set)===
 +
 
 +
The type of event. Provisionally, this is a subset of the new list of privileges.
 +
 
 +
<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_details -->
 +
===details (longtext)===
 +
 
 +
If this is a <tt>rejection</tt> then the details contain the message sent to the user.
 +
 
 +
<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 who caused this event. A value of zero or undefined indicates that there was no user responsible (ie. a script did it).
 +
 
 +
<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 -->
 +
====create====
 +
 
 +
EPrints::DataObj::History::create( $session, $data );
 +
Create a new history data object from this <tt>$data</tt>. Unlike other create methods this one does not return the new object as it is never needed, and would increase the load when modifying other data objects.
 +
 
 +
Also, this does not queue the fields for indexing.
 +
 
 +
<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====
 +
 
 +
$field_info = EPrints::DataObj::History-&gt;get_system_field_info
 +
Returns an array describing the system metadata of the history 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::History-&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=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_commit -->
 +
====commit====
 +
 
 +
$history-&gt;commit
 +
History cannot be altered. So if somehow this is called it just logs a warning message.
 +
 
 +
<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====
 +
 
 +
$history-&gt;remove
 +
History cannot be removed. So if somehow this is called it just logs a warning message.
 +
 
 +
<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::History-&gt;get_defaults( $session, $data, [ $dataset ] )
 +
Returns default values for this history data object based on the  starting <tt>$data</tt> and for ths <tt>$dataset</tt> if specified.
 +
 
 +
<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_render -->
 +
====render====
 +
 
 +
$xhtml = $history-&gt;render
 +
Return a rendering of this history event as XHTML DOM.
 +
 
 +
<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_dataobj -->
 +
====get_dataobj====
 +
 
 +
$object = $history-&gt;get_dataobj
 +
Returns the data object to which this history event relates.
 +
 
 +
<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_user -->
 +
====get_user====
 +
 
 +
$user = $history-&gt;get_user
 +
Returns the user data object of the user who caused this history  event.
 +
 
 +
<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_previous -->
 +
====get_previous====
 +
 
 +
$history = $history-&gt;get_previous
 +
Returns the previous history event for this history event's data  object.
 +
 
 +
Returns <tt>undef</tt> if no such history event exists.
 +
 
 +
<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_render_removal_request -->
 +
====render_removal_request====
 +
 
 +
$xhtml = $history-&gt;render_removal_request
 +
Returns a XHTML DOM rendering of a removal request history event.
 +
 
 +
<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_render_with_details -->
 +
====render_with_details====
 +
 
 +
$xhtml = $history-&gt;render_with_details
 +
Returns a XHTML DOM rendering of a <tt>mail_owner</tt> (i.e. email was sent to the owner of the data object) history event.
 +
 
 +
<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_render_create -->
 +
====render_create====
  
  action (set)
+
$xhtml = $history-&gt;render_create( $action )
 +
Returns a XHTML DOM rendering of a <tt>create</tt> history event.
  
The type of event. Provisionally, this is a subset of the new list of privilages.
+
<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=item_details -->==details==
 
  
  details (longtext)
+
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=item_render_modify -->
 +
====render_modify====
  
If this is a "rejection" then the details contain the message sent to the user.  
+
$xhtml = $history-&gt;render_modify( $action )
 +
Returns a XHTML DOM rendering of a <tt>modify</tt> history event.
  
<!-- 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_methods -->=METHODS=
+
<span style='display:none'>User Comments</span>
<!-- End of Pod2Wiki -->
+
<!-- Edit below this comment -->
<!-- Pod2Wiki=item_get_system_field_info -->==get_system_field_info==
 
  
  $field_info = EPrints::DataObj::History-&gt;get_system_field_info
 
  
Return the metadata field configuration for this object.
+
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=item_set_dataobj_xml -->
 +
====set_dataobj_xml====
  
<!-- End of Pod2Wiki -->
+
$history-&gt;set_dataobj_xml( $dataobj )
<!-- Pod2Wiki=item_new -->==new==
+
Stores the XML serialisation for <tt>$dataobj</tt> to a file.
  
  $history = EPrints::DataObj::History-&gt;new( $session, $historyid )
+
<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 -->
  
Return a history object with id $historyid, from the database.
 
  
Return undef if no such object extists.
+
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- 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%; '>
 +
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
  
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=item_new_from_data -->==new_from_data==
 
  
  undef = EPrints::DataObj::History-&gt;new_from_data( $session, $data )
+
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=item_empty_tree -->
 +
====empty_tree====
  
Create a new History object from the given $data. Used to turn items from the database into objects.
+
$boolean = EPrints::DataObj::History::empty_tree( $domtree )
 +
Returns <tt>true</tt> if there is no text in the XHTML <tt>$domtree</tt> other  than whitespace. Otherwise, returns <tt>false</tt>.
  
<!-- End of Pod2Wiki -->
+
This method is liable to being moveded to [[API:EPrints/XML|EPrints::XML]]&gt; or  [[API:EPrints/Utils|EPrints::Utils]].
<!-- Pod2Wiki=item_commit -->==commit==
 
  
  $history-&gt;commit
+
<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 -->
  
Not meaningful. History can't be altered.
 
  
<!-- End of Pod2Wiki -->
+
<!-- Pod2Wiki= -->
<!-- Pod2Wiki=item_remove -->==remove==
+
</div>
 +
<!-- Pod2Wiki=item_render_xml_diffs -->
 +
====render_xml_diffs====
  
  $history-&gt;remove
+
( $f1, $f2 ) = EPrints::DataObj::History::render_xml_diffs( $tree1, $tree2, $indent, $width )
 +
Returns two XHTML DOM trees.  The first for the older version, highlighting lines that are changed or removed and the second for  the newer version, highlighting libes that are changed or added.
  
Not meaningful. History can't be altered.
+
<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=item_get_defaults -->==get_defaults==
 
  
  $defaults = EPrints::DataObj::History-&gt;get_defaults( $session, $data )
+
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=item_render_domtree -->
 +
====render_domtree====
  
Return default values for this object based on the starting data.
+
($xhtml, [$xhtml_padding]) = EPrints::DataObj::History::render_domtree( $session, $tree, $indent, $make_padded, $width )
 +
Returns a rendering of the given tree as XHTML (showing the actual XML  structure).
  
<!-- End of Pod2Wiki -->
+
If <tt>$make_padded</tt> is <tt>true</tt> then also generate another element,  which is empty but the same height to be used in the other column to  keep things level.
<!-- Pod2Wiki=item_render -->==render==
 
  
  $xhtml = $history-&gt;render
+
<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 -->
  
Render this change as XHTML DOM.
 
  
<!-- End of Pod2Wiki -->
+
<!-- Pod2Wiki= -->
<!-- Pod2Wiki=item_get_dataobj -->==get_dataobj==
+
</div>
 +
<!-- Pod2Wiki=item_diff -->
 +
====diff====
  
  $object = $history-&gt;get_dataobj
+
$boolean = EPrints::DataObj::History::diff( $tree1, $tree2 )
 +
Returns <tt>true</tt> if the XML trees <tt>$tree1</tt> and <tt>$tree2</tt> are not the  same, otherwise returns <tt>false</tt>.
  
Returns the object to which this history event relates.
+
<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=item_get_user -->==get_user==
 
  
  $user = $history-&gt;get_user
+
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=item_mktext -->
 +
====mktext====
  
Returns the user object of the user who caused this event.
+
@lines = EPrints::DataObj::History::mktext( $session, $text, $offset, $endw, $width )
 +
Returns the <tt>$text</tt> string broken into an array of lines which are <tt>$width</tt> long or less.
  
<!-- End of Pod2Wiki -->
+
Inserts a 90 degree arrow at the end of each broken line to indicate that it has been broken.
<!-- Pod2Wiki=head_undocumented_methods -->=UNDOCUMENTED METHODS=
 
{{API:Undocumented Methods}}<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=item_create -->==create==
 
  
<!-- 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_diff -->==diff==
+
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
  
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=item_empty_tree -->==empty_tree==
 
  
<!-- End of Pod2Wiki -->
+
<!-- Pod2Wiki= -->
<!-- Pod2Wiki=item_mkpad -->==mkpad==
+
</div>
 +
<!-- Pod2Wiki=item_mkpad -->
 +
====mkpad====
  
<!-- End of Pod2Wiki -->
+
$xhtml = EPrints::DataObj::History::mkpad( $session, $text, $offset, $endw, $width )
<!-- Pod2Wiki=item_mktext -->==mktext==
+
Return XHTML DOM of vertical padding equivalent to the lines that would  be needed to render <tt>$text</tt>.
  
<!-- 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_render_citation -->==render_citation==
+
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
  
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=item_render_create -->==render_create==
 
  
<!-- End of Pod2Wiki -->
+
<!-- Pod2Wiki= -->
<!-- Pod2Wiki=item_render_modify -->==render_modify==
+
</div>
 +
<!-- Pod2Wiki=head_see_also -->
 +
==SEE ALSO==
 +
[[API:EPrints/DataObj/SubObject|EPrints::DataObj::SubObject]], [[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=item_render_removal_request -->==render_removal_request==
+
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
  
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=item_render_with_details -->==render_with_details==
 
  
<!-- End of Pod2Wiki -->
+
<!-- Pod2Wiki= -->
<!-- Pod2Wiki=item_render_xml -->==render_xml==
+
</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=item_render_xml_diffs -->==render_xml_diffs==
 
  
<!-- End of Pod2Wiki -->
+
<!-- Pod2Wiki= -->
<!-- Pod2Wiki=_postamble_ --><!-- End of Pod2Wiki -->
+
</div>
 +
<!-- Pod2Wiki=_postamble_ --><!-- Edit below this comment -->

Latest revision as of 17:05, 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::History - An element in the history of the archive.

User Comments


DESCRIPTION

This class describes a single item in the history dataset. A history object describes a single action taken on a single item in another dataset.

This class inherits from EPrints::DataObj::SubObject, which in turn inherits from EPrints::DataObj.

Changes to document are considered part of changes to the eprint it belongs to.

User Comments


CORE METADATA FIELDS

User Comments


historyid (counter)

The unique numerical ID of this history event.

User Comments


actor (text)

A text representation of the actor reponsible for the action for this history event. This may be the name of a script or application or a user's name.

User Comments


datasetid (id)

The name of the dataset to which the modified item belongs. eprint is used for eprints, rather than the inbox, buffer etc.

User Comments


objectid (int)

The numerical ID of the object in the dataset.

User Comments


revision (int)

The revision of the object. This is the revision number after the action occured. Not all actions increase the revision number.

User Comments


timestamp (timestamp)

The moment at which this thing happened.

User Comments


action (set)

The type of event. Provisionally, this is a subset of the new list of privileges.

User Comments


details (longtext)

If this is a rejection then the details contain the message sent to the user.

User Comments


REFERENCES AND RELATED OBJECTS

User Comments


userid (itemref)

The ID of the user who caused this event. A value of zero or undefined indicates that there was no user responsible (ie. a script did it).

User Comments


INSTANCE VARIABLES

See EPrints::DataObj.

User Comments


METHODS

User Comments


Constructor Methods

User Comments


create

EPrints::DataObj::History::create( $session, $data );

Create a new history data object from this $data. Unlike other create methods this one does not return the new object as it is never needed, and would increase the load when modifying other data objects.

Also, this does not queue the fields for indexing.

User Comments


Class Methods

User Comments


get_system_field_info

$field_info = EPrints::DataObj::History->get_system_field_info

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

User Comments


get_dataset_id

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

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

User Comments


Object Methods

User Comments


commit

$history->commit 

History cannot be altered. So if somehow this is called it just logs a warning message.

User Comments


remove

$history->remove

History cannot be removed. So if somehow this is called it just logs a warning message.

User Comments


get_defaults

$defaults = EPrints::DataObj::History->get_defaults( $session, $data, [ $dataset ] )

Returns default values for this history data object based on the starting $data and for ths $dataset if specified.

User Comments


render

$xhtml = $history->render

Return a rendering of this history event as XHTML DOM.

User Comments


get_dataobj

$object = $history->get_dataobj

Returns the data object to which this history event relates.

User Comments


get_user

$user = $history->get_user

Returns the user data object of the user who caused this history event.

User Comments


get_previous

$history = $history->get_previous

Returns the previous history event for this history event's data object.

Returns undef if no such history event exists.

User Comments


render_removal_request

$xhtml = $history->render_removal_request

Returns a XHTML DOM rendering of a removal request history event.

User Comments


render_with_details

$xhtml = $history->render_with_details

Returns a XHTML DOM rendering of a mail_owner (i.e. email was sent to the owner of the data object) history event.

User Comments


render_create

$xhtml = $history->render_create( $action )

Returns a XHTML DOM rendering of a create history event.

User Comments


render_modify

$xhtml = $history->render_modify( $action )

Returns a XHTML DOM rendering of a modify history event.

User Comments


set_dataobj_xml

$history->set_dataobj_xml( $dataobj )

Stores the XML serialisation for $dataobj to a file.

User Comments


Utility Methods

User Comments


empty_tree

$boolean = EPrints::DataObj::History::empty_tree( $domtree )

Returns true if there is no text in the XHTML $domtree other than whitespace. Otherwise, returns false.

This method is liable to being moveded to EPrints::XML> or EPrints::Utils.

User Comments


render_xml_diffs

( $f1, $f2 ) = EPrints::DataObj::History::render_xml_diffs( $tree1, $tree2, $indent, $width )

Returns two XHTML DOM trees. The first for the older version, highlighting lines that are changed or removed and the second for the newer version, highlighting libes that are changed or added.

User Comments


render_domtree

($xhtml, [$xhtml_padding]) = EPrints::DataObj::History::render_domtree( $session, $tree, $indent, $make_padded, $width )

Returns a rendering of the given tree as XHTML (showing the actual XML structure).

If $make_padded is true then also generate another element, which is empty but the same height to be used in the other column to keep things level.

User Comments


diff

$boolean = EPrints::DataObj::History::diff( $tree1, $tree2 )

Returns true if the XML trees $tree1 and $tree2 are not the same, otherwise returns false.

User Comments


mktext

@lines = EPrints::DataObj::History::mktext( $session, $text, $offset, $endw, $width )

Returns the $text string broken into an array of lines which are $width long or less.

Inserts a 90 degree arrow at the end of each broken line to indicate that it has been broken.

User Comments


mkpad

$xhtml = EPrints::DataObj::History::mkpad( $session, $text, $offset, $endw, $width )

Return XHTML DOM of vertical padding equivalent to the lines that would be needed to render $text.

User Comments


SEE ALSO

EPrints::DataObj::SubObject, EPrints::DataObj and EPrints::DataSet.

User Comments


COPYRIGHT

© Copyright 2023 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