OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Plugin import/export issues in XML, references problem

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

Plugin import/export issues in XML, references problem

Postby gusar » Fri Mar 21, 2014 2:18 am

When I use import\export plugin to export issues metadata included in XML-file.
But when I import issues all references entries doesn't import to the journal issues.
How to solve this problem?
For insertion references I have added this code into NativeImportExport.inc.php:
Code: Select all
if (($node = $articleNode->getChildByName('citations'))) $article->setCitations($node->getValue());

As a result this code inserts entries into articles table to citations row. Once all references added but not displayed.
Which code should I insert to add references correctly including citations table? Maybe some another table, that i don't know.
gusar
 
Posts: 13
Joined: Wed Jan 23, 2013 12:42 am
Location: Russian Federation

Re: Plugin import/export issues in XML, references problem

Postby asmecher » Fri Mar 21, 2014 8:46 am

Hi gusar,

I assume you've had to make changes to both NativeImportDOM.inc.php and NativeExportDOM.inc.php; also, to get the resulting XML to validate, an addition will be required to plugins/importexport/native/native.dtd. Could you provide these changes as a .diff? Our usual workflow with contributions is either to use Github pull requests, or patch files uploaded to bugzilla.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8673
Joined: Wed Aug 10, 2005 12:56 pm

Re: Plugin import/export issues in XML, references problem

Postby gusar » Fri Mar 21, 2014 9:12 am

asmecher wrote:Hi gusar,

I assume you've had to make changes to both NativeImportDOM.inc.php and NativeExportDOM.inc.php; also, to get the resulting XML to validate, an addition will be required to plugins/importexport/native/native.dtd. Could you provide these changes as a .diff? Our usual workflow with contributions is either to use Github pull requests, or patch files uploaded to bugzilla.

Regards,
Alec Smecher
Public Knowledge Project Team

I'm inexperienced developer and I feel shy to use pull requests. Unfortunatelly I've never used github.
Yes, I've changed native.dtd, I've added word citaions after word pages. Modifications were in NativeImportDOM.inc.php only. Another files I didn't change. But I know that this isn't correct import because citations table into the database didn't filled in. I attach changed files. Moreover which tables should I fill in to make correct import?
Attachments
native.rar
NativeImportDOM.inc.php+native.dtd
(11.09 KiB) Downloaded 7 times
gusar
 
Posts: 13
Joined: Wed Jan 23, 2013 12:42 am
Location: Russian Federation

Re: Plugin import/export issues in XML, references problem

Postby asmecher » Fri Mar 21, 2014 2:21 pm

Hi gusar,

Don't worry about being unfamiliar with github pull requests -- I'm happy to work with you on getting it right, and the social tools there are quite useful. However, if you'd rather not, it's OK to work with other methods too.

Before I can accept this as a feature add, though, you'll need to make a matching change to NativeExportDOM so that references are exported the same way that they're imported. This change adds support for importing them, but they'll never be exported.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8673
Joined: Wed Aug 10, 2005 12:56 pm

Re: Plugin import/export issues in XML, references problem

Postby gusar » Sat Mar 22, 2014 6:46 am

asmecher wrote:Hi gusar,

Don't worry about being unfamiliar with github pull requests -- I'm happy to work with you on getting it right, and the social tools there are quite useful. However, if you'd rather not, it's OK to work with other methods too.

Before I can accept this as a feature add, though, you'll need to make a matching change to NativeExportDOM so that references are exported the same way that they're imported. This change adds support for importing them, but they'll never be exported.

Regards,
Alec Smecher
Public Knowledge Project Team

Thx, for support. I decided to try github(it's my first time) and forked ojs repository. Missed code in NativeExportDom.inc.php is:
Code: Select all
XMLCustomWriter::createChildWithText($doc, $root, 'pages', $article->getPages(), false);
XMLCustomWriter::createChildWithText($doc, $root, 'citations', $article->getCitations(), false);
$fullTextUrl =& XMLCustomWriter::createChildWithText($doc, $root, 'fullTextUrl', Request::url(null, 'article', 'view', $article->getId()));
XMLCustomWriter::setAttribute($fullTextUrl, 'format', 'html');

My first changes are:
https://github.com/hussar/ojs/commit/1be1cbcc8ddffcea30a288e60c1c60e66dc632f8
https://github.com/hussar/ojs/commit/7c5858bafc74bb0e7b25032780cff9862ead3eeb

If you can see my additions I will continue to add all my changes including my own locales.
gusar
 
Posts: 13
Joined: Wed Jan 23, 2013 12:42 am
Location: Russian Federation


Return to OJS Technical Support

Who is online

Users browsing this forum: Google [Bot] and 1 guest