Open Journal Systems  2.4.3
 All Classes Namespaces Functions Variables Groups Pages
DOIExportDom Class Reference
Inheritance diagram for DOIExportDom:
DataciteExportDom O4DOIExportDom

Public Member Functions

 _addError ($errorTranslationKey, $param=null)
 
createElementWithText ($name, $value, $attributes=array())
 
 DOIExportDom (&$request, &$plugin, &$journal, &$objectCache)
 
generate (&$objects)
 
getCache ()
 
getDoc ()
 
 getErrors ()
 
 getFileType ($articleFile)
 
getJournal ()
 
 getNamespace ()
 
 getObjectLocalePrecedence (&$article, &$galley)
 
 getPluginSetting ($settingName)
 
 getPrimaryTranslation ($localizedData, $localePrecedence)
 
 getProprietaryId (&$journal, $issue=null, $articleOrArticleFile=null, $articleFile=null)
 
 getPublisher ($localePrecedence)
 
getRequest ()
 
 getRootElementName ()
 
 getSubjectClass (&$article, $objectLocalePrecedence)
 
 getTestMode ()
 
 getTranslationsByPrecedence ($localizedData, $localePrecedence)
 
 getXmlSchemaLocation ()
 
retrieveArticlesByIssue (&$issue)
 
retrieveGalleysByArticle (&$article)
 
retrievePublicationObjects (&$object)
 
rootElement ()
 
 translateLanguageToLocale ($language)
 

Detailed Description

Onix for DOI (O4DOI) XML export format implementation.

...

Definition at line 24 of file DOIExportDom.inc.php.

Member Function Documentation

DOIExportDom::_addError (   $errorTranslationKey,
  $param = null 
)

Add an error to the errors list.

Parameters
$errorTranslationKeystring An i18n key.
$paramstring|null An additional translation parameter.

Definition at line 45 of file DOIExportDom.inc.php.

Referenced by DataciteExportDom\_identifierElement(), and O4DOIExportDom\_objectElement().

& DOIExportDom::createElementWithText (   $name,
  $value,
  $attributes = array() 
)

Create an XML element with a text node.

FIXME: Move this to XMLCustomWriter? I leave the decision up to PKP...

Parameters
$namestring
$valuestring
$attributesarray An array with the attribute names as array keys and attribute values as array values.
Returns
XMLNode|DOMImplementation

Definition at line 227 of file DOIExportDom.inc.php.

References getDoc(), and String\html2text().

Referenced by DataciteExportDom\_alternateIdentifiersElement(), DataciteExportDom\_dateElement(), DataciteExportDom\_descriptionsElement(), DataciteExportDom\_identifierElement(), O4DOIExportDom\_otherTextElement(), O4DOIExportDom\_publicationDateElement(), DataciteExportDom\_relatedIdentifierElement(), DataciteExportDom\_resourceTypeElement(), DataciteExportDom\_subjectElement(), DataciteExportDom\_titleElement(), and DataciteExportDom\generate().

DOIExportDom::DOIExportDom ( $request,
$plugin,
$journal,
$objectCache 
)

Constructor

Parameters
$requestRequest
$pluginDOIExportPlugin
$journalJournal
$objectCachePubObjectCache

Definition at line 133 of file DOIExportDom.inc.php.

References XMLCustomWriter\createDocument().

& DOIExportDom::generate ( $objects)

Generate the XML document.

This method either returns a fully validated XML document containing all given objects for export or it returns a boolean 'false' to indicate an error.

If one or more errors occur then DOIExportDom::getErrors() will return localized error details for display by the client.

Parameters
$objectsarray An array of issues, articles or galleys. The array must not contain more than one object type.
Returns
XMLNode|DOMImplementation|boolean An XML document or 'false' if an error occurred.

Definition at line 162 of file DOIExportDom.inc.php.

DOIExportDom::getErrors ( )

Retrieve export error details.

Returns
array

Definition at line 36 of file DOIExportDom.inc.php.

DOIExportDom::getFileType (   $articleFile)

Try to identify the resource type of the given article file.

Parameters
$articleFileArticleFile
Returns
string|null One of the DOI_EXPORT_FILTYPE_* constants or null.

Definition at line 570 of file DOIExportDom.inc.php.

DOIExportDom::getNamespace ( )

Return the XML namespace.

Returns
string

Definition at line 182 of file DOIExportDom.inc.php.

Referenced by rootElement().

DOIExportDom::getObjectLocalePrecedence ( $article,
$galley 
)

Identify the locale precedence for this export.

Parameters
$articlePublishedArticle
$galleyArticleGalley
Returns
array A list of valid PKP locales in descending order of priority.

Definition at line 359 of file DOIExportDom.inc.php.

References getJournal(), PKPLocale\isLocaleValid(), and translateLanguageToLocale().

Referenced by O4DOIExportDom\_objectElement().

DOIExportDom::getPluginSetting (   $settingName)

Get a plug-in setting.

Returns
mixed

Definition at line 91 of file DOIExportDom.inc.php.

References getJournal().

Referenced by O4DOIExportDom\_headerElement(), O4DOIExportDom\_objectElement(), and O4DOIExportDom\_serialWorkElement().

DOIExportDom::getPrimaryTranslation (   $localizedData,
  $localePrecedence 
)

Identify the primary translation from an array of localized data.

Parameters
$localizedDataarray An array of localized data (key: locale, value: localized data).
$localePrecedencearray An array of locales by descending priority.
Returns
mixed|null The value of the primary locale or null if no primary translation could be found.

