Open Journal Systems  3.3.0
DepositPackage Class Reference

Public Member Functions

 __construct ($deposit, $task=null)
 
 _cleanFileList ($xml, &$fileList)
 
 generateAtomDocument ()
 
 generatePackage ()
 
 getAtomDocumentPath ()
 
 getDepositDir ()
 
 getPackageFilePath ()
 
 importExportErrorHandler ($depositId, $message)
 
 packageDeposit ()
 
 transferDeposit ()
 
 updateDepositStatus ()
 

Data Fields

 $_deposit
 
 $_task
 

Protected Member Functions

 _generateElement ($dom, $elementName, $content, $namespace=null)
 
 _logMessage ($message)
 

Detailed Description

Represent a PLN deposit package.

Definition at line 17 of file DepositPackage.inc.php.

Constructor & Destructor Documentation

◆ __construct()

DepositPackage::__construct (   $deposit,
  $task = null 
)

Constructor.

Parameters
$depositDeposit
$taskScheduledTask

Definition at line 40 of file DepositPackage.inc.php.

Member Function Documentation

◆ _cleanFileList()

DepositPackage::_cleanFileList (   $xml,
$fileList 
)

Read a list of file paths from the specified native XML string and clean up the XML's pathnames.

Parameters
$xmlstring
$fileListarray Reference to array to receive file list
Returns
array

Definition at line 415 of file DepositPackage.inc.php.

Referenced by generatePackage().

◆ _generateElement()

DepositPackage::_generateElement (   $dom,
  $elementName,
  $content,
  $namespace = null 
)
protected

Create a DOMElement in the $dom, and set the element name, namespace, and content. Any invalid UTF-8 characters will be dropped. The content will be placed inside a CDATA section.

Parameters
DOMDocument$dom
string$elementName
string$content
string$namespace
Returns
DOMElement

Definition at line 96 of file DepositPackage.inc.php.

Referenced by generateAtomDocument().

◆ _logMessage()

DepositPackage::_logMessage (   $message)
protected

Send a message to a log. If the deposit package is aware of a a scheduled task, the message will be sent to the task's log. Otherwise it will be sent to error_log().

Parameters
$messagestring Locale-specific message to be logged

Definition at line 52 of file DepositPackage.inc.php.

Referenced by generateAtomDocument(), generatePackage(), transferDeposit(), and updateDepositStatus().

◆ generateAtomDocument()

DepositPackage::generateAtomDocument ( )

◆ generatePackage()

DepositPackage::generatePackage ( )

Create a package containing the serialized deposit objects. If the bagit library fails to load, null will be returned.

Returns
string The full path of the created zip archive

Definition at line 253 of file DepositPackage.inc.php.

References $application, _cleanFileList(), _logMessage(), PKPApplication\getApplication(), DAORegistry\getDAO(), getDepositDir(), getPackageFilePath(), PluginRegistry\getPlugin(), importExportErrorHandler(), and PluginRegistry\loadCategory().

Referenced by packageDeposit().

◆ getAtomDocumentPath()

DepositPackage::getAtomDocumentPath ( )

Get the filename used to store the deposit's atom document.

Returns
string

Definition at line 73 of file DepositPackage.inc.php.

References getDepositDir().

Referenced by generateAtomDocument(), and transferDeposit().

◆ getDepositDir()

DepositPackage::getDepositDir ( )

Get the directory used to store deposit data.

Returns
string

Definition at line 64 of file DepositPackage.inc.php.

Referenced by generatePackage(), getAtomDocumentPath(), getPackageFilePath(), and updateDepositStatus().

◆ getPackageFilePath()

DepositPackage::getPackageFilePath ( )

Get the filename used to store the deposit's bag.

Returns
string

Definition at line 81 of file DepositPackage.inc.php.

References getDepositDir().

Referenced by generateAtomDocument(), and generatePackage().

◆ importExportErrorHandler()

DepositPackage::importExportErrorHandler (   $depositId,
  $message 
)

Handle an error during the import/export process.

Parameters
$depositIdint Deposit ID
$messagestring Error message

Definition at line 671 of file DepositPackage.inc.php.

References DAORegistry\getDAO().

Referenced by generatePackage().

◆ packageDeposit()

DepositPackage::packageDeposit ( )

Package a deposit for transfer to and retrieval by the PLN.

Definition at line 523 of file DepositPackage.inc.php.

References generatePackage(), and DAORegistry\getDAO().

◆ transferDeposit()

DepositPackage::transferDeposit ( )

Transfer the atom document to the PLN.

Definition at line 432 of file DepositPackage.inc.php.

References _logMessage(), getAtomDocumentPath(), DAORegistry\getDAO(), and PluginRegistry\getPlugin().

◆ updateDepositStatus()

DepositPackage::updateDepositStatus ( )

Update the deposit's status by checking with the PLN.

Definition at line 582 of file DepositPackage.inc.php.

References _logMessage(), DAORegistry\getDAO(), getDepositDir(), and PluginRegistry\getPlugin().

Field Documentation

◆ $_deposit

Deposit DepositPackage::$_deposit

Definition at line 23 of file DepositPackage.inc.php.

◆ $_task

ScheduledTask DepositPackage::$_task

If the DepositPackage object was created as part of a scheduled task run, then save the task so error messages can be logged there.

Definition at line 33 of file DepositPackage.inc.php.


The documentation for this class was generated from the following file: