PHP Class O4DOIXmlFilter, ojs

Inheritance: extends NativeExportFilter
Mostra file Open project: pkp/ojs Class Usage Examples

Public Methods

Method Description
__construct ( $filterGroup ) Constructor
createExtentNode ( $doc, $file ) : DOMElement Create an extent node.
createHeadNode ( $doc ) : DOMElement Create and return the head node.
createIdentifierNode ( $doc, $workOrProduct, $idType, $id ) : DOMElement Create a work or product id node.
createJournalIssueNode ( $doc, $issue, $journalLocalePrecedence ) : DOMElement Create the journal issue node.
createOtherTextNode ( $doc, $locale, $description ) : DOMElement Create a description text node.
createPublisherNode ( $doc, $journalLocalePrecedence ) : DOMElement Create a publisher node.
createRelatedNode ( $doc, $workOrProduct, $relationCode, $ids ) : DOMElement Create a related work or product node.
createRootNode ( $doc, $rootNodeName ) : DOMElement Create and return the root node.
createSerialPublicationNode ( $doc, $journalLocalePrecedence, $epubFormat = null ) : DOMElement Generate O4DOI serial publication node.
createSerialVersionNode ( $doc, $issn, $productForm, $epubFormat = null ) : DOMElement Create a serial version node.
createSerialWorkNode ( $doc, $journalLocalePrecedence ) : DOMElement Generate O4DOI serial work node.
createTitleNode ( $doc, $locale, $localizedTitle, $titleType ) : DOMElement Create a title node.
getDOIStructuralType ( ) : string Get DOIStructuralType
getObjectLocalePrecedence ( $context, $article, $galley ) : array Identify the locale precedence for this export.
getPrimaryTranslation ( $localizedData, $localePrecedence ) : mixed | null Identify the primary translation from an array of localized data.
getRootNodeName ( ) : string Get root node name
getTranslationsByPrecedence ( $localizedData, $localePrecedence ) : array Re-order localized data by locale precedence.
isWork ( $context, $plugin ) : boolean Get whether the object exported is considered as work
translateLanguageToLocale ( $language ) : string | null Try to translate an ISO language code to an OJS locale.

Method Details

__construct() public method

Constructor
public __construct ( $filterGroup )
$filterGroup FilterGroup

createExtentNode() public method

Create an extent node.
public createExtentNode ( $doc, $file ) : DOMElement
$doc DOMDocument
$file PKPFile
return DOMElement

createHeadNode() public method

Create and return the head node.
public createHeadNode ( $doc ) : DOMElement
$doc DOMDocument
return DOMElement

createIdentifierNode() public method

Create a work or product id node.
public createIdentifierNode ( $doc, $workOrProduct, $idType, $id ) : DOMElement
$doc DOMDocument
$workOrProduct string "Work" or "Product"
$idType string One of the O4DOI_ID_TYPE_* constants
$id string The ID.
return DOMElement

createJournalIssueNode() public method

Create the journal issue node.
public createJournalIssueNode ( $doc, $issue, $journalLocalePrecedence ) : DOMElement
$doc DOMDocument
$issue Issue
$journalLocalePrecedence array
return DOMElement

createOtherTextNode() public method

Create a description text node.
public createOtherTextNode ( $doc, $locale, $description ) : DOMElement
$doc DOMDocument
$locale string
$description string
return DOMElement

createPublisherNode() public method

Create a publisher node.
public createPublisherNode ( $doc, $journalLocalePrecedence ) : DOMElement
$doc DOMDocument
$journalLocalePrecedence array
return DOMElement

createRelatedNode() public method

Create a related work or product node.
public createRelatedNode ( $doc, $workOrProduct, $relationCode, $ids ) : DOMElement
$doc DOMDocument
$workOrProduct string
$relationCode string One of the O4DOI_RELATION_* constants.
$ids array
return DOMElement

createRootNode() public method

Create and return the root node.
public createRootNode ( $doc, $rootNodeName ) : DOMElement
$doc DOMDocument
$rootNodeName string
return DOMElement

createSerialPublicationNode() public method

Generate O4DOI serial publication node.
public createSerialPublicationNode ( $doc, $journalLocalePrecedence, $epubFormat = null ) : DOMElement
$doc DOMDocument
$journalLocalePrecedence array
$epubFormat O4DOI_EPUB_FORMAT_*
return DOMElement

createSerialVersionNode() public method

Create a serial version node.
public createSerialVersionNode ( $doc, $issn, $productForm, $epubFormat = null ) : DOMElement
$doc DOMDocument
$issn string
$productForm One of the O4DOI_PRODUCT_FORM_* constants
$epubFormat O4DOI_EPUB_FORMAT_*
return DOMElement

createSerialWorkNode() public method

Generate O4DOI serial work node.
public createSerialWorkNode ( $doc, $journalLocalePrecedence ) : DOMElement
$doc DOMDocument
$journalLocalePrecedence array
return DOMElement

createTitleNode() public method

Create a title node.
public createTitleNode ( $doc, $locale, $localizedTitle, $titleType ) : DOMElement
$doc DOMDocument
$locale string e.g. 'en_US'
$localizedTitle string
$titleType string One of the O4DOI_TITLE_TYPE_* constants.
return DOMElement

getDOIStructuralType() public method

Get DOIStructuralType
public getDOIStructuralType ( ) : string
return string

getObjectLocalePrecedence() public method

Identify the locale precedence for this export.
public getObjectLocalePrecedence ( $context, $article, $galley ) : array
$context Context
$article PublishedArticle
$galley ArticleGalley
return array A list of valid PKP locales in descending order of priority.

getPrimaryTranslation() public method

Identify the primary translation from an array of localized data.
public getPrimaryTranslation ( $localizedData, $localePrecedence ) : mixed | null
$localizedData array An array of localized data (key: locale, value: localized data).
$localePrecedence array An array of locales by descending priority.
return mixed | null The value of the primary locale or null if no primary translation could be found.

getRootNodeName() public method

Get root node name
public getRootNodeName ( ) : string
return string

getTranslationsByPrecedence() public method

Re-order localized data by locale precedence.
public getTranslationsByPrecedence ( $localizedData, $localePrecedence ) : array
$localizedData array An array of localized data (key: locale, value: localized data).
$localePrecedence array An array of locales by descending priority.
return array Re-ordered localized data.

isWork() public method

Get whether the object exported is considered as work
public isWork ( $context, $plugin ) : boolean
$context Context
$plugin DOIPubIdExportPlugin
return boolean

translateLanguageToLocale() public method

Try to translate an ISO language code to an OJS locale.
public translateLanguageToLocale ( $language ) : string | null
$language string 2- or 3-letter ISO language code
return string | null An OJS locale or null if no matching locale could be found.