Open Journal Systems  2.4.3
 All Classes Namespaces Functions Variables Groups Pages
DOIExportPlugin Class Reference
Inheritance diagram for DOIExportPlugin:
ImportExportPlugin Plugin PKPPlugin DataciteExportPlugin MedraExportPlugin

Public Member Functions

 _checkForTar ()
 
 _displayArticleList (&$templateMgr, &$journal)
 
 _displayGalleyList (&$templateMgr, &$journal)
 
 _displayIssueList (&$templateMgr, &$journal)
 
 _displayPluginHomePage (&$templateMgr, &$journal)
 
 _generateExportFilesForObjects (&$request, &$journal, $exportSpec, $exportPath, &$errors)
 
 _getArticleIssue ($article, $journal)
 
 _getExportPath ()
 
_getObjectsFromIds ($exportType, $objectIds, $journalId, &$errors)
 
_getUnregisteredArticles (&$journal)
 
_getUnregisteredGalleys (&$journal)
 
_getUnregisteredIssues (&$journal)
 
_instantiateSettingsForm (&$journal)
 
_prepareArticleData (&$article, &$journal)
 
_prepareArticleDataByArticleId ($articleId, &$journal)
 
_prepareGalleyData (&$galley, &$journal)
 
 _sendNotification (&$request, $message, $notificationType, $param=null)
 
 _usage ($scriptName, $errors=null)
 
 cleanTmpfiles ($tempdir, $tempfiles)
 
 display (&$args, &$request)
 
 displayAllUnregisteredObjects (&$templateMgr, &$journal)
 
 displaySuppFileList (&$templateMgr, &$journal)
 
 executeCLI ($scriptName, &$args)
 
 exportObjects (&$request, $exportSpec, &$journal, $outputFile=null)
 
 generateExportFiles (&$request, $exportType, &$objects, $targetPath, &$journal, &$errors)
 
 getAdditionalFieldNames ($hookName, $args)
 
 getAllObjectTypes ()
 
 getAllPublishedArticles (&$journal)
 
 getContextSpecificPluginSettingsFile ()
 
 getDaoName ($exportType)
 
 getLocaleFilename ($locale)
 
 getManagementVerbs ()
 
 getObjectName ($exportType)
 
 getObjectNotFoundErrorKey ($exportType)
 
 getPluginId ()
 
 getSettingsFormClassName ()
 
 getTargetFileName ($exportPath, $exportType, $objectId=null)
 
 getTemplatePath ()
 
 isTestMode (&$request)
 
 manage ($verb, $args, &$message, &$messageParams, &$request)
 
 markRegistered (&$request, &$object, $testPrefix)
 
prepareArticleFileData (&$articleFile, &$journal)
 
 register ($category, $path)
 
 registerDaoHook ($daoName)
 
 registerDoi (&$request, &$journal, &$objects, $file)
 
 registerObjects (&$request, $exportSpec, &$journal)
 
 resetRegistration ($objectType, $objectId, &$journal)
 
 saveRegisteredDoi (&$object, $registeredDoi)
 
 tarFiles ($targetPath, $targetFile, $sourceFiles)
 
- Public Member Functions inherited from ImportExportPlugin
 display (&$args, $request)
 
 executeCLI ($scriptName, &$args)
 
 getDescription ()
 
 getDisplayName ()
 
 getManagementVerbs ()
 
 getName ()
 
 manage ($verb, $args, $message, $messageParams=null, $request=null)
 
 setBreadcrumbs ($crumbs=array(), $isSubclass=false)
 
 smartyPluginUrl ($params, &$smarty)
 
 usage ($scriptName)
 
- Public Member Functions inherited from Plugin
 getContextSpecificPluginSettingsFile ()
 
 getNewJournalPluginSettingsFile ()
 
 getSetting ($journalId, $name)
 
 Plugin ()
 
 updateSetting ($journalId, $name, $value, $type=null)
 
- Public Member Functions inherited from PKPPlugin
 _getContextSpecificInstallationHook ()
 
 addHelpData ($locale=null)
 
 addLocaleData ($locale=null)
 
 getCategory ()
 
 getContextSpecificPluginSettingsFile ()
 
 getContextSpecificSetting ($context, $name)
 
 getCurrentVersion ()
 
 getDescription ()
 
 getDisplayName ()
 
 getHelpMappingFilename ()
 
 getHideManagement ()
 
 getInstallDataFile ()
 
 getInstallEmailTemplateDataFile ()
 
 getInstallEmailTemplatesFile ()
 
 getInstallFilterConfigFiles ()
 
 getInstallSchemaFile ()
 
 getInstallSitePluginSettingsFile ()
 
 getLocaleFilename ($locale)
 
 getManagementVerbs ()
 
 getName ()
 
 getPluginPath ()
 
 getSeq ()
 
 getSettingMainContext ()
 
 getTemplatePath ()
 
 import ($class)
 
 installContextSpecificSettings ($hookName, $args)
 
 installData ($hookName, $args)
 
 installEmailTemplateData ($hookName, $args)
 
 installEmailTemplates ($hookName, $args)
 
 installFilters ($hookName, $args)
 
 installLocale ($hookName, $args)
 
 installSiteSettings ($hookName, $args)
 
 isSitePlugin ()
 
 manage ($verb, $args, &$message, &$messageParams, $request=null)
 
 PKPPlugin ()
 
 register ($category, $path)
 
 smartyPluginUrl ($params, &$smarty)
 
 updateContextSpecificSetting ($context, $name, $value, $type=null)
 
 updateSchema ($hookName, $args)
 

Detailed Description

Base class for DOI export/registration plugins.

...

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

Member Function Documentation

DOIExportPlugin::_checkForTar ( )

Test whether the tar binary is available.

Returns
boolean|array Boolean true if available otherwise an array with an error message.

Definition at line 1322 of file DOIExportPlugin.inc.php.

References Config\getVar().

Referenced by exportObjects().

DOIExportPlugin::_displayArticleList ( $templateMgr,
$journal 
)

Display a list of articles for export.

Parameters
$templateMgrTemplateManager
$journalJournal

Definition at line 989 of file DOIExportPlugin.inc.php.

References _prepareArticleData(), getAllPublishedArticles(), PKPHandler\getRangeInfo(), getTemplatePath(), registerDaoHook(), and ImportExportPlugin\setBreadcrumbs().

Referenced by display().

DOIExportPlugin::_displayGalleyList ( $templateMgr,
$journal 
)

Display a list of galleys for export.

Parameters
$templateMgrTemplateManager
$journalJournal

Definition at line 1039 of file DOIExportPlugin.inc.php.

References _prepareGalleyData(), getAllPublishedArticles(), DAORegistry\getDAO(), PKPHandler\getRangeInfo(), getTemplatePath(), registerDaoHook(), and ImportExportPlugin\setBreadcrumbs().

Referenced by display().

DOIExportPlugin::_displayIssueList ( $templateMgr,
$journal 
)

Display a list of issues for export.

Parameters
$templateMgrTemplateManager
$journalJournal

Definition at line 955 of file DOIExportPlugin.inc.php.

References DAORegistry\getDAO(), PKPHandler\getRangeInfo(), getTemplatePath(), registerDaoHook(), AppLocale\requireComponents(), and ImportExportPlugin\setBreadcrumbs().

Referenced by display().

DOIExportPlugin::_displayPluginHomePage ( $templateMgr,
$journal 
)

Display the plug-in home page.

Parameters
$templateMgrTemplageManager
$journalJournal

Definition at line 915 of file DOIExportPlugin.inc.php.

References _instantiateSettingsForm(), Plugin\getSetting(), getTemplatePath(), PluginRegistry\loadCategory(), and ImportExportPlugin\setBreadcrumbs().

Referenced by display().

DOIExportPlugin::_generateExportFilesForObjects ( $request,
$journal,
  $exportSpec,
  $exportPath,
$errors 
)

Generate export files for the given export spec.

Parameters
$requestRequest
$journalJournal
$exportSpecarray
$exportPathstring
$errorsarray
Returns
array A list of generated files together with the objects contained within the file.

