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

From EPrints Documentation
Jump to: navigation, search
 
(16 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
<!-- Pod2Wiki=_preamble_  
 
<!-- Pod2Wiki=_preamble_  
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.
+
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.
  -->{{API}}{{Pod2Wiki}}{{API:Source|file=EPrints/DataObj/EPrint.pm|package_name=EPrints::DataObj::EPrint}}[[Category:API|EPrint]]<div><!-- Edit below this comment -->
+
  -->{{API}}{{Pod2Wiki}}{{API:Source|file=EPrints/DataObj/EPrint.pm|package_name=EPrints::DataObj::EPrint}}[[Category:API|EPRINT]][[Category:API:EPrints/DataObj|EPRINT]]<div><!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki=_private_ --><!-- Pod2Wiki=head_name -->
 
<!-- Pod2Wiki=_private_ --><!-- Pod2Wiki=head_name -->
 
==NAME==
 
==NAME==
'''EPrints::DataObj::EPrint''' - Class representing an actual EPrint
+
'''EPrints::DataObj::EPrint''' - The actual publication record.
  
 
<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 17: Line 17:
 
<!-- Pod2Wiki=head_description -->
 
<!-- Pod2Wiki=head_description -->
 
==DESCRIPTION==
 
==DESCRIPTION==
This class represents a single eprint record and the metadata  associated with it. This is associated with one of more  EPrint::Document objects.
+
This class represents a single eprint record and the metadata  associated with it. This is associated with one of more  {{API:PodLink|file=EPrint/DataObj/Document|package_name=EPrint::DataObj::Document|section=|text=EPrint::DataObj::Document}} objects.
  
EPrints::DataObj::EPrint is a subclass of EPrints::DataObj with the following metadata fields (plus those defined in ArchiveMetadataFieldsConfig):
+
This class is has the following 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%; '>
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
Line 28: Line 28:
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
 
</div>
 
</div>
<!-- Pod2Wiki=head_system_metadata -->
+
<!-- Pod2Wiki=head_core_metadata_fields -->
==SYSTEM METADATA==
+
==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%; '>
 
<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 61: Line 61:
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
 
</div>
 
</div>
<!-- Pod2Wiki=item_userid -->
+
<!-- Pod2Wiki=item_eprint_status -->
===userid (itemref)===
+
===eprint_status (set)===
 +
 
 +
The current status of the eprint record. By default this must be one  of: <tt>inbox</tt>, <tt>buffer</tt>, <tt>archive</tt>, <tt>deleted</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_source -->
 +
===source (text)===
  
The id of the user who deposited this eprint (if any). Scripted importing could cause this not to be set.
+
Stores an identifier for the source of this record. Rarely used.
  
 
<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 76: Line 88:
 
===dir (text)===
 
===dir (text)===
  
The directory, relative to the documents directory for this repository, which this eprints data is stored in. Eg. disk0/00/00/03/34 for record 334.
+
The directory, relative to the documents directory for this repository, which this eprints data is stored in. E.g.  <tt>disk0/00/00/03/34</tt> for record 334.  This cannot be cloned or imported.
  
 
<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 100: Line 112:
 
===lastmod (time)===
 
===lastmod (time)===
  
The date this record was last modified.
+
The date this record was last modified.  This cannot be imported.
  
 
<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 109: Line 121:
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
 
</div>
 
</div>
<!-- Pod2Wiki=item_status_changes -->
+
<!-- Pod2Wiki=item_status_changed -->
===status_changes (time)===
+
===status_changed (time)===
  
The date/time this record was moved between inbox, buffer, archive, etc.
+
The date/time this record was moved between statuses (see <tt>eprint_status</tt>). This cannot be imported.
  
 
<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 125: Line 137:
  
 
The type of this record, one of the types of the "eprint" dataset.
 
The type of this record, one of the types of the "eprint" 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_metadata_visibility -->
 +
===metadata_visibility (set)===
 +
 +
This field is automatically set.
 +
 +
show - appears normally
 +
no_search - hidden from search/views
 +
 
 +
The <tt>hide</tt> option may be used to force an eprint to not appear in search/views but is not considered a stable option.
 +
 +
<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_fileinfo -->
 +
===fileinfo (longtext)===
 +
 +
Stores a serialisation of the files including paths associated with the 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_item_issues -->
 +
===item_issues (compound, multiple)===
 +
 +
Stores any issues with the metadata for this record, which were reorted by a user  of generated by running <tt>bin/issues_audit</tt>.  Contains the following sub-fields:
 +
 +
id (id) - The unique ID of the issue.
 +
type (id) - The type of issue. (E.g. duplicate title, similar title, etc.)
 +
description (longtext) - A description of the issue that can be rendered to the user.
 +
timestamp (time) - The time the issue was detected.
 +
status (set) - The status of the issue, i.e. the progress on its resolution.
 +
reported_by (itemref) - The user who reported the issue.
 +
resolved_by (itemref) - The user who resolved the issue.
 +
comment (longtext) - Comments about the issue and/or the progress of its resolution.
 +
 +
<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_item_issues_count -->
 +
===item_issues_count (int)===
 +
 +
The current number of issues with the record.  This field is volatile. =back
 +
 +
<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_edit_lock -->
 +
===edit_lock (compound)===
 +
 +
Stores information about any edit lock on the record to prevent other users from editing it.  Contains the following sub-fields:
 +
user (itemref) - The user holding the edit lock
 +
since (int) - Time in seconds since the start of the last epoch when the edit lock begun.
 +
until (int) - Time in seconds since the start of the last epoch when the edit lock will be released if the user does not otherwise release 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=item_template -->
 +
===template (namedset)===
 +
 +
The name of the template to use for displaying the abstract/summary page.
 +
 +
<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_documents -->
 +
===documents (subobject, multiple)===
 +
 +
A virtual field which represents the list of documents which are part of this 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_files -->
 +
===files (subobject, multiple)===
 +
 +
A virtual field which represents the list of files which are part of this 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_userid -->
 +
===userid (itemref)===
 +
 +
The ID of the user who deposited this eprint (if any). Scripted importing could cause this not to be set.
 +
 +
<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_importid -->
 +
===importid (itemref)===
 +
 +
The ID of the import from which this eprint was imported. (Rarely used).
 +
 +
<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_sword_depositor -->
 +
===sword_depositor (itemref)===
 +
 +
The ID of the user who deposited this eprint through EPrints  {{API:PodLink|file=http:|package_name=http:|section=|text=SWORD API}}.
  
 
<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 136: Line 306:
 
===succeeds (itemref)===
 
===succeeds (itemref)===
  
The ID of the eprint (if any) which this succeeds.  This field should have been an int and may be changed in a later upgrade.
+
The ID of the eprint (if any) which this succeeds.
  
 
<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 148: Line 318:
 
===commentary (itemref)===
 
===commentary (itemref)===
  
The ID of the eprint (if any) which this eprint is a commentary on.  This  field should have been an int and may be changed in a later upgrade.
+
The ID of the eprint (if any) which this eprint is a commentary on.
  
 
<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 157: Line 327:
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
 
</div>
 
</div>
<!-- Pod2Wiki=item_replacedby -->
+
<!-- Pod2Wiki=head_instance_variables -->
===replacedby (itemref)===
+
==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%; '>
 +
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
  
The ID of the eprint (if any) which has replaced this eprint. This is only set on records in the "deletion" dataset.  This field should have been an int and may be changed in a later upgrade.
+
 
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=item_$self->{user} -->
 +
===$self-&gt;{user}===
 +
 
 +
The user who is owner of this eprint data object.
  
 
<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 171: Line 352:
 
<!-- Pod2Wiki=head_methods -->
 
<!-- Pod2Wiki=head_methods -->
 
==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====
 +
 +
$eprint = EPrints::DataObj::EPrint-&gt;create( $session, $dataset, $data )
 +
Create a new EPrint entry in the given <tt>$dataset</tt>..
 +
 +
If <tt>$data</tt> is defined, then this is used as the base for the new  record. Otherwise the repository specific defaults provided by
 +
[[API:EPrints/DataObj/EPrint#set_eprint_defaults|set_eprint_defaults]] are used.
 +
 +
The fields <tt>eprintid</tt> and <tt>dir</tt> will be overridden even if they are  set.
 +
 +
<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====
 +
 +
$dataobj = EPrints::DataObj::EPrint-&gt;create_from_data( $session, $data, $dataset )
 +
Create a new object of this type in the database.
 +
 +
<tt>$datase</tt>t 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 also create sub-objects also.
 +
 +
<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%; '>
 
<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 179: Line 415:
 
</div>
 
</div>
 
<!-- Pod2Wiki=item_get_system_field_info -->
 
<!-- Pod2Wiki=item_get_system_field_info -->
===get_system_field_info===
+
====get_system_field_info====
  
  $metadata = EPrints::DataObj::EPrint-&gt;get_system_field_info
+
  $fields = EPrints::DataObj::EPrint-&gt;get_system_field_info
Return an array describing the system metadata of the EPrint dataset.
+
Return an array describing the system metadata of the eprint 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::EPrint-&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::EPrint-&gt;get_defaults( $class, $session, $data, $dataset )
 +
Returns default values for this data 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=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%; '>
 
<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 192: Line 463:
 
</div>
 
</div>
 
<!-- Pod2Wiki=item_set_item_issues -->
 
<!-- Pod2Wiki=item_set_item_issues -->
===set_item_issues===
+
====set_item_issues====
  
 
  $eprint-&gt;set_item_issues( $new_issues )
 
  $eprint-&gt;set_item_issues( $new_issues )
This method updates the issues attached to this eprint based on the new issues passed.
+
This method updates the issues associated to this eprint based on the <tt>$new_issues</tt> passed.
  
If an existing issue is set as "discovered" and doesn't exist in $new_issues its status will be updated to "autoresolved", otherwise the old issue's status and description are updated.
+
If an existing issue is set as <tt>discovered</tt> and doesn't exist in <tt>$new_issues</tt> its status will be updated to <tt>autoresolved</tt>, otherwise the old issue's status and description are updated.
  
Any issues in $new_issues that don't already exist will be appended.
+
Any issues in <tt>$new_issues</tt> that don't already exist will be appended.
  
 
<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 209: Line 480:
 
</div>
 
</div>
 
<!-- Pod2Wiki=item_fileinfo -->
 
<!-- Pod2Wiki=item_fileinfo -->
===fileinfo===
+
====fileinfo====
  
  $eprint-&gt;fileinfo()
+
  $fileinfo = $eprint-&gt;fileinfo
The special '''fileinfo''' field contains the icon URL and main-file URL for each non-volatile document in the eprint. This is a performance tweak to avoid having to retrieve documents when rendering eprint citations.
+
The special '''fileinfo''' field contains the icon and main file paths  and filenames for each non-volatile document in the eprint. This is a performance tweak to avoid having to retrieve documents when rendering eprint citations.
  
 
Example:
 
Example:
  
  /style/images/fileicons/application_pdf.png;/20/1/paper.pdf|/20/4.hassmallThumbnailVersion/tdb_portrait.jpg;/20/4/tdb_portrait.jpg
+
/style/images/fileicons/application_pdf.png;/20/1/paper.pdf|/20/4.hassmallThumbnailVersion/tdb_portrait.jpg;/20/4/tdb_portrait.jpg
 
    
 
    
These URLs are relative to the current repository base path ('http_url').
 
 
 
<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 227: Line 496:
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
 
</div>
 
</div>
<!-- Pod2Wiki=item_get_dataset_id -->
+
<!-- Pod2Wiki=item_update_triggers -->
===get_dataset_id===
+
====update_triggers====
  
  $dataset = EPrints::DataObj::EPrint-&gt;get_dataset_id
+
  $eprint-&gt;update_triggers
Returns the id of the [[API:EPrints/DataSet|EPrints::DataSet]] object to which this record belongs.
+
Update all the stuff that needs updating before an eprint data object is written to the database.
  
 
<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 241: Line 510:
 
</div>
 
</div>
 
<!-- Pod2Wiki=item_get_dataset -->
 
<!-- Pod2Wiki=item_get_dataset -->
===get_dataset===
+
====get_dataset====
  
 
  $dataset = $eprint-&gt;get_dataset
 
  $dataset = $eprint-&gt;get_dataset
Return the dataset to which this object belongs. This will return one of the virtual datasets: inbox, buffer, archive or deletion.
+
Returns the dataset to which this object belongs. This will return one of the virtual datasets, by default: <tt>inbox</tt>, <tt>buffer</tt>, <tt>archive</tt> or <tt>deletion</tt>.
  
 
<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 253: Line 522:
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
 
</div>
 
</div>
<!-- Pod2Wiki=item_get_defaults -->
+
<!-- Pod2Wiki=item_store_path -->
===get_defaults===
+
====store_path====
  
  $defaults = EPrints::DataObj::EPrint-&gt;get_defaults( $session, $data )
+
  $path = $eprint-&gt;store_path
Return default values for this object based on the starting data.
+
Get the storage path for this eprint data object.
  
 
<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 267: Line 536:
 
</div>
 
</div>
 
<!-- Pod2Wiki=item_clone -->
 
<!-- Pod2Wiki=item_clone -->
===clone===
+
====clone====
  
 
  $eprint = $eprint-&gt;clone( $dest_dataset, $copy_documents, $link )
 
  $eprint = $eprint-&gt;clone( $dest_dataset, $copy_documents, $link )
Create a copy of this EPrint with a new ID in the given dataset. Return the new eprint, or undef in the case of an error.
+
Create a copy of this eprint data object with a new ID in the given <tt>$dest_dataset</tt>.  
 +
 
 +
Returns the new eprint, or <tt>undef</tt> in the case of an error.
  
If $copy_documents is set and true then the documents (and files) will be copied in addition to the metadata.
+
If <tt>$copy_documents</tt> is set and <tt>true</tt> then the documents (and files) will be copied in addition to the metadata.
  
If $nolink is true then the new eprint is not connected to the old one.
+
If <tt>$nolink</tt> is <tt>true</tt> then the new eprint is not connected to the old one by not setting the new eprint's <tt>succeeds</tt> field.
  
 
<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 284: Line 555:
 
</div>
 
</div>
 
<!-- Pod2Wiki=item_log_mail_owner -->
 
<!-- Pod2Wiki=item_log_mail_owner -->
===log_mail_owner===
+
====log_mail_owner====
  
 
  $eprint-&gt;log_mail_owner( $mail )
 
  $eprint-&gt;log_mail_owner( $mail )
Log that the given mail message was send to the owner of this EPrint.
+
Log that the given <tt>$mail</tt> message was sent to the owner of this eprint data object.
  
$mail is the same XHTML DOM that was sent as the email.
+
<tt>$mail</tt> is the same XHTML DOM that was sent as the email.
  
 
<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 299: Line 570:
 
</div>
 
</div>
 
<!-- Pod2Wiki=item_get_editorial_contact -->
 
<!-- Pod2Wiki=item_get_editorial_contact -->
===get_editorial_contact===
+
====get_editorial_contact====
  
 
  $user = $eprint-&gt;get_editorial_contact
 
  $user = $eprint-&gt;get_editorial_contact
Return the user identified as the editorial contact for this item.
+
Returns the user identified as the editorial contact for this item.
  
By default returns undef.
+
By default returns <tt>undef</tt>.
  
nb. This has nothing to do with the editor defined in the metadata
+
N.B. This does no relate to any editors defined in the metadata for this eprint data object.
 +
 
 +
<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_empty -->
 +
====empty====
 +
 
 +
$eprint-&gt;empty( [ $clear_all ] )
 +
Remove all documents and set to empty (almost) all fields.
 +
 
 +
If <tt>$clear_all</tt> also unset <tt>rev_number</tt>, <tt>metadata_visibility</tt>, and <tt>eprint_status</tt> fields.
  
 
<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 316: Line 602:
 
</div>
 
</div>
 
<!-- Pod2Wiki=item_remove -->
 
<!-- Pod2Wiki=item_remove -->
===remove===
+
====remove====
  
 
  $success = $eprint-&gt;remove
 
  $success = $eprint-&gt;remove
Erase this eprint and any associated records from the database and filesystem.
+
Erase this eprint data object and any associated data objects from the database and filesystem.
  
This should only be called on eprints in "inbox" or "buffer".
+
This should only be called on eprints in <tt>inbox</tt> or <tt>buffer</tt>.
  
 
<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 331: Line 617:
 
</div>
 
</div>
 
<!-- Pod2Wiki=item_commit -->
 
<!-- Pod2Wiki=item_commit -->
===commit===
+
====commit====
 +
 
 +
$success = $eprint-&gt;commit( [ $force ] );
 +
Commit any changes to the database.
 +
 
 +
Calls [[API:EPrints/DataObj/EPrint#update_triggers|update_triggers]] just before the database is updated.
 +
 
 +
The actions this method does are dependent on some object attributes:
 +
 
 +
  changed - hash of changed fields (from [[API:EPrints/DataObj|EPrints::DataObj]])
 +
  non_volatile_change - boolean (from [[API:EPrints/DataObj|EPrints::DataObj]])
 +
  under_construction - boolean
 +
 
 +
If <tt>datestamp</tt> is unset and this eprint is in the <tt>archive</tt> dataset  <tt>datestamp</tt> will always be set which will in turn set <tt>datestamp</tt> as  changed.
  
$success = $eprint-&gt;commit( [$force] );
+
If no field values were changed and <tt>$force</tt> is false returns.
Commit any changes that might have been made to the database.
 
  
If the item has not be changed then this function does nothing unless $force is true.
+
If <tt>under_construction</tt> is <tt>false</tt>:
 +
- static files updated
  
Calls {{API:PodLink|file=|package_name=|section=set_eprint_automatic_fields|text=/set_eprint_automatic_fields}} just before the <tt>$eprint</tt> is committed.
+
If <tt>non_volatile_change</tt> is <tt>true</tt>:
 +
- '''lastmod''' field updated
 +
- triples update queued
 +
 
 +
If <tt>under_construction</tt> is <tt>false</tt> and <tt>non_volatile_change</tt> is  <tt>true</tt>:
 +
- revision generated
 +
 
 +
The goal of these controls is to only trigger expensive processes in  response to user actions. Revisions need to be generated when the user  changes metadata or uploads new files (see  [[API:EPrints/DataObj/Document#commit|EPrints::DataObj::Document#commit]]).
  
 
<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 347: Line 653:
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
 
</div>
 
</div>
<!-- Pod2Wiki=item_write_revision -->
+
<!-- Pod2Wiki=item_save_revision -->
===write_revision===
+
====save_revision====
  
  $eprint-&gt;write_revision
+
  $eprint-&gt;save_revision( %opts )
Write out a snapshot of the XML describing the current state of the eprint.
+
Increase the eprint revision number and save a complete copy of the record into the history (see [[API:EPrints/DataObj/History|EPrints::DataObj::History]]).
  
 +
Options:
 +
 +
  user - user that caused the action to occur, defaults to current user
 +
  action - see history.action, defaults to "modify"
 +
  details - see history.details, defaults to a description of changed fields
 +
 
 
<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 361: Line 673:
 
</div>
 
</div>
 
<!-- Pod2Wiki=item_validate -->
 
<!-- Pod2Wiki=item_validate -->
===validate===
+
====validate====
  
 
  $problems = $eprint-&gt;validate( [$for_archive], $workflow_id )
 
  $problems = $eprint-&gt;validate( [$for_archive], $workflow_id )
Return a reference to an array of XHTML DOM objects describing validation problems with the entire eprint based on $workflow_id.
+
Return a reference to an array of XHTML DOM objects describing validation problems with the entire eprint based on <tt>$workflow_id</tt>.
  
If $workflow_id is undefined defaults to "default".
+
If <tt>$workflow_id</tt> is undefined defaults to <tt>default</tt>.
  
 
A reference to an empty array indicates no problems.
 
A reference to an empty array indicates no problems.
  
Calls {{API:PodLink|file=|package_name=|section=validate_eprint|text=/validate_eprint}} for the <tt>$eprint</tt>.
+
Calls [[API:EPrints/DataObj/EPrint#validate_eprint|validate_eprint]] for the <tt>$eprint</tt>.
  
 
<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 380: Line 692:
 
</div>
 
</div>
 
<!-- Pod2Wiki=item_skip_validation -->
 
<!-- Pod2Wiki=item_skip_validation -->
===skip_validation===
+
====skip_validation====
  
 
  $boolean = $eprint-&gt;skip_validation
 
  $boolean = $eprint-&gt;skip_validation
Returns true if this eprint should pass validation without being properly validated. This is to allow the use of dodgey data imported from legacy systems.
+
Returns <tt>true</tt> if this eprint should pass validation without being properly validated. This is to allow the use of dodgy data imported from legacy systems.
  
 
<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 393: Line 705:
 
</div>
 
</div>
 
<!-- Pod2Wiki=item_prune_documents -->
 
<!-- Pod2Wiki=item_prune_documents -->
===prune_documents===
+
====prune_documents====
  
 
  $eprint-&gt;prune_documents
 
  $eprint-&gt;prune_documents
Remove any documents associated with this eprint which don't actually have any files.
+
Remove any documents associated with this eprint that do not actually have any files.
  
 
<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 406: Line 718:
 
</div>
 
</div>
 
<!-- Pod2Wiki=item_get_all_documents -->
 
<!-- Pod2Wiki=item_get_all_documents -->
===get_all_documents===
+
====get_all_documents====
  
 
  @documents = $eprint-&gt;get_all_documents
 
  @documents = $eprint-&gt;get_all_documents
Return an array of all EPrint::Document objects associated with this eprint.
+
Return a list of all [[API:EPrints/DataObj/Document|EPrints::DataObj::Document]] objects associated with this eprint excluding documents with a <tt>isVolatileVersionOf</tt> relation, (e.g. thumbnails).
 
 
<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_required_formats -->
 
===required_formats===
 
 
 
@formats =  $eprint-&gt;required_formats
 
Return a list of the required formats for this  eprint. Only one of the required formats is required, not all.
 
 
 
An empty list means no format is required.
 
  
 
<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 434: Line 731:
 
</div>
 
</div>
 
<!-- Pod2Wiki=item_move_to_deletion -->
 
<!-- Pod2Wiki=item_move_to_deletion -->
===move_to_deletion===
+
====move_to_deletion====
  
 
  $success = $eprint-&gt;move_to_deletion
 
  $success = $eprint-&gt;move_to_deletion
Transfer the EPrint into the "deletion" dataset. Should only be called in eprints in the "archive" dataset.
+
Transfer the eprint into the <tt>deletion</tt> dataset. Should only be called by eprints in the <tt>archive</tt> 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%; '>
Line 447: Line 744:
 
</div>
 
</div>
 
<!-- Pod2Wiki=item_move_to_inbox -->
 
<!-- Pod2Wiki=item_move_to_inbox -->
===move_to_inbox===
+
====move_to_inbox====
  
 
  $success = $eprint-&gt;move_to_inbox
 
  $success = $eprint-&gt;move_to_inbox
Transfer the EPrint into the "inbox" dataset. Should only be called in eprints in the "buffer" dataset.
+
Transfer the eprint into the <tt>inbox</tt> dataset. Should only be called for eprints in the <tt>buffer</tt> 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%; '>
Line 460: Line 757:
 
</div>
 
</div>
 
<!-- Pod2Wiki=item_move_to_buffer -->
 
<!-- Pod2Wiki=item_move_to_buffer -->
===move_to_buffer===
+
====move_to_buffer====
  
 
  $success = $eprint-&gt;move_to_buffer
 
  $success = $eprint-&gt;move_to_buffer
Transfer the EPrint into the "buffer" dataset. Should only be called in eprints in the "inbox" or "archive" dataset.
+
Transfer the eprint into the <tt>buffer</tt> dataset. Should only be called by eprints in the <tt>inbox</tt> or <tt>archive</tt> datasets.
  
 
<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 473: Line 770:
 
</div>
 
</div>
 
<!-- Pod2Wiki=item_move_to_archive -->
 
<!-- Pod2Wiki=item_move_to_archive -->
===move_to_archive===
+
====move_to_archive====
  
 
  $success = $eprint-&gt;move_to_archive
 
  $success = $eprint-&gt;move_to_archive
Move this eprint into the main "archive" dataset. Normally only called on eprints in "deletion" or "buffer" datasets.
+
Move this eprint into the main <tt>archive</tt> dataset. Normally only called on eprints in <tt>deletion</tt> or <tt>buffer</tt> datasets.
  
 
<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 486: Line 783:
 
</div>
 
</div>
 
<!-- Pod2Wiki=item_local_path -->
 
<!-- Pod2Wiki=item_local_path -->
===local_path===
+
====local_path====
  
 
  $path = $eprint-&gt;local_path
 
  $path = $eprint-&gt;local_path
Return the full path of the EPrint directory on the local filesystem. No trailing slash.
+
Returns the full path of the eprint data onject directory on the local filesystem with no trailing slash.
  
 
<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 498: Line 795:
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
 
</div>
 
</div>
<!-- Pod2Wiki=item_url_stem -->
+
<!-- Pod2Wiki=item_path -->
===url_stem===
+
====path====
  
  $url = $eprint-&gt;url_stem
+
  $path = $eprint-&gt;path
Return the URL to this EPrint's directory. Note, this INCLUDES the trailing slash, unlike the local_path method.
+
Returns the full URL path of the eprint data object including a  trailing slash. E.g. <tt>1234/</tt>.
  
 
<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 511: Line 808:
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
 
</div>
 
</div>
<!-- Pod2Wiki=item_generate_static -->
+
<!-- Pod2Wiki=item_url_stem -->
===generate_static===
+
====url_stem====
  
  $eprint-&gt;generate_static
+
  $url = $eprint-&gt;url_stem
Generate the static version of the abstract web page. In a multi-language repository this will generate one version per language.
+
Returns the URL to this eprint's directory.  
  
If called on inbox or buffer, remove the abstract page.
+
N.B. This includes the trailing slash, unlike the local_path method.
  
 
<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 526: Line 823:
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
 
</div>
 
</div>
<!-- Pod2Wiki=item_generate_static_all_related -->
+
<!-- Pod2Wiki=item_generate_static -->
===generate_static_all_related===
+
====generate_static====
 +
 
 +
$eprint-&gt;generate_static
 +
Generate the static version of the abstract/summary web page. In a  multi-language repository this will generate one version per language.
  
$eprint-&gt;generate_static_all_related
+
If called on eprints in the <tt>inbox</tt> or <tt>buffer</tt>, remove the  abstract/summary page.
Generate the static pages for this eprint plus any it's related to, by succession or commentary.
 
  
 
<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 540: Line 839:
 
</div>
 
</div>
 
<!-- Pod2Wiki=item_remove_static -->
 
<!-- Pod2Wiki=item_remove_static -->
===remove_static===
+
====remove_static====
  
 
  $eprint-&gt;remove_static
 
  $eprint-&gt;remove_static
Line 553: Line 852:
 
</div>
 
</div>
 
<!-- Pod2Wiki=item_render -->
 
<!-- Pod2Wiki=item_render -->
===render===
+
====render====
  
  ( $description, $title, $links ) = $eprint-&gt;render
+
  ( $description, $title, $links ) = $eprint-&gt;render( $preview )
Render the eprint. The 3 returned values are references to XHTML DOM objects. $description is the public viewable description of this eprint that appears as the body of the abstract page. $title is the title of the abstract page for this eprint. $links is any elements which should go in the &lt;head&gt; of this page.
+
Render the eprint. If <tt>$preview</tt> is <tt>true</tt> then render a preview of the eprint data object
  
Calls {{API:PodLink|file=|package_name=|section=eprint_render|text=/eprint_render}} to actually render the <tt>$eprint</tt>, if it isn't deleted.
+
The 3 returned values are references to XHTML DOM objects. <tt>$description</tt> is the public viewable description of this  eprintthat appears as the body of the abstract page. <tt>$title</tt> is the title of the abstract page for this eprint. <tt>$links</tt> is any elements  which should go in the <tt>head</tt> elemeny of this HTML page.
 +
 
 +
Calls [[API:EPrints/DataObj/EPrint#eprint_render|eprint_render]] to actually render the <tt>$eprint</tt>, if it isn't in the <tt>deleted</tt> 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%; '>
Line 567: Line 868:
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
 
</div>
 
</div>
<!-- Pod2Wiki=item_render_history -->
+
<!-- Pod2Wiki=item_render_preview -->
===render_history===
+
====render_preview====
  
  ( $html ) = $eprint-&gt;render_history
+
  ( $description, $title, $links ) = $eprint-&gt;render_preview
Render the history of this eprint as XHTML DOM.
+
Render a preview version of this eprint.
 +
 
 +
See [[API:EPrints/DataObj/EPrint#render|render]] for more details
  
 
<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 581: Line 884:
 
</div>
 
</div>
 
<!-- Pod2Wiki=item_get_control_url -->
 
<!-- Pod2Wiki=item_get_control_url -->
===get_control_url===
+
====get_control_url====
  
 
  $url = $eprint-&gt;get_control_url
 
  $url = $eprint-&gt;get_control_url
Line 594: Line 897:
 
</div>
 
</div>
 
<!-- Pod2Wiki=item_get_url -->
 
<!-- Pod2Wiki=item_get_url -->
===get_url===
+
====get_url====
  
 
  $url = $eprint-&gt;get_url
 
  $url = $eprint-&gt;get_url
Return the public URL of this eprints abstract page.  
+
Return the public URL of this eprints abstract/summary page.  
  
 
<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 607: Line 910:
 
</div>
 
</div>
 
<!-- Pod2Wiki=item_get_user -->
 
<!-- Pod2Wiki=item_get_user -->
===get_user===
+
====get_user====
  
 
  $user = $eprint-&gt;get_user
 
  $user = $eprint-&gt;get_user
Return the EPrints::User to whom this eprint belongs (if any).
+
Return the [[API:EPrints/DataObj/User|EPrints::DataObj::User]] to whom this eprint belongs (if any).
  
 
<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 619: Line 922:
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
 
</div>
 
</div>
<!-- Pod2Wiki=item_get_all_related -->
+
<!-- Pod2Wiki=item_later_in_thread -->
===get_all_related===
+
====later_in_thread====
  
  @eprints = $eprint-&gt;get_all_related
+
  $list = $eprint-&gt;later_in_thread( $field )
Return the eprints that are related in some way to this in a succession or commentary thread. The returned list does NOT include this EPrint.
+
Return an [[API:EPrints/List|EPrints::List]] of the immediately later items in the  thread.  
 +
 
 +
<tt>$field</tt> is typically the <tt>succeeds</tt> field that generates the thread  of eprints.
  
 
<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 633: Line 938:
 
</div>
 
</div>
 
<!-- Pod2Wiki=item_in_thread -->
 
<!-- Pod2Wiki=item_in_thread -->
===in_thread===
+
====in_thread====
  
 
  $boolean = $eprint-&gt;in_thread( $field )
 
  $boolean = $eprint-&gt;in_thread( $field )
Return true if this eprint is part of a thread of $field. $field should be an EPrint::MetaField representing either "commentary" or "succeeds".
+
Returns <tt>true</tt> if this eprint is in the <tt>$field</tt> thread.
 +
 
 +
<tt>$field</tt> is typically the <tt>succeeds</tt> field that generates the thread  of eprints.
  
 
<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 646: Line 953:
 
</div>
 
</div>
 
<!-- Pod2Wiki=item_first_in_thread -->
 
<!-- Pod2Wiki=item_first_in_thread -->
===first_in_thread===
+
====first_in_thread====
  
 
  $eprint = $eprint-&gt;first_in_thread( $field )
 
  $eprint = $eprint-&gt;first_in_thread( $field )
 
Return the first (earliest) version or first paper in the thread of commentaries of this paper in the repository.
 
Return the first (earliest) version or first paper in the thread of commentaries of this paper in the repository.
 +
 +
<tt>$field</tt> is typically the <tt>succeeds</tt> field that generates the thread of eprints.
  
 
<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 658: Line 967:
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
 
</div>
 
</div>
<!-- Pod2Wiki=item_later_in_thread -->
+
<!-- Pod2Wiki=item_last_in_thread -->
===later_in_thread===
+
====last_in_thread====
 +
 
 +
$eprint = $eprint-&gt;last_in_thread( $field )
 +
Returns the latest item in the <tt>$field</tt> thread on this eprint's  branch of the thread tree.
  
@eprints = $eprint-&gt;later_in_thread( $field )
+
<tt>$field</tt> is typically the <tt>succeeds</tt> field that generates the thread of eprints.
Return a list of the immediately later items in the thread.  
 
  
 
<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 671: Line 982:
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
 
</div>
 
</div>
<!-- Pod2Wiki=item_all_in_thread -->
+
<!-- Pod2Wiki=item_removed_from_thread -->
===all_in_thread===
+
====removed_from_thread====
  
  @eprints = $eprint-&gt;all_in_thread( $field )
+
  $eprint-&gt;removed_from_thread( $field, [ $parent ] )
Return all of the EPrints in the given thread.
+
Fix the <tt>metadata_visibility</tt> for the eprint data object after it has  been removed from the <tt>$field</tt> (typically <tt>succeeds</tt>) based thread.
 +
 
 +
The change in <tt>$parent</tt> must be committed before this method is  called.
 +
 
 +
N.B. <tt>$parent</tt> (i.e. the eprint this eprint succeeds) is not required  for this method but included for consistency.
  
 
<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 684: Line 999:
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
 
</div>
 
</div>
<!-- Pod2Wiki=item_last_in_thread -->
+
<!-- Pod2Wiki=item_added_to_thread -->
===last_in_thread===
+
====added_to_thread====
 +
 
 +
$eprint-&gt;added_to_thread( $field, $parent )
 +
Fix the <tt>metadata_visibility</tt> for this eprint data object now the  has the <tt>$parent</tt> set in the <tt>$field</tt> (typically the <tt>succeeds</tt>  field).
  
$eprint = $eprint-&gt;last_in_thread( $field )
+
Does not update <tt>metadata_visibility</tt> if <tt>$parent</tt> is not in <tt>archive</tt>.
Return the last item in the specified thread.
 
  
 
<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 697: Line 1,014:
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
 
</div>
 
</div>
<!-- Pod2Wiki=item_remove_from_threads -->
+
<!-- Pod2Wiki=item_map_thread -->
===remove_from_threads===
+
====map_thread====
  
  $eprint-&gt;remove_from_threads
+
  $eprint-&gt;map_thread( $field, $f )
Extract the eprint from any threads it's in. i.e., if any other paper is a later version of or commentary on this paper, the link from that paper to this will be removed.
+
Apply function <tt>$f</tt> to every eprint data object in the <tt>$field</tt>  based thread that includes this eprint.
 
 
Abstract pages are updated if needed.
 
  
 
<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 713: Line 1,028:
 
</div>
 
</div>
 
<!-- Pod2Wiki=item_render_version_thread -->
 
<!-- Pod2Wiki=item_render_version_thread -->
===render_version_thread===
+
====render_version_thread====
  
 
  $xhtml = $eprint-&gt;render_version_thread( $field )
 
  $xhtml = $eprint-&gt;render_version_thread( $field )
Render XHTML DOM describing the entire thread as nested unordered lists.
+
Return XHTML DOM rendering describing the entire <tt>$field</tt> based  thread for this eprint data object as nested unordered lists.
  
 
<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 726: Line 1,041:
 
</div>
 
</div>
 
<!-- Pod2Wiki=item_loop_error -->
 
<!-- Pod2Wiki=item_loop_error -->
===loop_error===
+
====loop_error====
  
 
  $eprint-&gt;loop_error( $field, @looped_ids )
 
  $eprint-&gt;loop_error( $field, @looped_ids )
This eprint is part of a threading loop which is not allowed. Log a warning.
+
Log repository error message because this eprint is part of a loop of eprint data objects (with IDs <tt>looped_ids</tt>) in a <tt>$field</tt> based  thread.
  
 
<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 739: Line 1,054:
 
</div>
 
</div>
 
<!-- Pod2Wiki=item_get_type -->
 
<!-- Pod2Wiki=item_get_type -->
===get_type===
+
====get_type====
  
 
  $type = $eprint-&gt;get_type
 
  $type = $eprint-&gt;get_type
 
Return the type of this eprint.
 
Return the type of this eprint.
  
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
+
This is an alias of:
<span style='display:none'>User Comments</span>
 
<!-- Edit below this comment -->
 
 
 
 
 
<!-- Pod2Wiki= -->
 
</div>
 
<!-- Pod2Wiki=item_render_export_links -->
 
===render_export_links===
 
 
 
$xhtml_ul_list = $eprint-&gt;render_export_links( [$staff] )
 
Return a &lt;ul&gt; list containing links to all the formats this eprint is available in.
 
 
 
If $staff is true then show all formats available to staff, and link to the staff export URL.
 
  
 +
$eprint-&gt;value( "type" )
 +
 
 
<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 767: Line 1,071:
 
</div>
 
</div>
 
<!-- Pod2Wiki=item_user_roles -->
 
<!-- Pod2Wiki=item_user_roles -->
===user_roles===
+
====user_roles====
  
 
  @roles = $eprint-&gt;user_roles( $user )
 
  @roles = $eprint-&gt;user_roles( $user )
Return the @roles $user has on $eprint.
+
Return the roles the specified <tt>$user</tt> has for this eprint.
  
 
<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 780: Line 1,084:
 
</div>
 
</div>
 
<!-- Pod2Wiki=item_datestamp -->
 
<!-- Pod2Wiki=item_datestamp -->
===datestamp===
+
====datestamp====
  
 
  $eprint-&gt;datestamp
 
  $eprint-&gt;datestamp
DEPRECATED.
+
DEPRECATED
  
 +
Now just generates a deprecated error message to the log.  Use:
 +
 +
$eprint-&gt;value( 'datestamp' );
 +
 
 
<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 793: Line 1,101:
 
</div>
 
</div>
 
<!-- Pod2Wiki=item_in_editorial_scope_of -->
 
<!-- Pod2Wiki=item_in_editorial_scope_of -->
===in_editorial_scope_of===
+
====in_editorial_scope_of====
  
 
  $boolean = $eprint-&gt;in_editorial_scope_of( $possible_editor )
 
  $boolean = $eprint-&gt;in_editorial_scope_of( $possible_editor )
Returns true if $possible_editor can edit this eprint. This is according to the user editperms.  
+
Returns <tt>true</tt> if <tt>$possible_editor</tt> can edit this eprint. This is according to the user's <tt>editperms</tt>.  
  
This does not mean the user has the editor priv., just that if they do then they may edit the given item.
+
This does not mean the user has the editor privilege, just that if they do then they may edit the eprint.
  
 
<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 808: Line 1,116:
 
</div>
 
</div>
 
<!-- Pod2Wiki=item_has_owner -->
 
<!-- Pod2Wiki=item_has_owner -->
===has_owner===
+
====has_owner====
  
 
  $boolean = $eprint-&gt;has_owner( $possible_owner )
 
  $boolean = $eprint-&gt;has_owner( $possible_owner )
Returns true if $possible_owner can edit this eprint. This is according to the user editperms.  
+
Returns <tt>true</tt> if <tt>$possible_owner</tt> can edit this eprint. This is according to the user's <tt>editperms</tt>.  
  
This does not mean the user has the editor priv., just that if they do then they may edit the given item.
+
This does not mean the user has the editor privilege, just that if they do then they may edit the given eprint.
  
Uses the callback "does_user_own_eprint" if available.
+
Uses the callback <tt>does_user_own_eprint</tt> if available.
  
 
<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 825: Line 1,133:
 
</div>
 
</div>
 
<!-- Pod2Wiki=item_obtain_lock -->
 
<!-- Pod2Wiki=item_obtain_lock -->
===obtain_lock===
+
====obtain_lock====
  
 
  $boolean = $eprint-&gt;obtain_lock( $user )
 
  $boolean = $eprint-&gt;obtain_lock( $user )
 +
Assign the edit lock for this eprint data object to the specified <tt>$user</tt>.
 +
 +
Returns a boolean depending on whether the edit lock was successfully assigned.
 +
 +
<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_lock -->
 +
====remove_lock====
 +
 +
$boolean = $eprint-&gt;remove_lock( $user )
 +
Remove the edit lock for this eprint data object to the specified <tt>$user</tt>.
 +
 +
Returns a boolean depending on whether the edit lock was successfully removed.
 +
 
<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 836: Line 1,163:
 
</div>
 
</div>
 
<!-- Pod2Wiki=item_could_obtain_lock -->
 
<!-- Pod2Wiki=item_could_obtain_lock -->
===could_obtain_lock===
+
====could_obtain_lock====
  
 
  $boolean = $eprint-&gt;could_obtain_lock( $user )
 
  $boolean = $eprint-&gt;could_obtain_lock( $user )
 +
Return a boolean depending on whether the specified <tt>$user</tt> could  obtain ane edit lock on this eprint.
 +
 
<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 847: Line 1,176:
 
</div>
 
</div>
 
<!-- Pod2Wiki=item_is_locked -->
 
<!-- Pod2Wiki=item_is_locked -->
===is_locked===
+
====is_locked====
 +
 
 +
$boolean = $eprint-&gt;is_locked
 +
Return a boolean depending on whether this eprint currently has an  edit lock.
 +
 
 +
<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_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 -->
 +
 
 +
 
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=item_render_issues -->
 +
====render_issues====
 +
 
 +
$ol_frag = EPrints::DataObj::EPrint::render_issues( $session, $field, $value )
 +
Returns a rendering of the list of issues from <tt>$value</tt> array  reference (as a <tt>ol</tt> (ordered list) XHTML DOM fragment) for the  <tt>item_issues</tt> field provided by <tt>$field</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_order_issues_newest_open_timestamp -->
 +
====order_issues_newest_open_timestamp====
 +
 
 +
$timestamps = EPrints::DataObj::EPrint::order_issues_newest_open_timestamp( $field, $value, $session, $langid, $dataset )
 +
Returns a string containing the timestamp for the newest issue that  has <tt>status</tt> <tt>reported</tt> or <tt>discovered</tt>.
 +
 
 +
This method is called through the [[API:EPrints/MetaField|EPrints::MetaField]]  <tt>make_value_orderkey</tt> attribute.
 +
 
 +
<tt>$field</tt> is the <tt>item_issues</tt> field. <tt>$value</tt> is an array reference of the issues. <tt>$session</tt> is the [[API:EPrints/Repository|EPrints::Repository]] object,  <tt>$langid</tt> is the language ID and <tt>$dataset</tt> is the eprint 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_render_fileinfo -->
 +
====render_fileinfo====
 +
 
 +
$frag = EPrints::DataObj::EPrint::render_fileinfo( $session, $field, $value, $alllangs, $nolink, $eprint )
 +
Render method for fileinfo field. Returns a XHTML DOM fragment  containing the documents stored in the <tt>fileinfo</tt> field.
 +
 
 +
This method is called through the [[API:EPrints/MetaField|EPrints::MetaField]] <tt>render_value</tt> attribute.
 +
 
 +
<tt>$session</tt> is the [[API:EPrints/Repository|EPrints::Repository]] object. <tt>$field</tt> is the  <tt>fileinfo</tt> field. <tt>$value</tt> is the value for this field. <tt>$session</tt>  is the [[API:EPrints/Repository|EPrints::Repository]] object, <tt>$alllangs</tt> is a boolean to  render in all languages if an <tt>EPrints::MetaField::Multilang</tt> field.  <tt>$nolink</tt> is a boolean on whether to not render links. <tt>$eprint</tt> is  the eprint data object that has the <tt>fileinfo</tt> field.
 +
 
 +
<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_eprintid_to_path -->
 +
====eprintid_to_path====
 +
 
 +
$path = EPrints::DataObj::eprintid_to_path( $id )
 +
Returns path of the storage directory based on the eprint <tt>$id</tt>  provided.
 +
 
 +
<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_box_list -->
 +
====render_box_list====
 +
 
 +
$frag = EPrints::DataObj::EPrint::render_box_list( $session, $eprint, $list )
 +
Returns a rendering of the [[API:EPrints/Plugin/Screen/Box|EPrints::Plugin::Screen::Box]] plugins from <tt>$list</tt> against the <tt>$eprint</tt> specified
  
$boolean = $eprint-&gt;is_locked()
 
 
<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 858: Line 1,271:
 
</div>
 
</div>
 
<!-- Pod2Wiki=item_render_edit_lock -->
 
<!-- Pod2Wiki=item_render_edit_lock -->
===render_edit_lock===
+
====render_edit_lock====
 +
 
 +
$xhtml = EPrints::DataObj::EPrints::render_edit_lock( $session, $field, $value, $alllangs, $nolink, $eprint )
 +
Returns an XHTML DOM fragment providing information about the edit  lock for metadata provided by <tt>$value</tt>.
 +
 
 +
This is used by the <tt>render_value</tt> attribute of the <tt>edit_lock</tt>  field, which specified, the <tt>$session</tt>, <tt>$field</tt>, <tt>$value</tt>, <tt>$alllangs</tt>, <tt>$nolink</tt> and <tt>$eprint</tt> parameters.  However, only the <tt>$session</tt>, <tt>$field</tt>, <tt>$value</tt> and <tt>$eprint</tt> parameters are  required.
  
$xhtml = render_edit_lock( $session, $value )
 
 
<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 882: Line 1,299:
 
===validate_field===
 
===validate_field===
  
  validate_field( $field, $value, $session, [$for_archive] )
+
validate_field( $field, $value, $session, [$for_archive] )
 
    
 
    
 
<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 894: Line 1,311:
 
===validate_eprint===
 
===validate_eprint===
  
  validate_eprint( $eprint, $session, [$for_archive] )
+
validate_eprint( $eprint, $session, [$for_archive] )
 
    
 
    
 
<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 906: Line 1,323:
 
===set_eprint_defaults===
 
===set_eprint_defaults===
  
  set_eprint_defaults( $data, $session )
+
set_eprint_defaults( $data, $session )
 
    
 
    
 
<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 918: Line 1,335:
 
===set_eprint_automatic_fields===
 
===set_eprint_automatic_fields===
  
  set_eprint_automatic_fields( $eprint )
+
set_eprint_automatic_fields( $eprint )
 
+
 
<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 930: Line 1,347:
 
===eprint_render===
 
===eprint_render===
  
  eprint_render( $eprint, $session )
+
eprint_render( $eprint, $session )
 
    
 
    
See {{API:PodLink|file=ArchiveRenderConfig|package_name=ArchiveRenderConfig|section=eprint_render|text=ArchiveRenderConfig/eprint_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 -->
  
 +
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=head_see_also -->
 +
==SEE ALSO==
 +
[[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%; '>
 +
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- 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%; '>
 
<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>

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


Contents

NAME

EPrints::DataObj::EPrint - The actual publication record.

User Comments


DESCRIPTION

This class represents a single eprint record and the metadata associated with it. This is associated with one of more EPrint::DataObj::Document objects.

This class is has the following core metadata fields.

User Comments


CORE METADATA FIELDS

User Comments


eprintid (int)

The unique numerical ID of this eprint.

User Comments


rev_number (int)

The number of the current revision of this record.

User Comments


eprint_status (set)

The current status of the eprint record. By default this must be one of: inbox, buffer, archive, deleted.

User Comments


source (text)

Stores an identifier for the source of this record. Rarely used.

User Comments


dir (text)

The directory, relative to the documents directory for this repository, which this eprints data is stored in. E.g. disk0/00/00/03/34 for record 334. This cannot be cloned or imported.

User Comments


datestamp (time)

The date this record first appeared live in the repository.

User Comments


lastmod (time)

The date this record was last modified. This cannot be imported.

User Comments


status_changed (time)

The date/time this record was moved between statuses (see eprint_status). This cannot be imported.

User Comments


type (namedset)

The type of this record, one of the types of the "eprint" dataset.

User Comments


metadata_visibility (set)

This field is automatically set.

show - appears normally
no_search - hidden from search/views
 

The hide option may be used to force an eprint to not appear in search/views but is not considered a stable option.

User Comments


fileinfo (longtext)

Stores a serialisation of the files including paths associated with the record.

User Comments


item_issues (compound, multiple)

Stores any issues with the metadata for this record, which were reorted by a user of generated by running bin/issues_audit. Contains the following sub-fields:

id (id) - The unique ID of the issue.
type (id) - The type of issue. (E.g. duplicate title, similar title, etc.)
description (longtext) - A description of the issue that can be rendered to the user.
timestamp (time) - The time the issue was detected.
status (set) - The status of the issue, i.e. the progress on its resolution.
reported_by (itemref) - The user who reported the issue.
resolved_by (itemref) - The user who resolved the issue.
comment (longtext) - Comments about the issue and/or the progress of its resolution.

User Comments


item_issues_count (int)

The current number of issues with the record. This field is volatile. =back

User Comments


edit_lock (compound)

Stores information about any edit lock on the record to prevent other users from editing it. Contains the following sub-fields:

user (itemref) - The user holding the edit lock
since (int) - Time in seconds since the start of the last epoch when the edit lock begun.
until (int) - Time in seconds since the start of the last epoch when the edit lock will be released if the user does not otherwise release it.

User Comments


template (namedset)

The name of the template to use for displaying the abstract/summary page.

User Comments


REFERENCES AND RELATED OBJECTS

User Comments


documents (subobject, multiple)

A virtual field which represents the list of documents which are part of this record.

User Comments


files (subobject, multiple)

A virtual field which represents the list of files which are part of this record.

User Comments


userid (itemref)

The ID of the user who deposited this eprint (if any). Scripted importing could cause this not to be set.

User Comments


importid (itemref)

The ID of the import from which this eprint was imported. (Rarely used).

User Comments


sword_depositor (itemref)

The ID of the user who deposited this eprint through EPrints SWORD API.

User Comments


succeeds (itemref)

The ID of the eprint (if any) which this succeeds.

User Comments


commentary (itemref)

The ID of the eprint (if any) which this eprint is a commentary on.

User Comments


INSTANCE VARIABLES

Also see EPrints::DataObj.

User Comments


$self->{user}

The user who is owner of this eprint data object.

User Comments


METHODS

User Comments


Constructor Methods

User Comments


create

$eprint = EPrints::DataObj::EPrint->create( $session, $dataset, $data )

Create a new EPrint entry in the given $dataset..

If $data is defined, then this is used as the base for the new record. Otherwise the repository specific defaults provided by

set_eprint_defaults are used.

The fields eprintid and dir will be overridden even if they are set.

User Comments


create_from_data

$dataobj = EPrints::DataObj::EPrint->create_from_data( $session, $data, $dataset ) 

Create a new object of this type 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 also create sub-objects also.

User Comments


Class Methods

User Comments


get_system_field_info

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

Return an array describing the system metadata of the eprint dataset.

User Comments


get_dataset_id

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

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

User Comments


get_defaults

$defaults = EPrints::DataObj::EPrint->get_defaults( $class, $session, $data, $dataset )

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

User Comments


Object Methods

User Comments


set_item_issues

$eprint->set_item_issues( $new_issues )

This method updates the issues associated to this eprint based on the $new_issues passed.

If an existing issue is set as discovered and doesn't exist in $new_issues its status will be updated to autoresolved, otherwise the old issue's status and description are updated.

Any issues in $new_issues that don't already exist will be appended.

User Comments


fileinfo

$fileinfo = $eprint->fileinfo

The special fileinfo field contains the icon and main file paths and filenames for each non-volatile document in the eprint. This is a performance tweak to avoid having to retrieve documents when rendering eprint citations.

Example:

/style/images/fileicons/application_pdf.png;/20/1/paper.pdf|/20/4.hassmallThumbnailVersion/tdb_portrait.jpg;/20/4/tdb_portrait.jpg
 

User Comments


update_triggers

$eprint->update_triggers

Update all the stuff that needs updating before an eprint data object is written to the database.

User Comments


get_dataset

$dataset = $eprint->get_dataset

Returns the dataset to which this object belongs. This will return one of the virtual datasets, by default: inbox, buffer, archive or deletion.

User Comments


store_path

$path = $eprint->store_path

Get the storage path for this eprint data object.

User Comments


clone

$eprint = $eprint->clone( $dest_dataset, $copy_documents, $link )

Create a copy of this eprint data object with a new ID in the given $dest_dataset.

Returns the new eprint, or undef in the case of an error.

If $copy_documents is set and true then the documents (and files) will be copied in addition to the metadata.

If $nolink is true then the new eprint is not connected to the old one by not setting the new eprint's succeeds field.

User Comments


log_mail_owner

$eprint->log_mail_owner( $mail )

Log that the given $mail message was sent to the owner of this eprint data object.

$mail is the same XHTML DOM that was sent as the email.

User Comments


get_editorial_contact

$user = $eprint->get_editorial_contact

Returns the user identified as the editorial contact for this item.

By default returns undef.

N.B. This does no relate to any editors defined in the metadata for this eprint data object.

User Comments


empty

$eprint->empty( [ $clear_all ] )

Remove all documents and set to empty (almost) all fields.

If $clear_all also unset rev_number, metadata_visibility, and eprint_status fields.

User Comments


remove

$success = $eprint->remove

Erase this eprint data object and any associated data objects from the database and filesystem.

This should only be called on eprints in inbox or buffer.

User Comments


commit

$success = $eprint->commit( [ $force ] );

Commit any changes to the database.

Calls update_triggers just before the database is updated.

The actions this method does are dependent on some object attributes:

 changed - hash of changed fields (from EPrints::DataObj)
 non_volatile_change - boolean (from EPrints::DataObj)
 under_construction - boolean
 

If datestamp is unset and this eprint is in the archive dataset datestamp will always be set which will in turn set datestamp as changed.

If no field values were changed and $force is false returns.

If under_construction is false:

- static files updated

If non_volatile_change is true:

- lastmod field updated
- triples update queued

If under_construction is false and non_volatile_change is true:

- revision generated

The goal of these controls is to only trigger expensive processes in response to user actions. Revisions need to be generated when the user changes metadata or uploads new files (see EPrints::DataObj::Document#commit).

User Comments


save_revision

$eprint->save_revision( %opts )

Increase the eprint revision number and save a complete copy of the record into the history (see EPrints::DataObj::History).

Options:

 user - user that caused the action to occur, defaults to current user
 action - see history.action, defaults to "modify"
 details - see history.details, defaults to a description of changed fields
 

User Comments


validate

$problems = $eprint->validate( [$for_archive], $workflow_id )

Return a reference to an array of XHTML DOM objects describing validation problems with the entire eprint based on $workflow_id.

If $workflow_id is undefined defaults to default.

A reference to an empty array indicates no problems.

Calls validate_eprint for the $eprint.

User Comments


skip_validation

$boolean = $eprint->skip_validation

Returns true if this eprint should pass validation without being properly validated. This is to allow the use of dodgy data imported from legacy systems.

User Comments


prune_documents

$eprint->prune_documents

Remove any documents associated with this eprint that do not actually have any files.

User Comments


get_all_documents

@documents = $eprint->get_all_documents

Return a list of all EPrints::DataObj::Document objects associated with this eprint excluding documents with a isVolatileVersionOf relation, (e.g. thumbnails).

User Comments


move_to_deletion

$success = $eprint->move_to_deletion

Transfer the eprint into the deletion dataset. Should only be called by eprints in the archive dataset.

User Comments


move_to_inbox

$success = $eprint->move_to_inbox

Transfer the eprint into the inbox dataset. Should only be called for eprints in the buffer dataset.

User Comments


move_to_buffer

$success = $eprint->move_to_buffer

Transfer the eprint into the buffer dataset. Should only be called by eprints in the inbox or archive datasets.

User Comments


move_to_archive

$success = $eprint->move_to_archive

Move this eprint into the main archive dataset. Normally only called on eprints in deletion or buffer datasets.

User Comments


local_path

$path = $eprint->local_path

Returns the full path of the eprint data onject directory on the local filesystem with no trailing slash.

User Comments


path

$path = $eprint->path

Returns the full URL path of the eprint data object including a trailing slash. E.g. 1234/.

User Comments


url_stem

$url = $eprint->url_stem

Returns the URL to this eprint's directory.

N.B. This includes the trailing slash, unlike the local_path method.

User Comments


generate_static

$eprint->generate_static

Generate the static version of the abstract/summary web page. In a multi-language repository this will generate one version per language.

If called on eprints in the inbox or buffer, remove the abstract/summary page.

User Comments


remove_static

$eprint->remove_static

Remove the static web page or pages.

User Comments


render

( $description, $title, $links ) = $eprint->render( $preview )

Render the eprint. If $preview is true then render a preview of the eprint data object

The 3 returned values are references to XHTML DOM objects. $description is the public viewable description of this eprintthat appears as the body of the abstract page. $title is the title of the abstract page for this eprint. $links is any elements which should go in the head elemeny of this HTML page.

Calls eprint_render to actually render the $eprint, if it isn't in the deleted dataset.

User Comments


render_preview

( $description, $title, $links ) = $eprint->render_preview

Render a preview version of this eprint.

See render for more details

User Comments


get_control_url

$url = $eprint->get_control_url

Return the URL of the control page for this eprint.

User Comments


get_url

$url = $eprint->get_url

Return the public URL of this eprints abstract/summary page.

User Comments


get_user

$user = $eprint->get_user

Return the EPrints::DataObj::User to whom this eprint belongs (if any).

User Comments


later_in_thread

$list = $eprint->later_in_thread( $field )

Return an EPrints::List of the immediately later items in the thread.

$field is typically the succeeds field that generates the thread of eprints.

User Comments


in_thread

$boolean = $eprint->in_thread( $field )

Returns true if this eprint is in the $field thread.

$field is typically the succeeds field that generates the thread of eprints.

User Comments


first_in_thread

$eprint = $eprint->first_in_thread( $field )

Return the first (earliest) version or first paper in the thread of commentaries of this paper in the repository.

$field is typically the succeeds field that generates the thread of eprints.

User Comments


last_in_thread

$eprint = $eprint->last_in_thread( $field )

Returns the latest item in the $field thread on this eprint's branch of the thread tree.

$field is typically the succeeds field that generates the thread of eprints.

User Comments


removed_from_thread

$eprint->removed_from_thread( $field, [ $parent ] )

Fix the metadata_visibility for the eprint data object after it has been removed from the $field (typically succeeds) based thread.

The change in $parent must be committed before this method is called.

N.B. $parent (i.e. the eprint this eprint succeeds) is not required for this method but included for consistency.

User Comments


added_to_thread

$eprint->added_to_thread( $field, $parent )

Fix the metadata_visibility for this eprint data object now the has the $parent set in the $field (typically the succeeds field).

Does not update metadata_visibility if $parent is not in archive.

User Comments


map_thread

$eprint->map_thread( $field, $f )

Apply function $f to every eprint data object in the $field based thread that includes this eprint.

User Comments


render_version_thread

$xhtml = $eprint->render_version_thread( $field )

Return XHTML DOM rendering describing the entire $field based thread for this eprint data object as nested unordered lists.

User Comments


loop_error

$eprint->loop_error( $field, @looped_ids )

Log repository error message because this eprint is part of a loop of eprint data objects (with IDs looped_ids) in a $field based thread.

User Comments


get_type

$type = $eprint->get_type

Return the type of this eprint.

This is an alias of:

$eprint->value( "type" )
 

User Comments


user_roles

@roles = $eprint->user_roles( $user )

Return the roles the specified $user has for this eprint.

User Comments


datestamp

$eprint->datestamp

DEPRECATED

Now just generates a deprecated error message to the log. Use:

$eprint->value( 'datestamp' );
 

User Comments


in_editorial_scope_of

$boolean = $eprint->in_editorial_scope_of( $possible_editor )

Returns true if $possible_editor can edit this eprint. This is according to the user's editperms.

This does not mean the user has the editor privilege, just that if they do then they may edit the eprint.

User Comments


has_owner

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

Returns true if $possible_owner can edit this eprint. This is according to the user's editperms.

This does not mean the user has the editor privilege, just that if they do then they may edit the given eprint.

Uses the callback does_user_own_eprint if available.

User Comments


obtain_lock

$boolean = $eprint->obtain_lock( $user )

Assign the edit lock for this eprint data object to the specified $user.

Returns a boolean depending on whether the edit lock was successfully assigned.

User Comments


remove_lock

$boolean = $eprint->remove_lock( $user )

Remove the edit lock for this eprint data object to the specified $user.

Returns a boolean depending on whether the edit lock was successfully removed.

User Comments


could_obtain_lock

$boolean = $eprint->could_obtain_lock( $user )

Return a boolean depending on whether the specified $user could obtain ane edit lock on this eprint.

User Comments


is_locked

$boolean = $eprint->is_locked

Return a boolean depending on whether this eprint currently has an edit lock.

User Comments


Utility Methods

User Comments


render_issues

$ol_frag = EPrints::DataObj::EPrint::render_issues( $session, $field, $value )

Returns a rendering of the list of issues from $value array reference (as a ol (ordered list) XHTML DOM fragment) for the item_issues field provided by $field.

User Comments


order_issues_newest_open_timestamp

$timestamps = EPrints::DataObj::EPrint::order_issues_newest_open_timestamp( $field, $value, $session, $langid, $dataset )

Returns a string containing the timestamp for the newest issue that has status reported or discovered.

This method is called through the EPrints::MetaField make_value_orderkey attribute.

$field is the item_issues field. $value is an array reference of the issues. $session is the EPrints::Repository object, $langid is the language ID and $dataset is the eprint dataset

User Comments


render_fileinfo

$frag = EPrints::DataObj::EPrint::render_fileinfo( $session, $field, $value, $alllangs, $nolink, $eprint )

Render method for fileinfo field. Returns a XHTML DOM fragment containing the documents stored in the fileinfo field.

This method is called through the EPrints::MetaField render_value attribute.

$session is the EPrints::Repository object. $field is the fileinfo field. $value is the value for this field. $session is the EPrints::Repository object, $alllangs is a boolean to render in all languages if an EPrints::MetaField::Multilang field. $nolink is a boolean on whether to not render links. $eprint is the eprint data object that has the fileinfo field.

User Comments


eprintid_to_path

$path = EPrints::DataObj::eprintid_to_path( $id )

Returns path of the storage directory based on the eprint $id provided.

User Comments


render_box_list

$frag = EPrints::DataObj::EPrint::render_box_list( $session, $eprint, $list )

Returns a rendering of the EPrints::Plugin::Screen::Box plugins from $list against the $eprint specified

User Comments


render_edit_lock

$xhtml = EPrints::DataObj::EPrints::render_edit_lock( $session, $field, $value, $alllangs, $nolink, $eprint )

Returns an XHTML DOM fragment providing information about the edit lock for metadata provided by $value.

This is used by the render_value attribute of the edit_lock field, which specified, the $session, $field, $value, $alllangs, $nolink and $eprint parameters. However, only the $session, $field, $value and $eprint parameters are required.

User Comments


CALLBACKS

Callbacks may optionally be defined in the ArchiveConfig.

User Comments


validate_field

validate_field( $field, $value, $session, [$for_archive] )
 

User Comments


validate_eprint

validate_eprint( $eprint, $session, [$for_archive] )
 

User Comments


set_eprint_defaults

set_eprint_defaults( $data, $session )
 

User Comments


set_eprint_automatic_fields

set_eprint_automatic_fields( $eprint )

User Comments


eprint_render

eprint_render( $eprint, $session )
 

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