Skip to content

Commit

Permalink
Merge branch 'dev-fix-url' into ojs-stable-3_1_2
Browse files Browse the repository at this point in the history
  • Loading branch information
ronste committed Jan 15, 2021
2 parents aa9c24f + 51042ea commit b3d5f5a
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 31 deletions.
22 changes: 12 additions & 10 deletions DNBExportPlugin.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
define('DNB_STATUS_DEPOSITED', 'deposited');
# determines whether to export remote galleys (experimental feature)
define('EXPORT_REMOTE_GALLEYS', false);
define('ALLOWED_REMOTE_IP_PATTERN','/160.45./');//@RS implement IP pattern as setting
define('ALLOWED_REMOTE_IP_PATTERN','/160.45./');//TODO @RS implement IP pattern as setting
define('ADDITIONAL_PACKAGE_OPTIONS','');//use --format=gnu with tar to avoid PAX-Headers

if (!DEBUG) {
Expand Down Expand Up @@ -66,15 +66,17 @@ function getDescription() {
* @copydoc ImportExportPlugin::display()
*/
function display($args, $request) {

if (($args[0] == 'exportSubmissions') & empty((array) $request->getUserVar('selectedSubmissions'))) {
//show error
$this->errorNotification($request, array(array('plugins.importexport.dnb.deposit.error.noObjectsSelected')));
// redirect back to exportSubmissions-tab
$path = array('plugin', $this->getName());
$request->redirect(null, null, null, $path, null, 'exportSubmissions-tab');
return;
}

if (!empty($args)) {
if (($args[0] == 'exportSubmissions') & empty((array) $request->getUserVar('selectedSubmissions'))) {
//show error
$this->errorNotification($request, array(array('plugins.importexport.dnb.deposit.error.noObjectsSelected')));
// redirect back to exportSubmissions-tab
$path = array('plugin', $this->getName());
$request->redirect(null, null, null, $path, null, 'exportSubmissions-tab');
return;
}
}

parent::display($args, $request);

Expand Down
6 changes: 2 additions & 4 deletions README
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
=============================================================
=== OJS DNB Export Plugin
=== Version: 1.3.1.1
=== Version: 1.3.2
=== Author: Bozana Bokan, Ronald Steffen
=== Last update: September 14, 2020
=== Last update: January 15, 2021
=============================================================

Attention: Please do not use automatic deposit until next official release.

About
-----
This plugin provides the export of article metadata and full texts (in PDF and EPUB format) for their transfer to the German National Library (DNB)
Expand Down
10 changes: 4 additions & 6 deletions README_DE
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
=============================================================
=== OJS DNB-Export-Plug-In
=== Version: 1.3.1.1
=== Version: 1.3.2
=== Autor: Bozana Bokan, Ronald Steffen
=== Letzte �nderung: 14. September 2020
=== Letzte Änderung: 15. Januar 2021
=============================================================

Achtung: Bitte benutzen Sie bis zur Ver�ffentlichung einer neuen Plugin-Version nicht die automatische Ablieferung an die DNB.

�ber
Über
-----
Dieses Plug-In ermöglicht den Export von Artikel-Metadaten und -Volltexten (im PDF- und EPUB-Format) zwecks ihrer Pflichtablieferung an die Deutsche Nationalbibliothek (DNB)
mittels DNB-Hotfolder-Verfahren. Das Plug-In bietet auch die Option, das Transferpaket direkt in den DNB-Hotfolder abzuliefern.
Expand All @@ -21,7 +19,7 @@ Das Plug-In ist unter GNU General Public License v2 lizenziert. Sehen Sie die Da
Systemanforderungen
-------------------
Dieses Plug-In ist kompatibel mit...
- OJS 3.1.1
- OJS 3.1.1, 3.1.2

TAR-Programm wird benötigt und es muss in der Datei config.inc.php konfiguriert werden.

Expand Down
9 changes: 5 additions & 4 deletions filter/DNBXmlFilter.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import('lib.pkp.plugins.importexport.native.filter.NativeExportFilter');
define('XML_NON_VALID_CHARCTERS', 100);
define('URN_SET', 101);
define('MESSAGE_URN_SET','An URN has been set.'); // @RS refine

class DNBXmlFilter extends NativeExportFilter {
/**
Expand Down Expand Up @@ -79,7 +80,7 @@ function &process(&$pubObject) {
}

// abort export in case any URN is set, this is a special case that has to be discussed with DNB and implmented differently in each case
$articleURN = $article->getStoredPubId('other::urnDNB');
$articleURN = $article->getStoredPubId('other::urnDNB');
if (empty($articleURN)) $articleURN = $article->getStoredPubId('other::urn');
if (!empty($articleURN)) {
throw new ErrorException(MESSAGE_URN_SET, URN_SET);
Expand Down Expand Up @@ -217,7 +218,7 @@ function &process(&$pubObject) {
$abstract = mb_substr($abstract, 0, 996,"UTF-8");
$abstract .= '...';
}
$abstractURL = $request->url(null, 'article', 'view', array($article->getId()));
$abstractURL = $request->url($journal->getPath(), 'article', 'view', array($article->getId()));
$datafield520 = $this->createDatafieldNode($doc, $recordNode, '520', '3', ' ');
$this->createSubfieldNode($doc, $datafield520, 'a', $abstract);
$this->createSubfieldNode($doc, $datafield520, 'u', $abstractURL);
Expand All @@ -230,7 +231,7 @@ function &process(&$pubObject) {
if (empty($copyrightNotice)) $copyrightNotice = $journal->getSetting('copyrightNotice', $journal->getPrimaryLocale());
if (!empty($copyrightNotice)) {
// link to the article view page where the copyright notice can be found
$licenseURL = $request->url(null, 'article', 'view', array($article->getId()));
$licenseURL = $request->url($journal->getPath(), 'article', 'view', array($article->getId()));
}
}
if (!empty($licenseURL)) {
Expand Down Expand Up @@ -279,7 +280,7 @@ function &process(&$pubObject) {
$journalDatafield773 = $this->createDatafieldNode($doc, $recordNode, '773', '1', '8');
$this->createSubfieldNode($doc, $journalDatafield773, 'x', $issn);
// file data
$galleyURL = $request->url(null, 'article', 'view', array($article->getId(), $galley->getId()));
$galleyURL = $request->url($journal->getPath(), 'article', 'view', array($article->getId(), $galley->getId()));
$datafield856 = $this->createDatafieldNode($doc, $recordNode, '856', '4', ' ');
$this->createSubfieldNode($doc, $datafield856, 'u', $galleyURL);
$this->createSubfieldNode($doc, $datafield856, 'q', $this->_getGalleyFileType($galley));
Expand Down
4 changes: 1 addition & 3 deletions scheduledTasks.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@
<!DOCTYPE scheduled_tasks SYSTEM "../../../lib/pkp/dtd/scheduledTasks.dtd">

<scheduled_tasks>
<!-- automatic deposit is currently not working correctly, please DO NOT enable
<task class="plugins.importexport.dnb.DNBInfoSender">
<descr>Deposit article packages to DNB Hotfolder.</descr>
<frequency minute="0"/>
<frequency minute="0"/>
</task>
-->
</scheduled_tasks>
8 changes: 4 additions & 4 deletions templates/settingsForm.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@
{fbvElement type="text" id="folderId" value=$folderId label="plugins.importexport.dnb.settings.form.folderId" maxlength="50" size=$fbvStyles.size.MEDIUM}
<span class="instruct">{translate key="plugins.importexport.dnb.settings.form.folderId.description"}</span><br/>
{/fbvFormSection}
{** {fbvFormSection list="true"}
* {fbvElement type="checkbox" id="automaticDeposit" label="plugins.importexport.dnb.settings.form.automaticDeposit.description" checked=$automaticDeposit|compare:true}
* {/fbvFormSection}
*}
{fbvFormSection list="true"}
{fbvElement type="checkbox" id="automaticDeposit" label="plugins.importexport.dnb.settings.form.automaticDeposit.description" checked=$automaticDeposit|compare:true}
{/fbvFormSection}
{/fbvFormArea}
{fbvFormButtons submitText="common.save"}
</form>

0 comments on commit b3d5f5a

Please sign in to comment.