Definition at line 1288 of file DOIExportPlugin.inc.php.

References _getObjectsFromIds(), cleanTmpfiles(), and generateExportFiles().

Referenced by exportObjects(), and registerObjects().

DOIExportPlugin::_getArticleIssue (   $article,
  $journal 
)

Return the issue of an article.

The issue will be cached if it is not yet cached.

Parameters
$articleArticle
$journalJournal
Returns
Issue

Definition at line 1262 of file DOIExportPlugin.inc.php.

References DAORegistry\getDAO().

Referenced by _prepareArticleData(), and getAllPublishedArticles().

DOIExportPlugin::_getExportPath ( )

Return the plug-ins export directory.

This will create the directory if it doesn't exist yet.

Returns
string|array The export directory name or an array with errors if something went wrong.

Definition at line 1343 of file DOIExportPlugin.inc.php.

References getPluginId(), and Config\getVar().

Referenced by exportObjects(), and registerObjects().

& DOIExportPlugin::_getObjectsFromIds (   $exportType,
  $objectIds,
  $journalId,
$errors 
)

Retrieve the objects corresponding to the given ids.

Parameters
$exportTypeinteger One of the DOI_EXPORT_* constants.
$objectIdsinteger|array
$journalIdinteger
$errorsarray
Returns
array|boolean

Definition at line 1366 of file DOIExportPlugin.inc.php.

References DAORegistry\getDAO(), getDaoName(), and getObjectNotFoundErrorKey().

Referenced by _generateExportFilesForObjects(), and resetRegistration().

& DOIExportPlugin::_getUnregisteredArticles ( $journal)

Retrieve all unregistered articles and their corresponding issues.

Parameters
$journalJournal
Returns
array

Definition at line 1124 of file DOIExportPlugin.inc.php.

References _prepareArticleData(), DAORegistry\getDAO(), and getPluginId().

Referenced by displayAllUnregisteredObjects().

& DOIExportPlugin::_getUnregisteredGalleys ( $journal)

Retrieve all unregistered galleys and their corresponding issues and articles.

Parameters
$journalJournal
Returns
array

Definition at line 1146 of file DOIExportPlugin.inc.php.

References _prepareGalleyData(), DAORegistry\getDAO(), and getPluginId().

Referenced by displayAllUnregisteredObjects().

& DOIExportPlugin::_getUnregisteredIssues ( $journal)

Retrieve all unregistered issues.

Parameters
$journalJournal
Returns
array

Definition at line 1099 of file DOIExportPlugin.inc.php.

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

Referenced by displayAllUnregisteredObjects().

& DOIExportPlugin::_instantiateSettingsForm ( $journal)

Instantiate the settings form.

Parameters
$journalJournal
Returns
DOIExportSettingsForm

Definition at line 1440 of file DOIExportPlugin.inc.php.

References getSettingsFormClassName().

Referenced by _displayPluginHomePage(), and manage().

& DOIExportPlugin::_prepareArticleData ( $article,
$journal 
)

Identify the issue of the given article.

Parameters
$articlePublishedArticle
$journalJournal
Returns
array|null Return prepared article data or null if the article is not from a published issue.

Definition at line 1231 of file DOIExportPlugin.inc.php.

References _getArticleIssue().

Referenced by _displayArticleList(), _getUnregisteredArticles(), and _prepareArticleDataByArticleId().

& DOIExportPlugin::_prepareArticleDataByArticleId (   $articleId,
$journal 
)

Identify published article and issue for the given article id.

Parameters
$articleIdinteger
$journalJournal
Returns
array|null An array with the published article and issue of the given article ID. If a published article cannot be identified (i.e. if the given article ID belongs to an unpublished article) then null will be returned.

Definition at line 1199 of file DOIExportPlugin.inc.php.

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

Referenced by prepareArticleFileData().

& DOIExportPlugin::_prepareGalleyData ( $galley,
$journal 
)

Identify published article, issue and language of the given galley.

Parameters
$galleyArticleGalley
$journalJournal
Returns
array|null An array with article, issue and language of the given galley. Null will be returned if one of these objects cannot be identified for the galley (e.g. when the galley belongs to an unpublished article).

