Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
lrosenstrom committed Aug 27, 2021
2 parents e126f39 + 3387338 commit 3f37984
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion fgsMetsMods/OAIMetadataFormatPlugin_FgsMetsMods.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ static function getNamespace() {
}

static function getVersion() {
return '1.1.2';
return '1.1.3';
}

static function getUrl() {
Expand Down
4 changes: 3 additions & 1 deletion fgsMetsMods/OAIMetadataFormat_FgsMetsMods.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ function toXml($record, $format = null) {
$galleys = $article->getGalleys();
$submissionFileService = Services::get('submissionFile');
$articleUrl = $request->getDispatcher()->url($request, ROUTE_PAGE, null, 'article', 'view', $article->getId());

$altObjectId = explode('kb.se/', $articleUrl)[1];

$temporaryFileManager = new PrivateFileManager();
$basePath = $temporaryFileManager->getBasePath();

Expand Down Expand Up @@ -105,6 +106,7 @@ function toXml($record, $format = null) {
'journal' => $journal,
'article' => $article,
'articleUrl' => $articleUrl,
'altObjectId' => $altObjectId,
'issue' => $record->getData('issue'),
'section' => $record->getData('section'),
'keywords' => $simpleKeywords,
Expand Down
14 changes: 11 additions & 3 deletions fgsMetsMods/templates/record.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:mods="http://www.loc.gov/mods/v3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
{if $article->getStoredPubId('doi')}
OBJID="doi:{$article->getStoredPubId('doi')|escape}"
{else}
OBJID="{$altObjectId|escape}"
{/if}
TYPE="SIP"
LABEL="{$article->getTitle($article->getLocale())|escape}"
PROFILE="http://www.kb.se/namespace/mets/fgs/eARD_Paket_FGS-PUBL.xml">
Expand Down Expand Up @@ -92,15 +96,21 @@
</mods:originInfo>
{if $article->getStoredPubId('doi')}
<mods:identifier type="doi">doi:{$article->getStoredPubId('doi')|escape}</mods:identifier>
{else}
{* Fallback alternative following (R101) in
http://www.kb.se/namespace/digark/deliveryspecification/deposit/fgs-publ/mods/MODS_enligt_FGS-PUBL.pdf *}
<mods:identifier type="uri">{$articleUrl|escape}</mods:identifier>
{/if}
<mods:relatedItem type="host">
<mods:titleInfo>
<mods:title lang="{$journalPrimaryLanguage}">{$journal->getName($journal->getPrimaryLocale())|escape}</mods:title>
</mods:titleInfo>
<mods:part>
{if $issue->getLocalizedTitle()}
<mods:detail type="issue">
<mods:title>{$issue->getLocalizedTitle()|escape}</mods:title>
</mods:detail>
{/if}
<mods:detail type="volume">
<mods:number>{$issue->getVolume()|escape}</mods:number>
<mods:caption>vol.</mods:caption>
Expand Down Expand Up @@ -148,9 +158,7 @@
<mods:abstract lang="{$articleLanguage|escape}">{$abstract|escape}</mods:abstract>
{/if}
<mods:location>
<mods:url usage="primary">
{$articleUrl|escape}
</mods:url>
<mods:url usage="primary">{$articleUrl|escape}</mods:url>
</mods:location>
</mods:mods>
</xmlData>
Expand Down
4 changes: 2 additions & 2 deletions fgsMetsMods/version.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
<version>
<application>fgsMetsMods</application>
<type>plugins.oaiMetadataFormats</type>
<release>1.1.2</release>
<date>2021-06-11</date>
<release>1.1.3</release>
<date>2021-08-27</date>
</version>

0 comments on commit 3f37984

Please sign in to comment.