|
Open Journal Systems
3.3.0
|
Public Member Functions | |
| __construct ($plugin, $xmlpsWrapper, $user) | |
| addFileToSubmissionGalley ($existing_galley_by_labels, $submission, $genreId, $format, $filePath, $params=array()) | |
| addXmlDocumentToSubmissionFileList ($journal, $submission, $filePath, $params) | |
| getCitationStyleHash ($contextId) | |
| handleArchiveExtractionAfterGalleyGenerate ($extractionPath, $journal, $submission, $submissionFile, $fileName) | |
| handleArchiveExtractionAfterXmlConversion ($extractionPath, $journal, $submission, $submissionFile, $fileStage, $fileName) | |
| retrieveConversionJobArchive ($submissionFile, $jobId, $statusCallbackFn=null, $maxReq=180, $sleep=5) | |
| triggerConversion ($journal, $submissionFile, $stage, $target, $jobInfoId) | |
| unzipArchive ($zipFile) | |
| zipArchiveExtract ($zipFile, $destination, &$message, $validFiles=array()) | |
Static Public Member Functions | |
| static | canUseCredentialsFromConfig ($creds) |
| static | createConversionJobInfo ($journal, $user, $fileId) |
| static | getOTSWrapperInstance ($plugin, $journal, $userObject, $reuseCached=true) |
| static | makeAccessToken ($user) |
| static | readCredentialsFromConfig () |
| static | validateAccessToken ($user, $accessKey) |
Protected Member Functions | |
| _addDependentImageToXmlDocument ($journal, $submission, $filePath, $params) | |
| _processHtmlMediaFiles ($context, $submission, $submissionFile, $stage, $htmlArchiveFilePath) | |
| buildSubmissionMetadata ($journal, $submission) | |
Protected Attributes | |
| $_params = null | |
| $_plugin = null | |
| $_xmlpsWrapper = null | |
Static Protected Attributes | |
| static | $_otsWrapper = null |
Markup conversion Helper class.
Definition at line 17 of file MarkupConversionHelper.inc.php.
| MarkupConversionHelper::__construct | ( | $plugin, | |
| $xmlpsWrapper, | |||
| $user | |||
| ) |
Constructor
| $plugin | MarkupPlugin |
| $xmlpsWrapper | XMLPSWrapper |
| $user | User |
Definition at line 42 of file MarkupConversionHelper.inc.php.
|
protected |
Add image as dependent file to xml document
| $journal | Journal |
| $submission | Submission |
| $filePath | string Path to file in archive |
| $params | array Additional parameters (assoc type, assoc id) |
Definition at line 356 of file MarkupConversionHelper.inc.php.
References Core\getCurrentDate(), DAORegistry\getDAO(), and AppLocale\getLocale().
Referenced by _processHtmlMediaFiles().
|
protected |
Extract HTML archive and attach media files to XML document (dependent files)
| $context | Journal |
| $submission | Submission |
| $submissionFile | Submission File |
| $stage | int stage |
| $filePath | string Path to HTML archive |
| $params | array Additional parameters (assoc type, assoc id) |
Definition at line 463 of file MarkupConversionHelper.inc.php.
References _addDependentImageToXmlDocument(), fatalError(), and zipArchiveExtract().
Referenced by handleArchiveExtractionAfterXmlConversion().
| MarkupConversionHelper::addFileToSubmissionGalley | ( | $existing_galley_by_labels, | |
| $submission, | |||
| $genreId, | |||
| $format, | |||
| $filePath, | |||
$params = array() |
|||
| ) |
Add a document as galley file
| $existing_galley_by_labels | array Array of existing galleys for submission indexed by label |
| $submission | object Submission object |
| $genreId | int Genre ID |
| $format | string Asset format |
| $fileName | string File to process |
Definition at line 398 of file MarkupConversionHelper.inc.php.
References Core\getCurrentDate(), DAORegistry\getDAO(), and AppLocale\getLocale().
Referenced by handleArchiveExtractionAfterGalleyGenerate().
| MarkupConversionHelper::addXmlDocumentToSubmissionFileList | ( | $journal, | |
| $submission, | |||
| $filePath, | |||
| $params | |||
| ) |
Add converted xml document to file list for stage
| $journal | Journal |
| $submission | Submission |
| $filePath | string Path to file in archive |
| $params | array Additional parameters (file stage, assoc type, assoc id) |
Definition at line 317 of file MarkupConversionHelper.inc.php.
References Core\getCurrentDate(), DAORegistry\getDAO(), and AppLocale\getLocale().
Referenced by handleArchiveExtractionAfterGalleyGenerate(), and handleArchiveExtractionAfterXmlConversion().
|
protected |
Build an array of metadata about submitted file
| $journal | Journal Journal |
| $submission | Submission Submission |
Definition at line 55 of file MarkupConversionHelper.inc.php.
References PKPApplication\getCCLicenseBadge(), DAORegistry\getDAO(), PKPString\regexp_match_get(), and AppLocale\requireComponents().
Referenced by triggerConversion().
|
static |
Tells wether the user has specified OTS login credentials in the config file
| $creds | array |
Definition at line 624 of file MarkupConversionHelper.inc.php.
Referenced by MarkupHandler\_conversion(), MarkupSettingsForm\execute(), MarkupPlugin\getOTSLoginParametersForJournal(), MarkupSettingsForm\initData(), and MarkupSettingsForm\validate().
|
static |
Creates markup job info
Definition at line 563 of file MarkupConversionHelper.inc.php.
References DAORegistry\getDAO().
Referenced by MarkupBatchGatewayPlugin\fetch(), MarkupPlugin\fetchGateway(), and BatchConversionTool\processOne().
| MarkupConversionHelper::getCitationStyleHash | ( | $contextId | ) |
Return the citation hash to use either from config file or settings
| $contextId | int |
Definition at line 155 of file MarkupConversionHelper.inc.php.
References Config\getVar().
Referenced by triggerConversion().
|
static |
Return an instance of OTS wrapper
| $plugin | MarkupPlugin |
| $journal | Journal |
| $userObject | User |
| $useCached | boolean Whether the cached object can be reused. |
Definition at line 590 of file MarkupConversionHelper.inc.php.
References $_otsWrapper.
Referenced by MarkupGatewayPlugin\_initXMLPSWrapper(), MarkupBatchGatewayPlugin\fetch(), MarkupBatchGatewayPlugin\initMarkupConversionHelper(), and BatchConversionTool\initProperties().
| MarkupConversionHelper::handleArchiveExtractionAfterGalleyGenerate | ( | $extractionPath, | |
| $journal, | |||
| $submission, | |||
| $submissionFile, | |||
| $fileName | |||
| ) |
Performs zip extraction after production ready file conversion
| $extractionPath | string | |
| $journal | Journal | |
| $submission | Submission | |
| $submissionFile | SubmissionFile | |
| string | $fileName |
Definition at line 519 of file MarkupConversionHelper.inc.php.
References addFileToSubmissionGalley(), addXmlDocumentToSubmissionFileList(), and DAORegistry\getDAO().
| MarkupConversionHelper::handleArchiveExtractionAfterXmlConversion | ( | $extractionPath, | |
| $journal, | |||
| $submission, | |||
| $submissionFile, | |||
| $fileStage, | |||
| $fileName | |||
| ) |
Performs zip extraction after xml job conversion
| $extractionPath | string |
| $journal | Journal |
| $submission | Submission |
| $submissionFile | SubmissionFile |
| $fileStage | int |
| $fileName | string |
Definition at line 497 of file MarkupConversionHelper.inc.php.
References _processHtmlMediaFiles(), and addXmlDocumentToSubmissionFileList().
|
static |
Create an access token used for Gateway plugin request validation
| $user | User |
Definition at line 642 of file MarkupConversionHelper.inc.php.
Referenced by MarkupPlugin\fetchGateway(), and MarkupBatchConversionHandler\startConversion().
|
static |
Read OTS credentials values from config file
Definition at line 611 of file MarkupConversionHelper.inc.php.
References Config\getVar().
Referenced by MarkupHandler\_conversion(), MarkupSettingsForm\execute(), MarkupPlugin\getOTSLoginParametersForJournal(), MarkupSettingsForm\initData(), and MarkupSettingsForm\validate().
| MarkupConversionHelper::retrieveConversionJobArchive | ( | $submissionFile, | |
| $jobId, | |||
$statusCallbackFn = null, |
|||
$maxReq = 180, |
|||
$sleep = 5 |
|||
| ) |
Retrieves conversion archive from OTS server
| $submissionFile | mixed SubmissionFile |
| $jobId | int XML job ID |
| $statusCallbackFn | Closure |
| $maxReq | int max number of requests to perform |
| $sleep | int number of seconds to pause between requests |
Definition at line 205 of file MarkupConversionHelper.inc.php.
References DAORegistry\getDAO(), XMLPSWrapper\JOB_STATUS_COMPLETED, XMLPSWrapper\JOB_STATUS_PENDING, and XMLPSWrapper\JOB_STATUS_PROCESSING.
| MarkupConversionHelper::triggerConversion | ( | $journal, | |
| $submissionFile, | |||
| $stage, | |||
| $target, | |||
| $jobInfoId | |||
| ) |
Kicks off a submission file conversion on OTS server
| $journal | Journal Journal |
| $submissionFile | mixed SubmissionFile |
| $stage | int Submission stage ID |
| $target | string Job target (xml-conversion or galley-generate) |
| $jobInfoId | int OTS job ID |
Definition at line 172 of file MarkupConversionHelper.inc.php.
References buildSubmissionMetadata(), getCitationStyleHash(), and DAORegistry\getDAO().
| MarkupConversionHelper::unzipArchive | ( | $zipFile | ) |
Extract archive file.
| $zipFile | string Path to zip archive |
Definition at line 239 of file MarkupConversionHelper.inc.php.
References zipArchiveExtract().
|
static |
Validates access key supplied to a gateway plugin
| $user | User |
| $accessKey | string |
Definition at line 655 of file MarkupConversionHelper.inc.php.
References AccessKeyManager\generateKeyHash().
Referenced by MarkupBatchGatewayPlugin\fetch(), and MarkupGatewayPlugin\fetch().
| MarkupConversionHelper::zipArchiveExtract | ( | $zipFile, | |
| $destination, | |||
| & | $message, | ||
$validFiles = array() |
|||
| ) |
Extract zip a archive
| $zipFile | string File to extract |
| $validFiles | mixed Array with file names to extract |
| $destination | string Destination folder |
| $message | string Reference to status message from ZipArchive |
Definition at line 275 of file MarkupConversionHelper.inc.php.
Referenced by _processHtmlMediaFiles(), and unzipArchive().
|
staticprotected |
Definition at line 34 of file MarkupConversionHelper.inc.php.
Referenced by getOTSWrapperInstance().
|
protected |
array extra parameters
Definition at line 32 of file MarkupConversionHelper.inc.php.
|
protected |
MarkupPlugin Reference to markup plugin
Definition at line 27 of file MarkupConversionHelper.inc.php.
|
protected |
XMLPSWrapper Reference to wrapper class for OTS Service
Definition at line 22 of file MarkupConversionHelper.inc.php.