-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 55caf34
Showing
17 changed files
with
1,814 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"name": "square-bit/views_oai_pmh", | ||
"type": "drupal-module", | ||
"description": "Views plugins to publish data through the OAI-PMH protocol.", | ||
"keywords": ["Drupal"], | ||
"license": "GPL-2.0-or-later", | ||
"minimum-stability": "dev", | ||
"require": { | ||
"symfony/psr-http-message-bridge": "^2.1", | ||
"picturae/oai-pmh": "^0.5.20", | ||
"nyholm/psr7": "^1.4" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
namespace Drupal\views_oai_pmh\Annotation; | ||
|
||
use Drupal\Component\Annotation\Plugin; | ||
|
||
/** | ||
* Defines a OAI-PMH Metadata Prefix item annotation object. | ||
* | ||
* @see \Drupal\views_oai_pmh\Plugin\MetadataPrefixManager | ||
* @see plugin_api | ||
* | ||
* @Annotation | ||
*/ | ||
class MetadataPrefix extends Plugin { | ||
|
||
|
||
/** | ||
* The plugin ID. | ||
* | ||
* @var string | ||
*/ | ||
public $id; | ||
|
||
/** | ||
* The label of the plugin. | ||
* | ||
* @var \Drupal\Core\Annotation\Translation | ||
* | ||
* @ingroup plugin_translatable | ||
*/ | ||
public $label; | ||
|
||
public $prefix; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<?php | ||
|
||
namespace Drupal\views_oai_pmh\Plugin\MetadataPrefix; | ||
|
||
use Drupal\Core\StringTranslation\StringTranslationTrait; | ||
use Drupal\views_oai_pmh\Plugin\MetadataPrefixInterface; | ||
use Drupal\Component\Plugin\PluginBase; | ||
|
||
/** | ||
* Class DublinCore. | ||
* | ||
* @MetadataPrefix( | ||
* id = "oai_datacite", | ||
* label = "Datacite", | ||
* prefix = "oai_datacite", | ||
* ) | ||
*/ | ||
class Datacite extends PluginBase implements MetadataPrefixInterface { | ||
|
||
use StringTranslationTrait; | ||
|
||
/** | ||
* | ||
*/ | ||
public function getRootNodeName(): string { | ||
return 'oai_datacite'; | ||
} | ||
|
||
/** | ||
* | ||
*/ | ||
public function getRootNodeAttributes(): array { | ||
return []; | ||
} | ||
|
||
/** | ||
* | ||
*/ | ||
public function getSchema(): string { | ||
return 'http://schema.datacite.org/oai/oai-1.1/oai.xsd'; | ||
} | ||
|
||
/** | ||
* | ||
*/ | ||
public function getNamespace(): string { | ||
return 'http://schema.datacite.org/oai/oai-1.1/'; | ||
} | ||
|
||
/** | ||
* | ||
*/ | ||
public function getElements(): array { | ||
return [ | ||
'none' => $this->t('- None -'), | ||
'titles>title' => 'titles > title', | ||
'publisher' => 'publisher', | ||
'subjects>subject' => 'subjects>subject', | ||
'subjects>subject@subjectScheme' => 'subjects>subject@subjectScheme', | ||
'dates>date' => 'dates>date', | ||
'dates>date@dateType' => 'dates>date@dateType', | ||
'descriptions>description' => 'descriptions>description', | ||
'descriptions>description@descriptionType' => 'descriptions>description@descriptionType', | ||
'publicationYear' => 'publicationYear', | ||
'identifier' => 'identifier', | ||
'identifier@identifierType' => 'identifier@identifierType', | ||
'creators>creator>creatorName' => 'creators>creator>creatorName', | ||
'creators>creator>nameIdentifier' => 'creators>creator>nameIdentifier', | ||
'creators>creator>nameIdentifier@nameIdentifierScheme' => 'creators>creator>nameIdentifier@nameIdentifierScheme', | ||
'creators>creator>nameIdentifier@schemeURI' => 'creators>creator>nameIdentifier@schemeURI', | ||
'contributors>contributor>contributorName' => 'contributors>contributor>contributorName', | ||
'contributors>contributor>contributorName@contributorType' => 'contributors>contributor>contributorName@contributorType', | ||
'contributors>contributor>nameIdentifier' => 'contributors>contributor>nameIdentifier', | ||
'contributors>contributor>nameIdentifier@nameIdentifierScheme' => 'contributors>contributor>nameIdentifier@nameIdentifierScheme', | ||
'contributors>contributor>nameIdentifier@schemeURI' => 'contributors>contributor>nameIdentifier@schemeURI', | ||
'resourceType' => 'resourceType', | ||
'resourceType@resourceTypeGeneral' => 'resourceType@resourceTypeGeneral', | ||
'rightsList>rights' => 'rightsList>rights', | ||
'rightsList>rights@rightsURI' => 'rightsList>rights@rightsURI', | ||
]; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
<?php | ||
|
||
namespace Drupal\views_oai_pmh\Plugin\MetadataPrefix; | ||
|
||
use Drupal\views_oai_pmh\Plugin\MetadataPrefixInterface; | ||
use Drupal\Component\Plugin\PluginBase; | ||
|
||
/** | ||
* Class DublinCore. | ||
* | ||
* @MetadataPrefix( | ||
* id = "oai_dc", | ||
* label = "Dublin Core", | ||
* prefix = "oai_dc", | ||
* ) | ||
*/ | ||
class DublinCore extends PluginBase implements MetadataPrefixInterface { | ||
|
||
/** | ||
* | ||
*/ | ||
public function getSchema(): string { | ||
return 'http://www.openarchives.org/OAI/2.0/oai_dc.xsd'; | ||
} | ||
|
||
/** | ||
* | ||
*/ | ||
public function getNamespace(): string { | ||
return 'http://www.openarchives.org/OAI/2.0/oai_dc/'; | ||
} | ||
|
||
/** | ||
* | ||
*/ | ||
public function getRootNodeName(): string { | ||
return 'oai_dc:dc'; | ||
} | ||
|
||
/** | ||
* | ||
*/ | ||
public function getRootNodeAttributes(): array { | ||
return [ | ||
'@xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance', | ||
'@xsi:schemaLocation' => 'http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd', | ||
'@xmlns:oai_dc' => 'http://www.openarchives.org/OAI/2.0/oai_dc/', | ||
'@xmlns:dc' => 'http://purl.org/dc/elements/1.1/', | ||
]; | ||
} | ||
|
||
/** | ||
* | ||
*/ | ||
public function getElements(): array { | ||
return [ | ||
'none' => t('- None -'), | ||
'dc:title' => 'dc:title', | ||
'dc:creator' => 'dc:creator', | ||
'dc:subject' => 'dc:subject', | ||
'dc:description' => 'dc:description', | ||
'dc:publisher' => 'dc:publisher', | ||
'dc:contributor' => 'dc:contributor', | ||
'dc:date' => 'dc:date', | ||
'dc:type' => 'dc:type', | ||
'dc:format' => 'dc:format', | ||
'dc:identifier' => 'dc:identifier', | ||
'dc:source' => 'dc:source', | ||
'dc:language' => 'dc:language', | ||
'dc:relation' => 'dc:relation', | ||
'dc:coverage' => 'dc:coverage', | ||
'dc:rights' => 'dc:rights', | ||
]; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
<?php | ||
|
||
namespace Drupal\views_oai_pmh\Plugin\MetadataPrefix; | ||
|
||
use Drupal\Core\StringTranslation\StringTranslationTrait; | ||
use Drupal\views_oai_pmh\Plugin\MetadataPrefixInterface; | ||
use Drupal\Component\Plugin\PluginBase; | ||
|
||
/** | ||
* Class Jats. | ||
* | ||
* @MetadataPrefix( | ||
* id = "oai_jats", | ||
* label = "Jats", | ||
* prefix = "oai_jats", | ||
* ) | ||
*/ | ||
class Jats extends PluginBase implements MetadataPrefixInterface { | ||
|
||
use StringTranslationTrait; | ||
|
||
/** | ||
* | ||
*/ | ||
public function getRootNodeName(): string { | ||
return 'article'; | ||
} | ||
|
||
/** | ||
* | ||
*/ | ||
public function getRootNodeAttributes(): array { | ||
return [ | ||
]; | ||
} | ||
|
||
/** | ||
* | ||
*/ | ||
public function getSchema(): string { | ||
return 'https://jats.nlm.nih.gov/publishing/1.1/xsd/JATS-journalpublishing1.xsd'; | ||
} | ||
|
||
/** | ||
* | ||
*/ | ||
public function getNamespace(): string { | ||
return 'https://jats.nlm.nih.gov/publishing/1.1/'; | ||
} | ||
|
||
/** | ||
* | ||
*/ | ||
public function getElements(): array { | ||
return [ | ||
'none' => $this->t('- None -'), | ||
|
||
'@xmlns' => $this->t('(Root attribute) xmlns'), | ||
'@xmlns:xlink' => $this->t('(Root attribute) xmlns:xlink'), | ||
'@dtd-version' => $this->t('(Root attribute) dtd-version'), | ||
'@specific-use' => $this->t('(Root attribute) specific-use'), | ||
'@article-type' => $this->t('(Root attribute) article-type'), | ||
'@xml:lang' => $this->t('(Root attribute) xml:lang'), | ||
|
||
'front>journal-meta>journal-id' => 'front > journal-meta > journal-id', | ||
'front>journal-meta>journal-id@journal-id-type' => 'front > journal-meta > journal-id@journal-id-type', | ||
|
||
'front>journal-meta>journal-title-group>journal-title' => 'front > journal-meta > journal-title-group > journal-title', | ||
'front>journal-meta>journal-title-group>journal-subtitle' => 'front > journal-meta > journal-title-group > journal-subtitle', | ||
'front>journal-meta>journal-title-group>abbrev-journal-title' => 'front > journal-meta > journal-title-group > abbrev-journal-title', | ||
|
||
'front>journal-meta>contrib-group@content-type' => 'front > journal-meta > contrib-group@content-type', | ||
'front>journal-meta>contrib-group>contrib@contrib-type' => 'front > journal-meta > contrib@contrib-type', | ||
'front>journal-meta>contrib-group>contrib>name>surname' => 'front > journal-meta > contrib > name > surname', | ||
'front>journal-meta>contrib-group>contrib>name>given-names' => 'front > journal-meta > contrib > name > given-names', | ||
'front>journal-meta>contrib-group>contrib>role' => 'front > journal-meta > contrib > role', | ||
|
||
'front>journal-meta>issn' => 'front > journal-meta > issn', | ||
'front>journal-meta>issn@pub-type' => 'front > journal-meta > issn@pub-type', | ||
|
||
'front>journal-meta>publisher>publisher-name' => 'front > journal-meta > publisher > publisher-name', | ||
|
||
'front>article-meta>article-id' => 'front > article-meta > article-id', | ||
'front>article-meta>article-id@pub-id-type' => 'front > article-meta > article-id@pub-id-type', | ||
|
||
'front>article-meta>article-categories>subj-group@subj-group-type' => 'front > article-meta > article-categories > subj-group@subj-group-type', | ||
'front>article-meta>article-categories>subj-group>subject' => 'front > article-meta > article-categories > subj-group > subject', | ||
'front>article-meta>article-categories>subj-group>subj-group@subj-group-type' => 'front > article-meta > article-categories > subj-group > subj-group@subj-group-type', | ||
'front>article-meta>article-categories>subj-group>subj-group>subject' => 'front > article-meta > article-categories > subj-group > subj-group > subject', | ||
|
||
'front>article-meta>title-group>article-title' => 'front > article-meta > title-group > article-title', | ||
'front>article-meta>title-group>article-title@xml:lang' => 'front > article-meta > title-group > article-title@xml:lang', | ||
'front>article-meta>title-group>subtitle' => 'front > article-meta > title-group > subtitle', | ||
'front>article-meta>title-group>subtitle@xml:lang' => 'front > article-meta > title-group > subtitle@xml:lang', | ||
|
||
'front>article-meta>volume' => 'front > article-meta > volume', | ||
|
||
'front>article-meta>contrib-group@content-type' => 'front > article-meta > contrib-group@content-type', | ||
'front>article-meta>contrib-group>contrib@contrib-type' => 'front > article-meta > contrib-group > contrib@contrib-type', | ||
'front>article-meta>contrib-group>contrib@id' => 'front > article-meta > contrib-group > contrib@id', | ||
'front>article-meta>contrib-group>contrib>name>surname' => 'front > article-meta > contrib-group > contrib > name > surname', | ||
'front>article-meta>contrib-group>contrib>name>given-names' => 'front > article-meta > contrib-group > contrib > name > given-names', | ||
|
||
'front>article-meta>contrib-group>contrib>xref@rid' => 'front > article-meta > contrib-group > contrib > xref@rid', | ||
'front>article-meta>contrib-group>contrib>xref@ref-type' => 'front > article-meta > contrib-group > contrib > xref@ref-type', | ||
|
||
'front>article-meta>contrib-group>contrib>contrib-id' => 'front > article-meta > contrib-group > contrib > contrib-id', | ||
'front>article-meta>contrib-group>contrib>contrib-id@contrib-id-type' => 'front > article-meta > contrib-group > contrib > contrib-id@contrib-id-type', | ||
|
||
'front>article-meta>aff' => 'front > article-meta > aff', | ||
'front>article-meta>institution' => 'front > article-meta > aff > institution', | ||
|
||
'front>article-meta>contrib-group>contrib>bio' => 'front > article-meta > contrib-group > contrib > bio', | ||
'front>article-meta>contrib-group>contrib>bio@xml:lang' => 'front > article-meta > contrib-group > contrib > bio@xml:lang', | ||
|
||
'front>article-meta>pub-date>season' => 'front > article-meta > pub-date > season', | ||
'front>article-meta>pub-date@publication-format' => 'front > article-meta > pub-date@publication-format', | ||
'front>article-meta>pub-date@date-type' => 'front > article-meta > pub-date@date-type', | ||
'front>article-meta>pub-date>day' => 'front > article-meta > pub-date > day', | ||
'front>article-meta>pub-date>month' => 'front > article-meta > pub-date > month', | ||
'front>article-meta>pub-date>year' => 'front > article-meta > pub-date > year', | ||
|
||
'front>article-meta>issue' => 'front > article-meta > issue', | ||
'front>article-meta>issue@seq' => 'front > article-meta > issue@seq', | ||
|
||
'front>article-meta>issue-id' => 'front > article-meta > issue-id', | ||
'front>article-meta>issue-id@pub-id-type' => 'front > article-meta > issue-id@pub-id-type', | ||
'front>article-meta>issue-title' => 'front > article-meta > issue-title', | ||
|
||
'front>article-meta>fpage' => 'front > article-meta > fpage', | ||
'front>article-meta>lpage' => 'front > article-meta > lpage', | ||
|
||
'front>article-meta>permissions>copyright-statement' => 'front > article-meta > permissions > copyright-statement', | ||
'front>article-meta>permissions>copyright-year' => 'front > article-meta > permissions > copyright-year', | ||
'front>article-meta>permissions>copyright-holder' => 'front > article-meta > permissions > copyright-holder', | ||
'front>article-meta>permissions>licence@xlink:href' => 'front > article-meta > permissions > licence@xlink:href', | ||
'front>article-meta>permissions>licence>licence-p>graphic@xlink:href' => 'front > article-meta > permissions > licence > licence-p > graphic@xlink:href', | ||
|
||
'front>article-meta>abstract' => 'front > article-meta > abstract', | ||
'front>article-meta>abstract@xml:lang' => 'front > article-meta > abstract@xml:lang', | ||
'front>article-meta>abstract>p' => 'front > article-meta > abstract > p', | ||
'front>article-meta>trans-abstract@xml:lang' => 'front > article-meta > trans-abstract@xml:lang', | ||
'front>article-meta>trans-abstract>p' => 'front > article-meta > trans-abstract > p', | ||
|
||
'front>article-meta>related-object' => 'front > article-meta > related-object', | ||
'front>article-meta>related-object@content-type' => 'front > article-meta > related-object@content-type', | ||
'front>article-meta>related-object@document-type' => 'front > article-meta > related-object@document-type', | ||
|
||
'body' => 'body', | ||
'body>p' => 'body > p', | ||
|
||
'back>ref-list>ref@id' => 'back > ref-list > ref@id', | ||
'back>ref-list>ref>element-citation>styled-content' => 'back > ref-list > ref > element-citation > styled-content', | ||
'back>ref-list>ref>element-citation>styled-content@specific-use' => 'back > ref-list > ref > element-citation > styled-content@specific-use', | ||
'back>ref-list>ref>element-citation>pub-id' => 'back > ref-list > ref > element-citation > pub-id', | ||
'back>ref-list>ref>element-citation>pub-id@pub-id-type' => 'back > ref-list > ref > element-citation > pub-id@pub-id-type', | ||
]; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
namespace Drupal\views_oai_pmh\Plugin; | ||
|
||
use Drupal\Component\Plugin\PluginBase; | ||
|
||
/** | ||
* Base class for OAI-PMH Metadata Prefix plugins. | ||
*/ | ||
abstract class MetadataPrefixBase extends PluginBase implements MetadataPrefixInterface { | ||
|
||
|
||
// Add common methods and abstract methods for your plugin type here. | ||
} |
Oops, something went wrong.