Definition at line 1172 of file DOIExportPlugin.inc.php.

References DAORegistry\getDAO(), PKPLocale\getIso1FromLocale(), and prepareArticleFileData().

Referenced by _displayGalleyList(), and _getUnregisteredGalleys().

DOIExportPlugin::_sendNotification ( $request,
  $message,
  $notificationType,
  $param = null 
)

Add a notification.

Parameters
$requestRequest
$messagestring An i18n key.
$notificationTypeinteger One of the NOTIFICATION_TYPE_* constants.
$paramstring An additional parameter for the message.

Definition at line 1455 of file DOIExportPlugin.inc.php.

Referenced by display().

DOIExportPlugin::_usage (   $scriptName,
  $errors = null 
)

Display execution errors (if any) and command-line usage information.

Parameters
$scriptNamestring
$errorsarray An optional list of translated error messages.

Definition at line 1412 of file DOIExportPlugin.inc.php.

References ImportExportPlugin\getName(), and getPluginId().

Referenced by executeCLI().

DOIExportPlugin::cleanTmpfiles (   $tempdir,
  $tempfiles 
)

Remove the given temporary files.

Parameters
$tempdirstring
$tempfilesarray

Definition at line 865 of file DOIExportPlugin.inc.php.

Referenced by _generateExportFilesForObjects(), exportObjects(), DataciteExportPlugin\generateExportFiles(), and registerObjects().

DOIExportPlugin::display ( $args,
$request 
)
See Also
ImportExportPlugin::display()

This supports the following actions:

  • index: the plug-ins home page
  • all, issues, articles, galleys, suppFiles: lists with exportable objects
  • exportIssue, exportArticle, exportGalley, exportSuppFile: export a single object
  • exportIssues, exportArticles, exportGalleys, exportSuppFiles: export several objects at a time
  • registerIssue, registerArticle, registerGalley, registerSuppFile: register a single object
  • registerIssues, registerArticles, registerGalleys, registerSuppFiles: register several objects at a time
  • resetIssue, resetArticle, resetGalley, resetSuppFile: reset an object to "unregistered" state.

Definition at line 138 of file DOIExportPlugin.inc.php.

References _displayArticleList(), _displayGalleyList(), _displayIssueList(), _displayPluginHomePage(), _sendNotification(), displayAllUnregisteredObjects(), displaySuppFileList(), exportObjects(), getAllObjectTypes(), ImportExportPlugin\getName(), Plugin\getSetting(), isTestMode(), registerObjects(), and resetRegistration().

DOIExportPlugin::displayAllUnregisteredObjects ( $templateMgr,
$journal 
)

Display a list of all yet unregistered objects.

Parameters
$templateMgrTemplateManager
$journalJournal

Definition at line 454 of file DOIExportPlugin.inc.php.

References _getUnregisteredArticles(), _getUnregisteredGalleys(), _getUnregisteredIssues(), getTemplatePath(), AppLocale\requireComponents(), and ImportExportPlugin\setBreadcrumbs().

Referenced by display().

DOIExportPlugin::displaySuppFileList ( $templateMgr,
$journal 
)

Display a list of supplementary files for export.

Parameters
$templateMgrTemplateManager
$journalJournal

Definition at line 470 of file DOIExportPlugin.inc.php.

Referenced by display().

DOIExportPlugin::executeCLI (   $scriptName,
$args 
)
DOIExportPlugin::exportObjects ( $request,
  $exportSpec,
$journal,
  $outputFile = null 
)

Export publishing objects.

Parameters
$requestRequest
$exportSpecarray An array with DOI_EXPORT_* constants as keys and object ids as values.
$journalJournal
$outputFilestring The final file to export to (if not given then a standard file name convention will be used).
Returns
boolean|array True for success or an array of error messages.

Definition at line 536 of file DOIExportPlugin.inc.php.

References _checkForTar(), _generateExportFilesForObjects(), _getExportPath(), cleanTmpfiles(), getPluginId(), and tarFiles().

Referenced by display(), and executeCLI().

