Difference between revisions of "API:EPrints/Probity"

From EPrints Documentation
Jump to: navigation, search
(New page: <!-- Pod2Wiki=_preamble_ This page has been automatically generated from the EPrints source. Any wiki changes made between the 'Pod2Wiki=*' and 'End of Pod2Wiki' comments will be lost. -...)
(No difference)

Revision as of 18:29, 11 August 2009

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

NAME

EPrints::Probity - EPrints Probity Module

DESCRIPTION

Every time the files in an EPrint are modified, an checksum of the all the EPrints files is written to a file. This is used in checking the file hasn't been altered by some other means, and also can be used to prove that the file existed on a given date.

See bin/export_hashes for more information.

process_file

 $xml = EPrints::Probity::process_file( $session, $filename, [$name] );

Process the given file and return an XML chunk in the format.

<hash>
   <name>/opt/eprints3/documents/disk0/00/00/05/04/02/stuff.pdf</name>
   <algorithm>SHA-1</algorithm>
   <value>cc7a32915ab0a73ba1f94b34d3a265bdccd3c8b9</value>
   <date>Fri Sep 27 10:53:10 BST 2002</date>
</hash>
 

If $name is not specified then the name is $filename.

If there is a problem return a empty XML document fragment.

create_log

 $xml = EPrints::Probity::create_log( $session, $filenames, [$outfile] )

Create an XML file $outfile of the format:

<?xml version="1.0" encoding="UTF-8"?>
<hashlist xmlns="http://probity.org/XMLprobity">
   <hash>
      <name>/opt/eprints3/documents/disk0/00/00/05/04/02/stuff.pdf</name>
      <algorithm>SHA-1</algorithm>
      <value>cc7a32915ab0a73ba1f94b34d3a265bdccd3c8b9</value>
      <date>Fri Sep 27 10:53:10 BST 2002</date>
   </hash>
   .
   .
   .
 

From the filenames in array ref $filenames.

If $outfile is not specified then the XML is sent to STDOUT.

UNDOCUMENTED METHODS

Warning These methods were found in the source code but didn't have any POD associated with them. This may be because we haven't got around to documenting them yet or it could be because they are internal to the API and not intended for use by other parts of EPrints.

create_log_fh