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

From EPrints Documentation
Jump to: navigation, search
 
(2 intermediate revisions by the same user 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.2 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]][[Category:API:EPrints/DataObj|EPRINT]][[Category:API:EPrints/DataObj/EPrint|EPRINT]]<div><!-- Edit below this comment -->
+
  -->{{API}}{{Pod2Wiki}}{{API:Source|file=perl_lib/EPrints/DataObj/EPrint.pm|package_name=EPrints::DataObj::EPrint}}[[Category:API|EPRINT]][[Category:API:EPrints/DataObj|EPRINT]][[Category:API:EPrints/DataObj/EPrint|EPRINT]]<div><!-- Edit below this comment -->
  
  
Line 8: Line 8:
 
'''EPrints::DataObj::EPrint''' - Class representing an actual EPrint
 
'''EPrints::DataObj::EPrint''' - Class representing an actual EPrint
  
<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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
 
 
<!-- Pod2Wiki=head_description -->
 
<!-- Pod2Wiki=head_description -->
 
==DESCRIPTION==
 
==DESCRIPTION==
Line 21: Line 18:
 
EPrints::DataObj::EPrint is a subclass of EPrints::DataObj with the following metadata fields (plus those defined in ArchiveMetadataFieldsConfig):
 
EPrints::DataObj::EPrint is a subclass of EPrints::DataObj with the following metadata fields (plus those defined in ArchiveMetadataFieldsConfig):
  
<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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
 
 
<!-- Pod2Wiki=head_system_metadata -->
 
<!-- Pod2Wiki=head_system_metadata -->
 
==SYSTEM METADATA==
 
==SYSTEM METADATA==
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
+
* eprintid (int)
<span style='display:none'>User Comments</span>
+
: The unique numerical ID of this eprint.
<!-- Edit below this comment -->
+
  
 +
* rev_number (int)
 +
: The number of the current revision of this record.
  
<!-- Pod2Wiki= -->
+
* userid (itemref)
</div>
+
: The id of the user who deposited this eprint (if any). Scripted importing could cause this not to be set.
<!-- Pod2Wiki=item_eprintid -->
+
===eprintid (int)===
+
  
The unique numerical ID of this eprint.  
+
* 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.
  
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
+
* datestamp (time)
<span style='display:none'>User Comments</span>
+
: The date this record first appeared live in the repository.
<!-- Edit below this comment -->
+
  
 +
* lastmod (time)
 +
: The date this record was last modified.
  
<!-- Pod2Wiki= -->
+
* status_changes (time)
</div>
+
: The date/time this record was moved between inbox, buffer, archive, etc.
<!-- Pod2Wiki=item_rev_number -->
+
===rev_number (int)===
+
  
The number of the current revision of this record.
+
* type (namedset)
 +
: 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%; '>
+
* succeeds (itemref)
<span style='display:none'>User Comments</span>
+
: The ID of the eprint (if any) which this succeedsThis field should have been an int and may be changed in a later upgrade.
<!-- Edit below this comment -->
+
  
 +
* 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.
  
<!-- Pod2Wiki= -->
+
* metadata_visibility (set)
</div>
+
: This field is automatically set.
<!-- 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.
+
<pre> show - appears normally
 
+
  no_search - hidden from search/views</pre>
<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_dir -->
+
===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 'hide' 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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
 
<!-- Pod2Wiki=item_datestamp -->
 
===datestamp (time)===
 
 
The date this record first appeared live in the repository.
 
 
<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_lastmod -->
 
===lastmod (time)===
 
 
The date this record was last modified.
 
 
<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_status_changes -->
 
===status_changes (time)===
 
 
The date/time this record was moved between inbox, buffer, archive, etc.
 
 
<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_type -->
 
===type (namedset)===
 
 
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_succeeds -->
 
===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.
 
 
<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_commentary -->
 
===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.
 
 
<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 'hide' 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=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%; '>
+
<!-- Pod2Wiki=head_get_system_field_info -->
<span style='display:none'>User Comments</span>
+
===get_system_field_info===
<!-- Edit below this comment -->
+
  
 +
<source lang="perl">$metadata = EPrints::DataObj::EPrint->get_system_field_info
  