DOIExportPlugin::generateExportFiles ( $request,
  $exportType,
$objects,
  $targetPath,
$journal,
$errors 
)

Generate the export data model.

Parameters
$requestRequest
$exportTypeinteger
$objectsarray
$targetPathstring
$journalJournal
$errorsarray Output parameter for error details when the function returns false.
Returns
array|boolean Either an array of generated export files together with the contained objects or false if not successful.

Definition at line 702 of file DOIExportPlugin.inc.php.

Referenced by _generateExportFilesForObjects().

DOIExportPlugin::getAdditionalFieldNames (   $hookName,
  $args 
)

Hook callback that returns the "registeredDoi" setting's name prefixed with the plug-in's id to avoid name collisions.

See Also
DAO::getAdditionalFieldNames()
Parameters
$hookNamestring
$argsarray

Definition at line 852 of file DOIExportPlugin.inc.php.

References getPluginId().

DOIExportPlugin::getAllObjectTypes ( )

Return the object types supported by this plug-in.

Returns
array An array with object names and the corresponding export types.

Definition at line 441 of file DOIExportPlugin.inc.php.

Referenced by display(), and executeCLI().

DOIExportPlugin::getAllPublishedArticles ( $journal)

Retrieve all published articles.

Parameters
$journalJournal
Returns
DAOResultFactory

Definition at line 479 of file DOIExportPlugin.inc.php.

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

Referenced by _displayArticleList(), _displayGalleyList(), and DataciteExportPlugin\displaySuppFileList().

DOIExportPlugin::getContextSpecificPluginSettingsFile ( )
DOIExportPlugin::getDaoName (   $exportType)

Identify DAO and DAO method to extract objects for a given export type.

Parameters
$exportTypeOne of the DOI_EXPORT_* constants
Returns
array A list with the DAO name and DAO method name.

Definition at line 880 of file DOIExportPlugin.inc.php.

Referenced by _getObjectsFromIds().

DOIExportPlugin::getLocaleFilename (   $locale)
See Also
PKPPlugin::getLocaleFilename($locale)

Definition at line 104 of file DOIExportPlugin.inc.php.

References PKPPlugin\getPluginPath().

DOIExportPlugin::getManagementVerbs ( )
DOIExportPlugin::getObjectName (   $exportType)

Get a string representation of the object being exported by a given export type.

Parameters
$exportTypeinteger One of the DOI_EXPORT_* constants.
Returns
string

Definition at line 680 of file DOIExportPlugin.inc.php.

Referenced by getTargetFileName().

DOIExportPlugin::getObjectNotFoundErrorKey (   $exportType)

Return a translation key for the "object not found" error message for a given export type.

Parameters
$exportTypeOne of the DOI_EXPORT_* constants
Returns
string A translation key.

Definition at line 896 of file DOIExportPlugin.inc.php.

Referenced by _getObjectsFromIds().

DOIExportPlugin::getPluginId ( )

Return the directory below the files dir where export files should be placed.

Returns
string

Definition at line 424 of file DOIExportPlugin.inc.php.

Referenced by _getExportPath(), _getUnregisteredArticles(), _getUnregisteredGalleys(), _getUnregisteredIssues(), _usage(), exportObjects(), getAdditionalFieldNames(), and saveRegisteredDoi().

DOIExportPlugin::getSettingsFormClassName ( )

Return the class name of the plug-in's settings form.

Returns
string

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

Referenced by _instantiateSettingsForm().

DOIExportPlugin::getTargetFileName (   $exportPath,
  $exportType,
  $objectId = null 
)

Returns file name and file type of the target export file for the given export type and object ids.

Parameters
$exportPathstring
$exportTypeinteger One of the DOI_EXPORT_* constants.
$objectIdint An optional object id.
Returns
string The generated file name.

Definition at line 661 of file DOIExportPlugin.inc.php.

References getObjectName().

Referenced by MedraExportPlugin\generateExportFiles(), and DataciteExportPlugin\generateExportFiles().

DOIExportPlugin::isTestMode ( $request)

Check whether we are in test mode.

Parameters
$requestRequest
Returns
boolean

Definition at line 752 of file DOIExportPlugin.inc.php.

