Skip to content

Commit

Permalink
Merge branch 'fixPublisherName' into 'main'
Browse files Browse the repository at this point in the history
Changes references to the name of the journal to refer to the publisher.

See merge request softwares-pkp/plugins_ojs/carinianaPreservation!12
  • Loading branch information
YvesLepidus committed Feb 10, 2025
2 parents 4961633 + f162750 commit cf3362e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions classes/PreservationXmlBuilder.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,17 @@ private function createTitleSetProperty($dom)
{
$titleSetProperty = $this->createXmlProperty($dom, 'org.lockss.titleSet');

$journalTitle = $this->journal->getData('name', $this->locale);
$journalProperty = $this->createXmlProperty($dom, $journalTitle);
$publisherInstitution = $this->journal->getData('publisherInstitution');
$journalProperty = $this->createXmlProperty($dom, $publisherInstitution);
$titleSetProperty->appendChild($journalProperty);

$nameProperty = $this->createXmlProperty($dom, 'name', "All $journalTitle");
$nameProperty = $this->createXmlProperty($dom, 'name', "All $publisherInstitution");
$journalProperty->appendChild($nameProperty);

$classProperty = $this->createXmlProperty($dom, 'class', 'xpath');
$journalProperty->appendChild($classProperty);

$xpathProperty = $this->createXmlProperty($dom, 'xpath', '[attributes/publisher="' . $journalTitle . '"]');
$xpathProperty = $this->createXmlProperty($dom, 'xpath', '[attributes/publisher="' . $publisherInstitution . '"]');
$journalProperty->appendChild($xpathProperty);

return $titleSetProperty;
Expand All @@ -130,7 +130,7 @@ private function createPreservedYearProperty($dom, $year, $title, $volume, $volu
$preservedYear = $this->createXmlProperty($dom, $preservedYearNodeName);

$preservedYearProperties = [
'attributes.publisher' => $this->journal->getData('name', $this->locale),
'attributes.publisher' => $this->journal->getData('publisherInstitution'),
'journalTitle' => $journalAcronym,
'issn' => $this->journal->getData('printIssn'),
'eissn' => $this->journal->getData('onlineIssn'),
Expand Down
2 changes: 1 addition & 1 deletion classes/PreservedJournalFactory.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function buildPreservedJournal($journal, $baseUrl, $notesAndComments, $lo
$journalPath = $journal->getData('urlPath');
$availableYears = $this->getAvailableYears($journal);
$issuesVolumes = $this->getIssuesVolumes($journal);
$versionDao = DAORegistry::getDAO('VersionDAO'); /* @var $versionDao VersionDAO */
$versionDao = DAORegistry::getDAO('VersionDAO');
$ojsVersion = $versionDao->getCurrentVersion();

return new PreservedJournal(
Expand Down
8 changes: 4 additions & 4 deletions tests/PreservationXmlBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,16 @@ private function createExpectedTitleSetProperty($dom)
{
$titleSet = $this->createXmlProperty($dom, 'org.lockss.titleSet');

$journalProperty = $this->createXmlProperty($dom, $this->title);
$journalProperty = $this->createXmlProperty($dom, $this->publisherOrInstitution);
$titleSet->appendChild($journalProperty);

$nameProperty = $this->createXmlProperty($dom, 'name', 'All ' . $this->title);
$nameProperty = $this->createXmlProperty($dom, 'name', 'All ' . $this->publisherOrInstitution);
$journalProperty->appendChild($nameProperty);

$classProperty = $this->createXmlProperty($dom, 'class', 'xpath');
$journalProperty->appendChild($classProperty);

$xpathProperty = $this->createXmlProperty($dom, 'xpath', '[attributes/publisher="' . $this->title . '"]');
$xpathProperty = $this->createXmlProperty($dom, 'xpath', '[attributes/publisher="' . $this->publisherOrInstitution . '"]');
$journalProperty->appendChild($xpathProperty);

return $titleSet;
Expand All @@ -102,7 +102,7 @@ private function createPreservedYearProperty($dom, $year, $volume, $volumeText)
{
$preservedYear = $this->createXmlProperty($dom, "OJS3PluginRBRB${volume}_${year}");

$publisherProperty = $this->createXmlProperty($dom, 'attributes.publisher', $this->title);
$publisherProperty = $this->createXmlProperty($dom, 'attributes.publisher', $this->publisherOrInstitution);
$preservedYear->appendChild($publisherProperty);

$journalTitleProperty = $this->createXmlProperty($dom, 'journalTitle', $this->journalAcronym);
Expand Down
2 changes: 1 addition & 1 deletion tests/PreservedJournalFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function setUp(): void
$this->preservedJournalFactory = new PreservedJournalFactory();
$this->createTestIssue($this->firstIssueYear, $this->firstIssueVolume);
$this->createTestIssue($this->lastIssueYear, $this->secondIssueVolume);
$versionDao = DAORegistry::getDAO('VersionDAO'); /* @var $versionDao VersionDAO */
$versionDao = DAORegistry::getDAO('VersionDAO');
$currentVersion = $versionDao->getCurrentVersion();
$this->ojsVersion = $currentVersion->getVersionString();
}
Expand Down
4 changes: 2 additions & 2 deletions version.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<application>carinianaPreservation</application>
<type>plugins.generic</type>
<lazy-load>0</lazy-load>
<release>1.4.1.4</release>
<date>2025-02-06</date>
<release>1.4.1.5</release>
<date>2025-02-10</date>
<class>CarinianaPreservationPlugin</class>
</version>

0 comments on commit cf3362e

Please sign in to comment.