<!-- Pod2Wiki= -->
+
</source>
</div>
+
<!-- Pod2Wiki=item_get_system_field_info -->
+
===get_system_field_info===
+
 
+
$metadata = 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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_fileinfo -->
<!-- Pod2Wiki=item_set_item_issues -->
+
===fileinfo===
===set_item_issues===
+
  
$eprint-&gt;set_item_issues( $new_issues )
+
<source lang="perl">$eprint->fileinfo()
This method updates the issues attached 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.
+
 
+
<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===
+
  
$eprint-&gt;fileinfo()
+
</source>
 
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 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.
  
 
Example:
 
Example:
  
  /style/images/fileicons/application_pdf.png;/20/1/paper.pdf|/20/4.hassmallThumbnailVersion/tdb_portrait.jpg;/20/4/tdb_portrait.jpg
+
<pre>  /style/images/fileicons/application_pdf.png;/20/1/paper.pdf|/20/4.hassmallThumbnailVersion/tdb_portrait.jpg;/20/4/tdb_portrait.jpg</pre>
 
+
 
 
These URLs are relative to the current repository base path ('http_url').
 
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%; '>
 
<span style='display:none'>User Comments</span>
 
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_get_dataset_id -->
<!-- Pod2Wiki=item_get_dataset_id -->
+
 
===get_dataset_id===
 
===get_dataset_id===
  
$dataset = EPrints::DataObj::EPrint-&gt;get_dataset_id
+
<source lang="perl">$dataset = EPrints::DataObj::EPrint->get_dataset_id
 +
 
 +
</source>
 
Returns the id of the [[API:EPrints/DataSet|EPrints::DataSet]] object to which this record belongs.
 
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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_get_dataset -->
<!-- Pod2Wiki=item_get_dataset -->
+
 
===get_dataset===
 
===get_dataset===
  
$dataset = $eprint-&gt;get_dataset
+
<source lang="perl">$dataset = $eprint->get_dataset
 +
 
 +
</source>
 
Return the dataset to which this object belongs. This will return one of the virtual datasets: inbox, buffer, archive or deletion.
 
Return the dataset to which this object belongs. This will return one of the virtual datasets: inbox, buffer, archive or deletion.
  
<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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_get_defaults -->
<!-- Pod2Wiki=item_get_defaults -->
+
 
===get_defaults===
 
===get_defaults===
  
$defaults = EPrints::DataObj::EPrint-&gt;get_defaults( $session, $data )
+
<source lang="perl">$defaults = EPrints::DataObj::EPrint->get_defaults( $session, $data )
 +
 
 +
</source>
 
Return default values for this object based on the starting data.
 
Return default values for this object based on the starting data.
  
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<span style='display:none'>User Comments</span>
 
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_clone -->
<!-- Pod2Wiki=item_clone -->
+
 
===clone===
 
===clone===
  
$eprint = $eprint-&gt;clone( $dest_dataset, $copy_documents, $link )
+
<source lang="perl">$eprint = $eprint->clone( $dest_dataset, $copy_documents, $link )
 +
 
 +
</source>
 
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 with a new ID in the given dataset. Return the new eprint, or undef in the case of an error.
  
Line 281: Line 146:
 
If $nolink is true then the new eprint is not connected to the old one.
 
If $nolink is true then the new eprint is not connected to the old one.
  
<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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_log_mail_owner -->
<!-- Pod2Wiki=item_log_mail_owner -->
+
 
===log_mail_owner===
 
===log_mail_owner===
  
$eprint-&gt;log_mail_owner( $mail )
+
<source lang="perl">$eprint->log_mail_owner( $mail )
 +
 
 +
</source>
 
Log that the given mail message was send to the owner of this EPrint.
 
Log that the given mail message was send to the owner of this EPrint.
  
 
$mail is the same XHTML DOM that was sent as the email.
 
$mail 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%; '>
 
<span style='display:none'>User Comments</span>
 
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_get_editorial_contact -->
<!-- Pod2Wiki=item_get_editorial_contact -->
+
 
===get_editorial_contact===
 
===get_editorial_contact===
  
$user = $eprint-&gt;get_editorial_contact
+
<source lang="perl">$user = $eprint->get_editorial_contact
 +
 
 +
