Now that Crossmark is free, is Crossmark support more likely to come to OJS?
I don’t know enough PHP to add settings for Crossmark to the relevant plugins to allow users to switch Crossmark on or off and provide their Crossmark policy DOI, but I have been able to implement it in OJS by customising the code a little. I’ve detailed my changes below in case anyone finds it helpful or wants to use it for their own journal.
In case it helps anyone who wants to use Crossmark, for my own journal, I added the following code to ArticleCrossrefXmlFilter.inc.php after where it exports license details, around line 178. I am not sure if this is the right spot for it, but it can be moved around if it doesn’t work:
// Crossmark
$crossmarkData = $doc->createElementNS($deployment->getNamespace(), 'crossmark_data');
$crossmarkPolicy = $doc->createElementNS($deployment->getNamespace(), 'crossmark_policy', htmlspecialchars('10.xxxx/crossmark_policy_doi', ENT_COMPAT, 'UTF-8'));
$crossmarkData->appendChild($crossmarkPolicy);
$crossmarkDomains = $doc->createElementNS($deployment->getNamespace(), 'crossmark_domains');
$crossmarkDomain = $doc->createElementNS($deployment->getNamespace(), 'crossmark_domain');
$crossmarkDomainWeb = $doc->createElementNS($deployment->getNamespace(), 'domain', htmlspecialchars('journaldomain.tld', ENT_COMPAT, 'UTF-8'));
$crossmarkDomain->appendChild($crossmarkDomainWeb);
$crossmarkDomains->appendChild($crossmarkDomain);
$crossmarkData->appendChild($crossmarkDomains);
$crossmarkDomainExclusive = $doc->createElementNS($deployment->getNamespace(), 'crossmark_domain_exclusive', htmlspecialchars('false', ENT_COMPAT, 'UTF-8'));
crossmarkData->appendChild($crossmarkDomainExclusive);
$journalArticleNode->appendChild($crossmarkData);
I also changed line 175 of ArticleCrossrefXmlFilter.inc.php to add the attribute applies_to="vor"
. This means that when people click on the Crossmark button, the license information will show as applying to the Version of Record
rather than unspecified
.
$licenseRefNode = $doc->createElementNS($deployment->getAINamespace(), 'ai:license_ref', htmlspecialchars($submission->getLicenseUrl(), ENT_COMPAT, 'UTF-8'));
$licenseRefNode->setAttribute('applies_to', 'vor');
This results in adding the following XML to the Crossref exports, which covers minimum for a Crossmark deposit.
<crossmark_data>
<crossmark_policy>10.xxxx/crossmark_policy_doi</crossmark_policy>
<crossmark_domains>
<crossmark_domain>
<domain>journaldomain.tld</domain>
</crossmark_domain>
</crossmark_domains>
<crossmark_domain_exclusive>false</crossmark_domain_exclusive>
</crossmark_data>
Then, for the crossmark widget, I found the relevant part of my theme and inserted the crossmark widget code. For Health Sciences, it is around line 253 of article_details.tpl. The other metadata plugins already inserted the DOI in the HTML header, so the button works.