OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Default CrossRef XML file target path on server

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
The Public Knowledge Project Support Forum is moving to http://forum.pkp.sfu.ca

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.

Default CrossRef XML file target path on server

Postby klbr » Wed Jun 20, 2012 5:35 am

Hi Alec

is it possible to fix a default CrossRef export XML file target path on server without file dialog ?
we use for cronjobing the submission to crossref.

thx Klaus
klbr
 
Posts: 9
Joined: Tue Apr 27, 2010 12:06 am

Re: Default CrossRef XML file target path on server

Postby asmecher » Thu Jun 21, 2012 10:01 am

Hi Klaus,

Try using the import/export tool from the command line. Run:
Code: Select all
php tools/importexport.php
Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm

Re: Default CrossRef XML file target path on server

Postby klbr » Wed Aug 08, 2012 1:44 am

Hi Alec

here our changes in CrossRefExportPlugin.inc.php.

1.
// dump out the results
//if (!empty($outputFile)) {
// if (($h = fopen($outputFile, 'w'))===false) return false;
// fwrite($h, XMLCustomWriter::getXML($doc));
// fclose($h);
//} else {
// header("Content-Type: application/xml");
// header("Cache-Control: private");
// header("Content-Disposition: attachment; filename=\"article.xml\"");
// XMLCustomWriter::printXML($doc);
//}
//return true;


// 20120808
// Bypass file selector dialog for export

$crpath = "D:/httpdocs/ojs/files/export/crossref/";
$crfile = "SMI-" . $article->getId() . ".xml";

if (($h = fopen($crpath . $crfile, 'w'))===false) return false;
fwrite($h, XMLCustomWriter::getXML($doc));
fclose($h);


exec("java -jar ".$crpath."doUpload.jar -h test.crossref.org -u myuser -p mypassword -f ".$crpath.$crfile, $output);

$message = "Crossref File Transfer erfolgreich: ".$crpath.$crfile . "\\n".$output[11];
echo "<script type=\"text/javascript\">\n";
echo " alert(\"$message\");\n";
echo "</script>\n\n";


return true;

2.
case 'exportArticle':
$articleIds = array(array_shift($args));
$result = ArticleSearch::formatResults($articleIds);
$this->exportArticles($journal, $result);

//20120808
// Display Index.tpl after Crossref Export
$this->setBreadcrumbs();
$templateMgr->assign_by_ref('journal', $journal);
$templateMgr->display($this->getTemplatePath() . 'index.tpl');

regards
Klaus
klbr
 
Posts: 9
Joined: Tue Apr 27, 2010 12:06 am


Return to OJS Technical Support

Who is online

Users browsing this forum: Yahoo [Bot] and 4 guests