Definition at line 426 of file DOIExportDom.inc.php.

Referenced by O4DOIExportDom\_contentItemElement(), O4DOIExportDom\_contributorElement(), DataciteExportDom\_creatorsElement(), DataciteExportDom\_descriptionsElement(), DataciteExportDom\_getIssueInformation(), DataciteExportDom\_getIssueToc(), DataciteExportDom\_subjectsElement(), DataciteExportDom\_titlesElement(), DataciteExportDom\generate(), getPublisher(), and getSubjectClass().

DOIExportDom::getProprietaryId ( $journal,
  $issue = null,
  $articleOrArticleFile = null,
  $articleFile = null 
)

Generate a proprietary ID for the given objects.

The idea is to produce an idea that is globally unique within an OJS installation so that we can uniquely identify the exported object just by knowing the proprietary ID.

We're using the internal ID rather than the "best ID" as the "best ID" can be changed by the end user while the internal ID is an automatically assigned database ID that cannot be changed without DBA access.

Parameters
$journalJournal
$issueIssue
$articleOrArticleFilePublishedArticle|ArticleFile An object representing an article.
$articleFileArticleGalley|SuppFile
Returns
string The proprietary ID for the given objects.

Definition at line 497 of file DOIExportDom.inc.php.

Referenced by DataciteExportDom\_alternateIdentifiersElement(), and O4DOIExportDom\_objectElement().

DOIExportDom::getPublisher (   $localePrecedence)

Identify the publisher of the journal.

Parameters
$localePrecedencearray
Returns
string

Definition at line 529 of file DOIExportDom.inc.php.

References getJournal(), and getPrimaryTranslation().

Referenced by O4DOIExportDom\_publisherElement(), and DataciteExportDom\generate().

& DOIExportDom::getRequest ( )

Get the current request.

Returns
Request

Definition at line 71 of file DOIExportDom.inc.php.

Referenced by getTestMode().

DOIExportDom::getRootElementName ( )

The DOM's root element.

Returns
string

Definition at line 174 of file DOIExportDom.inc.php.

Referenced by rootElement().

DOIExportDom::getSubjectClass ( $article,
  $objectLocalePrecedence 
)

Identify the article subject class and code.

Parameters
$articlePublishedArticle
$objectLocalePrecedencearray
Returns
array The subject class and code.

Definition at line 547 of file DOIExportDom.inc.php.

References getJournal(), and getPrimaryTranslation().

Referenced by O4DOIExportDom\_contentItemElement(), and DataciteExportDom\_subjectsElement().

DOIExportDom::getTranslationsByPrecedence (   $localizedData,
  $localePrecedence 
)

Re-order localized data by locale precedence.

Parameters
$localizedDataarray An array of localized data (key: locale, value: localized data).
$localePrecedencearray An array of locales by descending priority.
Returns
array Re-ordered localized data.

Definition at line 456 of file DOIExportDom.inc.php.

Referenced by O4DOIExportDom\_contentItemElement(), O4DOIExportDom\_journalIssueElement(), O4DOIExportDom\_objectElement(), O4DOIExportDom\_serialWorkElement(), and DataciteExportDom\_titlesElement().

DOIExportDom::getXmlSchemaLocation ( )

Return the XML schema location.

Returns
string

Definition at line 190 of file DOIExportDom.inc.php.

Referenced by rootElement().

& DOIExportDom::retrieveArticlesByIssue ( $issue)

Retrieve all articles for the given issue and commit them to the cache.

Parameters
$issueIssue
Returns
array

Definition at line 308 of file DOIExportDom.inc.php.

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

Referenced by DataciteExportDom\retrievePublicationObjects(), and O4DOIExportDom\retrievePublicationObjects().

& DOIExportDom::retrieveGalleysByArticle ( $article)

Retrieve all galleys for the given article and commit them to the cache.

Parameters
$articlePublishedArticle
Returns
array

Definition at line 333 of file DOIExportDom.inc.php.

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

Referenced by DataciteExportDom\retrievePublicationObjects(), and O4DOIExportDom\retrievePublicationObjects().

& DOIExportDom::retrievePublicationObjects ( $object)

Retrieve all the OJS publication objects containing the data required to generate the given O4DOI schema.

Parameters
$objectIssue|PublishedArticle|ArticleGalley The object to export.
Returns
array An array with the required OJS objects.

Definition at line 245 of file DOIExportDom.inc.php.

References getCache(), DAORegistry\getDAO(), and getJournal().

& DOIExportDom::rootElement ( )

Generate the XML root element.

Returns
XMLNode|DOMImplementation

Definition at line 203 of file DOIExportDom.inc.php.

References getDoc(), getNamespace(), getRootElementName(), and getXmlSchemaLocation().

Referenced by DataciteExportDom\generate(), and O4DOIExportDom\generate().

DOIExportDom::translateLanguageToLocale (   $language)

Try to translate an ISO language code to an OJS locale.

Parameters
$languagestring 2- or 3-letter ISO language code
Returns
string|null An OJS locale or null if no matching locale could be found.

Definition at line 402 of file DOIExportDom.inc.php.

References PKPLocale\get3LetterFrom2LetterIsoLanguage(), PKPLocale\getLocaleFrom3LetterIso(), and PKPLocale\isLocaleValid().

Referenced by DataciteExportDom\getObjectLocalePrecedence(), and getObjectLocalePrecedence().


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