</source>
 
Return the user identified as the editorial contact for this item.
 
Return the user identified as the editorial contact for this item.
  
Line 313: Line 176:
 
nb. This has nothing to do with the editor defined in the metadata
 
nb. This has nothing to do with the editor defined in the metadata
  
<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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_remove -->
<!-- Pod2Wiki=item_remove -->
+
 
===remove===
 
===remove===
  
$success = $eprint-&gt;remove
+
<source lang="perl">$success = $eprint->remove
 +
 
 +
</source>
 
Erase this eprint and any associated records from the database and filesystem.
 
Erase this eprint and any associated records from the database and filesystem.
  
 
This should only be called on eprints in "inbox" or "buffer".
 
This should only be called on eprints in "inbox" or "buffer".
  
<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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_commit -->
<!-- Pod2Wiki=item_commit -->
+
 
===commit===
 
===commit===
  
$success = $eprint-&gt;commit( [$force] );
+
<source lang="perl">$success = $eprint->commit( [$force] );
 +
 
 +
</source>
 
Commit any changes to the database.
 
Commit any changes to the database.
  
Line 345: Line 206:
 
The actions this method does are dependent on some object attributes:
 
The actions this method does are dependent on some object attributes:
  
  changed - HASH of changed fields (from [[API:EPrints/DataObj|EPrints::DataObj]])
+
<pre>  changed - HASH of changed fields (from [[API:EPrints/DataObj|EPrints::DataObj]])
 
   non_volatile_change - BOOL (from [[API:EPrints/DataObj|EPrints::DataObj]])
 
   non_volatile_change - BOOL (from [[API:EPrints/DataObj|EPrints::DataObj]])
   under_construction - BOOL
+
   under_construction - BOOL</pre>
 
