21 import(
'lib.pkp.classes.metadata.MetadataDataObjectAdapter');
31 return 'plugins.metadata.dc11.filter.Dc11SchemaArticleAdapter';
54 assert(is_a($article,
'Article'));
65 $journal = $oaiDao->getJournal($article->getData(
'contextId'));
66 $section = $oaiDao->getSection($article->getSectionId());
74 $authors = $article->getAuthors();
75 foreach($authors as $author) {
76 $dc11Description->addStatement(
'dc:creator', $author->getFullName(
false,
true));
83 $subjects = array_merge_recursive(
84 (array) $submissionKeywordDao->getKeywords($article->getCurrentPublication()->getId(), $supportedLocales),
85 (array) $submissionSubjectDao->getSubjects($article->getCurrentPublication()->getId(), $supportedLocales)
93 $publisherInstitution = $journal->getData(
'publisherInstitution');
94 if (!empty($publisherInstitution)) {
95 $publishers = array($journal->getPrimaryLocale() => $publisherInstitution);
97 $publishers = $journal->getName(
null);
102 $contributors = (array) $article->getSponsor(
null);
103 foreach ($contributors as $locale => $contributor) {
104 $contributors[$locale] = array_map(
'trim', explode(
';', $contributor));
110 if (is_a($article,
'Submission')) {
111 if ($article->getDatePublished()) $dc11Description->addStatement(
'dc:date', date(
'Y-m-d', strtotime($article->getDatePublished()))); }
114 $driverType =
'info:eu-repo/semantics/preprint';
115 $dc11Description->addStatement(
'dc:type', $driverType, METADATA_DESCRIPTION_UNKNOWN_LOCALE);
117 $driverVersion =
'info:eu-repo/semantics/publishedVersion';
118 $dc11Description->addStatement(
'dc:type', $driverVersion, METADATA_DESCRIPTION_UNKNOWN_LOCALE);
121 if (is_a($article,
'Submission')) {
123 $galleys = $articleGalleyDao->getByPublicationId($article->getCurrentPublication()->getId());
125 while ($galley = $galleys->next()) {
126 $dc11Description->addStatement(
'dc:format', $galley->getFileType());
132 if (is_a($article,
'Submission')) {
133 $dc11Description->addStatement(
'dc:identifier', $request->url($journal->getPath(),
'preprint',
'view', array($article->getBestId())));
138 if (is_a($article,
'Submission')) {
140 $galleys = $articleGalleyDao->getByPublicationId($article->getCurrentPublication()->getId())->toArray();
145 if (is_a($article,
'Submission')) {
146 foreach ($galleys as $galley) {
147 $galleyLocale = $galley->getLocale();
148 if(!is_null($galleyLocale) && !in_array($galleyLocale, $locales)) {
149 $locales[] = $galleyLocale;
154 $articleLanguage = $article->getLanguage();
155 if (empty($locales) && !empty($articleLanguage)) {
156 $dc11Description->addStatement(
'dc:language', strip_tags($articleLanguage));
161 if ($includeUrls)
foreach ($galleys as $galley) {
162 $relation = $request->url($journal->getPath(),
'article',
'view', array($article->getBestId(), $galley->getBestGalleyId()));
163 $dc11Description->addStatement(
'dc:relation', $relation);
168 foreach ($pubIdPlugins as $pubIdPlugin) {
169 if ($pubArticleId = $article->getStoredPubId($pubIdPlugin->getPubIdType())) {
170 $dc11Description->addStatement(
'dc:identifier', $pubArticleId);
172 foreach ($galleys as $galley) {
173 if ($pubGalleyId = $galley->getStoredPubId($pubIdPlugin->getPubIdType())) {
174 $dc11Description->addStatement(
'dc:relation', $pubGalleyId);
183 $copyrightHolder = $article->getLocalizedCopyrightHolder();
184 $copyrightYear = $article->getCopyrightYear();
185 if (!empty($copyrightHolder) && !empty($copyrightYear)) {
186 $dc11Description->addStatement(
'dc:rights', __(
'submission.copyrightStatement', array(
'copyrightHolder' => $copyrightHolder,
'copyrightYear' => $copyrightYear)));
188 if ($licenseUrl = $article->getLicenseURL()) $dc11Description->addStatement(
'dc:rights', $licenseUrl);
190 HookRegistry::call(
'Dc11SchemaArticleAdapter::extractMetadataFromDataObject', array($this, $article, $journal, &$dc11Description));
192 return $dc11Description;
215 foreach(
stripAssocArray((array) $localizedValues) as $locale => $values) {
216 if (is_scalar($values)) $values = array($values);
217 foreach($values as $value) {
218 if (!empty($value)) {
219 $description->addStatement($propertyName, $value, $locale);