Referenced by DataciteExportPlugin\_getObjectUrl(), display(), markRegistered(), MedraExportPlugin\registerDoi(), and DataciteExportPlugin\registerDoi().

DOIExportPlugin::manage (   $verb,
  $args,
$message,
$messageParams,
$request 
)
DOIExportPlugin::markRegistered ( $request,
$object,
  $testPrefix 
)

Mark an object as "registered" by saving it's DOI to the object's "registeredDoi" setting. We prefix the setting with the plug-in's id so that we do not get name clashes when several DOI registration plug-ins are active at the same time. $request Request

Parameters
$objectIssue|PublishedArticle|ArticleGalley|SuppFile $testPrefix string

Definition at line 768 of file DOIExportPlugin.inc.php.

References isTestMode(), String\regexp_replace(), and saveRegisteredDoi().

Referenced by MedraExportPlugin\registerDoi(), and DataciteExportPlugin\registerDoi().

& DOIExportPlugin::prepareArticleFileData ( $articleFile,
$journal 
)

Identify published article and issue of the given article file.

Parameters
$articleFileArticleFile
$journalJournal
Returns
array|null An array with the article and issue of the given article file. Null will be returned if one of these objects cannot be identified (e.g. when the article file belongs to an unpublished article).

Definition at line 509 of file DOIExportPlugin.inc.php.

References _prepareArticleDataByArticleId().

Referenced by _prepareGalleyData(), and DataciteExportPlugin\_prepareSuppFileData().

DOIExportPlugin::register (   $category,
  $path 
)
See Also
PKPPlugin::register()

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

References PKPPlugin\addLocaleData().

DOIExportPlugin::registerDaoHook (   $daoName)

Register the hook that adds an additional field name to objects.

Parameters
$daoNamestring

Definition at line 840 of file DOIExportPlugin.inc.php.

References HookRegistry\register().

Referenced by _displayArticleList(), _displayGalleyList(), _displayIssueList(), DataciteExportPlugin\displaySuppFileList(), and saveRegisteredDoi().

DOIExportPlugin::registerDoi ( $request,
$journal,
$objects,
  $file 
)

Register the given DOI.

Parameters
$requestRequest
$journalJournal
$objectsarray
$filestring

Definition at line 743 of file DOIExportPlugin.inc.php.

Referenced by registerObjects().

DOIExportPlugin::registerObjects ( $request,
  $exportSpec,
$journal 
)

Register publishing objects.

Parameters
$requestRequest
$exportSpecarray An array with DOI_EXPORT_* constants as keys and object ids as values.
$journalJournal
Returns
boolean|array True for success or an array of error messages.

Definition at line 621 of file DOIExportPlugin.inc.php.

References _generateExportFilesForObjects(), _getExportPath(), cleanTmpfiles(), and registerDoi().

Referenced by display(), and executeCLI().

DOIExportPlugin::resetRegistration (   $objectType,
  $objectId,
$journal 
)

Reset the given object.

Parameters
$objectTypeinteger A DOI_EXPORT_* constant.
$objectIdinteger The ID of the object to be reset.
$journalJournal
Returns
boolean|array An array of error messages if something went wrong or boolean 'true' for success.

Definition at line 787 of file DOIExportPlugin.inc.php.

References _getObjectsFromIds(), and saveRegisteredDoi().

Referenced by display().

DOIExportPlugin::saveRegisteredDoi ( $object,
  $registeredDoi 
)

Set the object's "registeredDoi" setting.

Parameters
$objectIssue|PublishedArticle|ArticleGalley|SuppFile $registeredDoi string

Definition at line 806 of file DOIExportPlugin.inc.php.

References DAORegistry\getDAO(), getPluginId(), and registerDaoHook().

Referenced by markRegistered(), and resetRegistration().

DOIExportPlugin::tarFiles (   $targetPath,
  $targetFile,
  $sourceFiles 
)

Create a tar archive.

Parameters
$targetPathstring
$targetFilestring
$sourceFilesarray

Definition at line 712 of file DOIExportPlugin.inc.php.

References Config\getVar().

Referenced by exportObjects().


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