+
 
 
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 '''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 <tt>$force</tt> is false returns.
+
If no field values were changed and <code>$force</code> is false returns.
  
If <tt>under_construction</tt> is false:
+
If <code>under_construction</code> is false:
 
  - static files updated
 
  - static files updated
  
If <tt>non_volatile_change</tt> is true:
+
If <code>non_volatile_change</code> is true:
 
  - '''lastmod''' field updated
 
  - '''lastmod''' field updated
 
  - triples update queued
 
  - triples update queued
  
If <tt>under_construction</tt> is false and <tt>non_volatile_change</tt> is true:
+
If <code>under_construction</code> is false and <code>non_volatile_change</code> is true:
 
  - revision generated
 
  - 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]]).
 
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%; '>
 
<span style='display:none'>User Comments</span>
 
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_save_revision -->
<!-- Pod2Wiki=item_save_revision -->
+
 
===save_revision===
 
===save_revision===
  
$eprint-&gt;save_revision( %opts )
+
<source lang="perl">$eprint->save_revision( %opts )
 +
 
 +
</source>
 
Increase the eprint revision number and save a complete copy of the record into the history (see [[API:EPrints/DataObj/History|EPrints::DataObj::History]]).
 
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:
 
Options:
  
  user - user that caused the action to occur, defaults to current user
+
<pre>  user - user that caused the action to occur, defaults to current user
 
   action - see history.action, defaults to "modify"
 
   action - see history.action, defaults to "modify"
   details - see history.details, defaults to a description of changed fields
+
   details - see history.details, defaults to a description of changed fields</pre>
 
+
 
<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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_validate -->
<!-- Pod2Wiki=item_validate -->
+
 
===validate===
 
===validate===
  
$problems = $eprint-&gt;validate( [$for_archive], $workflow_id )
+
<source lang="perl">$problems = $eprint->validate( [$for_archive], $workflow_id )
 +
 
 +
</source>
 
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 $workflow_id.
  
Line 401: Line 260:
 
A reference to an empty array indicates no problems.
 
A reference to an empty array indicates no problems.
  
Calls [[API:EPrints/DataObj/EPrint#validate_eprint|validate_eprint]] for the <tt>$eprint</tt>.
+
Calls [[API:EPrints/DataObj/EPrint#validate_eprint|validate_eprint]] for the <code>$eprint</code>.
  
<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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_skip_validation -->
<!-- Pod2Wiki=item_skip_validation -->
+
 
===skip_validation===
 
===skip_validation===
  
$boolean = $eprint-&gt;skip_validation
+
<source lang="perl">$boolean = $eprint->skip_validation
 +
 
 +
</source>
 
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 true if this eprint should pass validation without being properly validated. This is to allow the use of dodgey 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%; '>
 
<span style='display:none'>User Comments</span>
 
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_prune_documents -->
<!-- Pod2Wiki=item_prune_documents -->
+
 
===prune_documents===
 
===prune_documents===
  
$eprint-&gt;prune_documents
+
<source lang="perl">$eprint->prune_documents
 +
 
 +
</source>
 
Remove any documents associated with this eprint which don't actually have any files.
 
Remove any documents associated with this eprint which don't 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%; '>
 
<span style='display:none'>User Comments</span>
 
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_get_all_documents -->
<!-- Pod2Wiki=item_get_all_documents -->
+
 
===get_all_documents===
 
===get_all_documents===
  
@documents = $eprint-&gt;get_all_documents
+
<source lang="perl">@documents = $eprint->get_all_documents
 +
 
 +
</source>
 
Return a list of all {{API:PodLink|file=EPrint/Document|package_name=EPrint::Document|section=|text=EPrint::Document}} objects associated with this eprint excluding documents with a "isVolatileVersionOf" relation (e.g. thumbnails).
 
Return a list of all {{API:PodLink|file=EPrint/Document|package_name=EPrint::Document|section=|text=EPrint::Document}} objects associated with this eprint excluding documents with a "isVolatileVersionOf" 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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_move_to_deletion -->
<!-- Pod2Wiki=item_required_formats -->
+
===move_to_deletion===
===required_formats===
+
  
@formats =  $eprint-&gt;required_formats
+
<source lang="perl">$success = $eprint->move_to_deletion
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%; '>
+
<span style='display:none'>User Comments</span>
+
<!-- Edit below this comment -->
+
 
+
 
+
<!-- Pod2Wiki= -->
+
</div>
+
<!-- Pod2Wiki=item_move_to_deletion -->
+
===move_to_deletion===
+
  
$success = $eprint-&gt;move_to_deletion
+
</source>
 
Transfer the EPrint into the "deletion" dataset. Should only be called in eprints in the "archive" dataset.
 
Transfer the EPrint into the "deletion" dataset. Should only be called in eprints in the "archive" 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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_move_to_inbox -->
<!-- Pod2Wiki=item_move_to_inbox -->
+
 
===move_to_inbox===
 
===move_to_inbox===
  
$success = $eprint-&gt;move_to_inbox
+
<source lang="perl">$success = $eprint->move_to_inbox
 +
 
 +
</source>
 
Transfer the EPrint into the "inbox" dataset. Should only be called in eprints in the "buffer" dataset.
 
Transfer the EPrint into the "inbox" dataset. Should only be called in eprints in the "buffer" 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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_move_to_buffer -->
<!-- Pod2Wiki=item_move_to_buffer -->
+
 
===move_to_buffer===
 
===move_to_buffer===
  
$success = $eprint-&gt;move_to_buffer
+
<source lang="perl">$success = $eprint->move_to_buffer
 +
 
 +
</source>
 
Transfer the EPrint into the "buffer" dataset. Should only be called in eprints in the "inbox" or "archive" dataset.
 
Transfer the EPrint into the "buffer" dataset. Should only be called in eprints in the "inbox" or "archive" 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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_move_to_archive -->
<!-- Pod2Wiki=item_move_to_archive -->
+
 
===move_to_archive===
 
===move_to_archive===
  
$success = $eprint-&gt;move_to_archive
+
<source lang="perl">$success = $eprint->move_to_archive
 +
 
 +
</source>
 
Move this eprint into the main "archive" dataset. Normally only called on eprints in "deletion" or "buffer" datasets.
 
Move this eprint into the main "archive" dataset. Normally only called on eprints in "deletion" or "buffer" datasets.
  
<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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_local_path -->
<!-- Pod2Wiki=item_local_path -->
+
 
===local_path===
 
===local_path===
  
$path = $eprint-&gt;local_path
+
<source lang="perl">$path = $eprint->local_path
 +
 
 +
</source>
 
Return the full path of the EPrint directory on the local filesystem. No trailing slash.
 
Return the full path of the EPrint directory on the local filesystem. 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%; '>
 
<span style='display:none'>User Comments</span>
 
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_url_stem -->
<!-- Pod2Wiki=item_url_stem -->
+
 
===url_stem===
 
===url_stem===
  
$url = $eprint-&gt;url_stem
+
<source lang="perl">$url = $eprint->url_stem
 +
 
 +
</source>
 
Return the URL to this EPrint's directory. Note, this INCLUDES the trailing slash, unlike the local_path method.
 
Return the URL to this EPrint's directory. Note, 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%; '>
 
<span style='display:none'>User Comments</span>
 
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_generate_static -->
<!-- Pod2Wiki=item_generate_static -->
+
 
===generate_static===
 
===generate_static===
  
$eprint-&gt;generate_static
+
<source lang="perl">$eprint->generate_static
 +
 
 +
</source>
 
Generate the static version of the abstract web page. In a multi-language repository this will generate one version per language.
 
Generate the static version of the abstract web page. In a multi-language repository this will generate one version per language.
  
 
If called on inbox or buffer, remove the abstract page.
 
If called on inbox or buffer, remove the abstract 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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_remove_static -->
<!-- Pod2Wiki=item_remove_static -->
+
 
===remove_static===
 
===remove_static===
  
$eprint-&gt;remove_static
+
<source lang="perl">$eprint->remove_static
 +
 
 +
</source>
 
Remove the static web page or pages.
 
Remove the static web page or pages.
  
<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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_render -->
<!-- Pod2Wiki=item_render -->
+
 
===render===
 
===render===
  
( $description, $title, $links ) = $eprint-&gt;render
+
<source lang="perl">( $description, $title, $links ) = $eprint->render
 +
 
 +
</source>
 
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. 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.
  
Calls [[API:EPrints/DataObj/EPrint#eprint_render|eprint_render]] to actually render the <tt>$eprint</tt>, if it isn't deleted.
+
Calls [[API:EPrints/DataObj/EPrint#eprint_render|eprint_render]] to actually render the <code>$eprint</code>, if it isn't deleted.
  
<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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_get_control_url -->
<!-- Pod2Wiki=item_render_history -->
+
===get_control_url===
===render_history===
+
  
( $html ) = $eprint-&gt;render_history
+
<source lang="perl">$url = $eprint->get_control_url
Render the history of this eprint as XHTML DOM.
+
  
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
+
</source>
<span style='display:none'>User Comments</span>
+
<!-- Edit below this comment -->
+
 
+
 
+
<!-- Pod2Wiki= -->
+
</div>
+
<!-- Pod2Wiki=item_get_control_url -->
+
===get_control_url===
+
 
+
$url = $eprint-&gt;get_control_url
+
 
Return the URL of the control page for this eprint.
 
Return the URL of the control page 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%; '>
 
<span style='display:none'>User Comments</span>
 
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_get_url -->
<!-- Pod2Wiki=item_get_url -->
+
 
===get_url===
 
===get_url===
  
$url = $eprint-&gt;get_url
+
<source lang="perl">$url = $eprint->get_url
 +
 
 +
</source>
 
Return the public URL of this eprints abstract page.  
 
Return the public URL of this eprints abstract 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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_get_user -->
<!-- Pod2Wiki=item_get_user -->
+
 
===get_user===
 
===get_user===
  
$user = $eprint-&gt;get_user
+
<source lang="perl">$user = $eprint->get_user
 +
 
 +
</source>
 
Return the EPrints::DataObj::User to whom this eprint belongs (if any).
 
Return the 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%; '>
 
<span style='display:none'>User Comments</span>
 
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_in_thread -->
<!-- Pod2Wiki=item_in_thread -->
+
 
===in_thread===
 
===in_thread===
  
$bool = $eprint-&gt;in_thread( $field )
+
<source lang="perl">$bool = $eprint->in_thread( $field )
 +
 
 +
</source>
 
Returns true if this eprint is in the $field thread.
 
Returns true if this eprint is in the $field thread.
  
<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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_first_in_thread -->
<!-- Pod2Wiki=item_first_in_thread -->
+
 
===first_in_thread===
 
===first_in_thread===
  
$eprint = $eprint-&gt;first_in_thread( $field )
+
<source lang="perl">$eprint = $eprint->first_in_thread( $field )
 +
 
 +
</source>
 
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.
  
<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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_last_in_thread -->
<!-- Pod2Wiki=item_last_in_thread -->
+
 
===last_in_thread===
 
===last_in_thread===
  
$eprint = $eprint-&gt;last_in_thread( $field )
+
<source lang="perl">$eprint = $eprint->last_in_thread( $field )
 +
 
 +
</source>
 
Returns the latest item in the $field thread on this eprint's branch of the thread tree.
 
Returns the latest item in the $field thread on this eprint's branch of the thread tree.
  
<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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_render_version_thread -->
<!-- Pod2Wiki=item_render_version_thread -->
+
 
===render_version_thread===
 
===render_version_thread===
  
$xhtml = $eprint-&gt;render_version_thread( $field )
+
<source lang="perl">$xhtml = $eprint->render_version_thread( $field )
 +
 
 +
</source>
 
Render XHTML DOM describing the entire thread as nested unordered lists.
 
Render XHTML DOM describing the entire thread 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%; '>
 
<span style='display:none'>User Comments</span>
 
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_get_type -->
<!-- Pod2Wiki=item_get_type -->
+
 
===get_type===
 
===get_type===
  
$type = $eprint-&gt;get_type
+
<source lang="perl">$type = $eprint->get_type
 +
 
 +
</source>
 
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%; '>
 
<span style='display:none'>User Comments</span>
 
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_user_roles -->
<!-- Pod2Wiki=item_user_roles -->
+
 
===user_roles===
 
===user_roles===
  
@roles = $eprint-&gt;user_roles( $user )
+
<source lang="perl">@roles = $eprint->user_roles( $user )
 +
 
 +
</source>
 
Return the @roles $user has on $eprint.
 
Return the @roles $user has on $eprint.
  
<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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_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 )
+
<source lang="perl">$boolean = $eprint->in_editorial_scope_of( $possible_editor )
 +
 
 +
</source>
 
Returns true if $possible_editor can edit this eprint. This is according to the user editperms.  
 
Returns true if $possible_editor can edit this eprint. This is according to the user editperms.  
  
 
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 priv., just that if they do then they may edit the given item.
  
<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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_has_owner -->
<!-- Pod2Wiki=item_has_owner -->
+
 
===has_owner===
 
===has_owner===
  
$boolean = $eprint-&gt;has_owner( $possible_owner )
+
<source lang="perl">$boolean = $eprint->has_owner( $possible_owner )
 +
 
 +
</source>
 
Returns true if $possible_owner can edit this eprint. This is according to the user editperms.  
 
Returns true if $possible_owner can edit this eprint. This is according to the user editperms.  
  
Line 740: Line 548:
 
Uses the callback "does_user_own_eprint" if available.
 
Uses the callback "does_user_own_eprint" 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%; '>
 
<span style='display:none'>User Comments</span>
 
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_obtain_lock -->
<!-- Pod2Wiki=item_obtain_lock -->
+
 
===obtain_lock===
 
===obtain_lock===
  
$boolean = $eprint-&gt;obtain_lock( $user )
+
<source lang="perl">$boolean = $eprint->obtain_lock( $user )
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
+
 
<span style='display:none'>User Comments</span>
+
</source>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_remove_lock -->
<!-- Pod2Wiki=item_remove_lock -->
+
 
===remove_lock===
 
===remove_lock===
  
$boolean = $eprint-&gt;remove_lock( $user )
+
<source lang="perl">$boolean = $eprint->remove_lock( $user )
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
+
 
<span style='display:none'>User Comments</span>
+
</source>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_could_obtain_lock -->
<!-- Pod2Wiki=item_could_obtain_lock -->
+
 
===could_obtain_lock===
 
===could_obtain_lock===
  
$boolean = $eprint-&gt;could_obtain_lock( $user )
+
<source lang="perl">$boolean = $eprint->could_obtain_lock( $user )
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
+
 
<span style='display:none'>User Comments</span>
+
</source>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_is_locked -->
<!-- Pod2Wiki=item_is_locked -->
+
 
===is_locked===
 
===is_locked===
  
$boolean = $eprint-&gt;is_locked()
+
<source lang="perl">$boolean = $eprint->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%; '>
+
 
<span style='display:none'>User Comments</span>
+
</source>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_render_edit_lock -->
<!-- Pod2Wiki=item_render_edit_lock -->
+
 
===render_edit_lock===
 
===render_edit_lock===
  
$xhtml = render_edit_lock( $session, $value )
+
<source lang="perl">$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%; '>
+
 
<span style='display:none'>User Comments</span>
+
</source>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
 
 
<!-- Pod2Wiki=head_callbacks -->
 
<!-- Pod2Wiki=head_callbacks -->
 
==CALLBACKS==
 
==CALLBACKS==
 
Callbacks may optionally be defined in the ArchiveConfig.
 
Callbacks may optionally be defined in the ArchiveConfig.
  
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
+
* validate_field
<span style='display:none'>User Comments</span>
+
<pre> validate_field( $field, $value, $session, [$for_archive] )</pre>
<!-- Edit below this comment -->
+
  
 +
* validate_eprint
 +
<pre>  validate_eprint( $eprint, $session, [$for_archive] )</pre>
  
<!-- Pod2Wiki= -->
+
* set_eprint_defaults
</div>
+
<pre> set_eprint_defaults( $data, $session )</pre>
<!-- Pod2Wiki=item_validate_field -->
+
===validate_field===
+
  
  validate_field( $field, $value, $session, [$for_archive] )
+
* set_eprint_automatic_fields
 
+
<pre>  set_eprint_automatic_fields( $eprint )</pre>
<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 -->
+
  
 +
* eprint_render
 +
<pre>  eprint_render( $eprint, $session )</pre>
  
<!-- Pod2Wiki= -->
+
: See {{API:PodLink|file=ArchiveRenderConfig|package_name=ArchiveRenderConfig|section=eprint_render|text=ArchiveRenderConfig/eprint_render}}.
</div>
+
<!-- Pod2Wiki=item_validate_eprint -->
+
===validate_eprint===
+
  
  validate_eprint( $eprint, $session, [$for_archive] )
+
<pre>
 
    
 
    
<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 -->
 
  
 +
 
 +
</pre>
  
<!-- Pod2Wiki= -->
 
</div>
 
<!-- Pod2Wiki=item_set_eprint_defaults -->
 
===set_eprint_defaults===
 
 
  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%; '>
 
<span style='display:none'>User Comments</span>
 
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=head_copyright -->
<!-- Pod2Wiki=item_set_eprint_automatic_fields -->
+
==COPYRIGHT==
===set_eprint_automatic_fields===
+
Copyright 2000-2011 University of Southampton.
  
  set_eprint_automatic_fields( $eprint )
+
This file is part of EPrints http://www.eprints.org/.
 
+
<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 -->
+
  
 +
EPrints is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  
<!-- Pod2Wiki= -->
+
EPrints 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.
</div>
+
<!-- Pod2Wiki=item_eprint_render -->
+
===eprint_render===
+
  
  eprint_render( $eprint, $session )
+
You should have received a copy of the GNU Lesser General Public License along with EPrints.  If not, see http://www.gnu.org/licenses/.
 
+
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 -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
</div>
+
<!-- Pod2Wiki=_postamble_ -->
<!-- Pod2Wiki=head_copyright -->
+
==COPYRIGHT==
+
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
+
<span style='display:none'>User Comments</span>
+
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
 
 
<!-- Pod2Wiki= -->
 
</div>
 
<!-- Pod2Wiki=_postamble_ --><!-- Edit below this comment -->
 

Latest revision as of 09:57, 22 January 2013

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.3, 3.2) | Revision Log | Before editing this page please read Pod2Wiki


NAME

EPrints::DataObj::EPrint - Class representing an actual EPrint


DESCRIPTION

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

EPrints::DataObj::EPrint is a subclass of EPrints::DataObj with the following metadata fields (plus those defined in ArchiveMetadataFieldsConfig):


SYSTEM METADATA

  • eprintid (int)
The unique numerical ID of this eprint.
  • rev_number (int)
The number of the current revision of this record.
  • userid (itemref)
The id of the user who deposited this eprint (if any). Scripted importing could cause this not to be set.
  • 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.
  • datestamp (time)
The date this record first appeared live in the repository.
  • lastmod (time)
The date this record was last modified.
  • status_changes (time)
The date/time this record was moved between inbox, buffer, archive, etc.
  • type (namedset)
The type of this record, one of the types of the "eprint" dataset.
  • 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.
  • 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.
  • 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.


METHODS

get_system_field_info

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

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


fileinfo

$eprint->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.

Example:

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


get_dataset_id

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

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


get_dataset

$dataset = $eprint->get_dataset

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


get_defaults

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

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


clone

$eprint = $eprint->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.

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.


log_mail_owner

$eprint->log_mail_owner( $mail )

Log that the given mail message was send to the owner of this EPrint.

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


get_editorial_contact

$user = $eprint->get_editorial_contact

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

By default returns undef.

nb. This has nothing to do with the editor defined in the metadata


remove

$success = $eprint->remove

Erase this eprint and any associated records from the database and filesystem.

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


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 [[API:EPrints/DataObj|EPrints::DataObj]])
  non_volatile_change - BOOL (from [[API:EPrints/DataObj|EPrints::DataObj]])
  under_construction - BOOL

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


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


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.


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 dodgey data imported from legacy systems.


prune_documents

$eprint->prune_documents

Remove any documents associated with this eprint which don't actually have any files.


get_all_documents

@documents = $eprint->get_all_documents

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


move_to_deletion

$success = $eprint->move_to_deletion

Transfer the EPrint into the "deletion" dataset. Should only be called in eprints in the "archive" dataset.


move_to_inbox

$success = $eprint->move_to_inbox

Transfer the EPrint into the "inbox" dataset. Should only be called in eprints in the "buffer" dataset.


move_to_buffer

$success = $eprint->move_to_buffer

Transfer the EPrint into the "buffer" dataset. Should only be called in eprints in the "inbox" or "archive" dataset.


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.


local_path

$path = $eprint->local_path

Return the full path of the EPrint directory on the local filesystem. No trailing slash.


url_stem

$url = $eprint->url_stem

Return the URL to this EPrint's directory. Note, this INCLUDES the trailing slash, unlike the local_path method.


generate_static

$eprint->generate_static

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

If called on inbox or buffer, remove the abstract page.


remove_static

$eprint->remove_static

Remove the static web page or pages.


render

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

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 <head> of this page.

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


get_control_url

$url = $eprint->get_control_url

Return the URL of the control page for this eprint.


get_url

$url = $eprint->get_url

Return the public URL of this eprints abstract page.


get_user

$user = $eprint->get_user

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


in_thread

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

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


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.


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.


render_version_thread

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

Render XHTML DOM describing the entire thread as nested unordered lists.


get_type

$type = $eprint->get_type

Return the type of this eprint.


user_roles

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

Return the @roles $user has on $eprint.


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

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


has_owner

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

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

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

Uses the callback "does_user_own_eprint" if available.


obtain_lock

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


remove_lock

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


could_obtain_lock

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


is_locked

$boolean = $eprint->is_locked()


render_edit_lock

$xhtml = render_edit_lock( $session, $value )


CALLBACKS

Callbacks may optionally be defined in the ArchiveConfig.

  • validate_field
  validate_field( $field, $value, $session, [$for_archive] )
  • validate_eprint
  validate_eprint( $eprint, $session, [$for_archive] )
  • set_eprint_defaults
  set_eprint_defaults( $data, $session )
  • set_eprint_automatic_fields
  set_eprint_automatic_fields( $eprint )
  • eprint_render
  eprint_render( $eprint, $session )
See ArchiveRenderConfig/eprint_render.
  

  


COPYRIGHT

Copyright 2000-2011 University of Southampton.

This file is part of EPrints http://www.eprints.org/.

EPrints is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

EPrints 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. If not, see http://www.gnu.org/licenses/.