function XSLTransformer()
 {
     $defFile = new DefFile("scielo.def");
     $this->processor = xslt_create();
     $this->host = $_SERVER["SERVER_ADDR"];
     $this->port = $defFile->getKeyValue("SOCK_PORT");
     $this->socket = new XSLTransformerSocket($this->host, $this->port);
     if (!$this->socket) {
         die("socket creation error!");
     }
 }
Example #2
0
 private function getVariableFromDef()
 {
     $transformer = new XSLTransformer();
     $defFile = new DefFile("../scielo.def.php");
     $this->applServer = $defFile->getKeyValue("SERVER_SCIELO");
     $this->regionalScielo = $defFile->getKeyValue("SCIELO_REGIONAL_DOMAIN");
     $this->collection = $defFile->getKeyValue("SHORT_NAME");
     $this->country = $defFile->getKeyValue("COUNTRY");
     $this->databasePath = $defFile->getKeyValue("PATH_DATABASE");
 }
Example #3
0
    //	    $oai_packet = str_replace ( "localhost", "200.6.42.159", $oai_packet);
    return $oai_packet;
}
/******************************************* Principal *******************************************/
if (isset($_SERVER) && !isset($DOCUMENT_ROOT)) {
    $DOCUMENT_ROOT = $_SERVER["DOCUMENT_ROOT"];
}
$DOCUMENT_ROOT = trim($DOCUMENT_ROOT);
$dirChar = strpos($DOCUMENT_ROOT, "\\") === false ? "/" : "\\";
if (substr($DOCUMENT_ROOT, -1) == $dirChar) {
    $def = $DOCUMENT_ROOT . DEFNAME;
} else {
    $def = $DOCUMENT_ROOT . $dirChar . DEFNAME;
}
debugstring("\$def={$def}\n");
$deffile = new DefFile($def);
$ws_client_url = "http://" . $deffile->getKeyValue("SERVER_SCIELO") . $deffile->getKeyValue("PATH_DATA") . "ws/scielo-ws.php";
debugstring("\$ws_client_url={$ws_client_url}\n");
$self = "http://" . $deffile->getKeyValue("SERVER_SCIELO") . $deffile->getKeyValue("PATH_DATA") . "oai/scielo-oai.php";
$xslPath = "http://" . $deffile->getKeyValue("SERVER_SCIELO") . $deffile->getKeyValue("PATH_DATA") . "oai/";
debugstring("\$xslPath={$xslPath}\n");
$repositoryName = trim($deffile->getKeyValue("SITE_NAME"));
$adminEmails = array(trim($deffile->getKeyValue("E_MAIL")));
switch ($verb) {
    case "Identify":
        $packet = Identify_OAI($self, $ws_client_url, $xslPath);
        break;
    case "ListMetadataFormats":
        $packet = ListMetadataFormats_OAI($self, $ws_client_url, $xslPath, "");
        break;
    case "GetRecord":
Example #4
0
 function _CheckMaintenance()
 {
     $dbpath = $this->_def->getKeyValue("PATH_DATABASE");
     $ctrlpath = $dbpath . "control.def";
     $control = new DefFile($ctrlpath);
     if (!$control->_error) {
         if ($control->getKeyValue("MAINTENANCE")) {
             return true;
         }
     }
     return false;
 }
Example #5
0
<?
	$lang = isset($_REQUEST['lang'])?($_REQUEST['lang']):"";
	$pid = isset($_REQUEST['pid'])?($_REQUEST['pid']):"";
	$text = isset($_REQUEST['text'])?($_REQUEST['text']):"";

	require_once(dirname(__FILE__)."/../../classDefFile.php");
	if(!class_exists("XSLTransformer"))
	{
		require_once(dirname(__FILE__)."/../../class.XSLTransformer.php");
	}
	$transformer = new XSLTransformer();
	$defFile = new DefFile(dirname(__FILE__)."/../../scielo.def");

	$related_Service = $defFile->getKeyValue($serviceName);
	$related_Service = str_replace("PARAM_PID",$pid,$related_Service);
	$related_Service = str_replace("PARAM_TEXT",$text,$related_Service);

	$xmlh = "";
	$xmlh = file_get_contents(str_replace(' ','%20',utf8_decode(urldecode($related_Service))));
	$xmlh = str_replace("&lt;","<",$xmlh);
	$xmlh = str_replace("&gt;",">",$xmlh);
	$xmlh = str_replace("&amp;","&",$xmlh);
	$xmlh = str_replace("&quot;","\"",$xmlh);
	for($chr = 0; $chr < 32 ;$chr++)
	{
		$xmlh = str_replace(chr($chr),"",$xmlh);
	}

	$xmlh = str_replace(chr(146),"",$xmlh);
	$xml = '<?xml version="1.0" encoding="ISO-8859-1" ?>'."\n";
	$xml .= '<root>';
Example #6
0
 function LogDefFile($name)
 {
     // Constructor
     DefFile::DefFile($name);
 }
Example #7
0
<?php

require_once "../classDefFile.php";
//require_once("../bvs-lib/common/scripts/php/xslt.php");
require_once 'nusoap/nusoap.php';
require_once "../class.XSLTransformer.php";
require_once 'common.php';
// Backward compatible array creation
$_REQUEST = isset($_REQUEST) ? $_REQUEST : array_merge($HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_COOKIE_VARS);
$transformer = new XSLTransformer();
$defFile = new DefFile("../scielo.def");
$version = "1.0";
$serviceRoot = "SciELOWebService";
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$applServer = $defFile->getKeyValue("SERVER_SCIELO");
$regionalScielo = $defFile->getKeyValue("SCIELO_REGIONAL_DOMAIN");
$collection = $defFile->getKeyValue("SHORT_NAME");
$country = $defFile->getKeyValue("COUNTRY");
$databasePath = $defFile->getKeyValue("PATH_DATABASE");
//$output = 'xml';
$output = $_REQUEST["output"];
if ($output == "") {
    if ($_REQUEST['service'] != "" && $HTTP_RAW_POST_DATA == "") {
        $output = "xml";
    } else {
        $output = "soap";
    }
}
if ($output == "soap") {
    // Create the server instance
    $server = new soap_server();
Example #8
0
}
function removeAccent($s)
{
    $a = array("á", "à", "ã", "â", "ä", "é", "è", "ê", "ë", "ó", "ò", "õ", "ô", "ö", "í", "ì", "î", "ï", "ú", "ù", "û", "ü", "ñ", "ç");
    $b = array("a", "a", "a", "a", "a", "e", "e", "e", "e", "o", "o", "o", "o", "o", "i", "i", "i", "i", "u", "u", "u", "u", "n", "c");
    return str_replace($a, $b, $s);
}
$lang = isset($_REQUEST['lang']) ? $_REQUEST['lang'] : "";
$pid = isset($_REQUEST['pid']) ? $_REQUEST['pid'] : "";
$text = isset($_REQUEST['text']) ? $_REQUEST['text'] : "";
require_once dirname(__FILE__) . "/../../classDefFile.php";
if (!class_exists("XSLTransformer")) {
    require_once dirname(__FILE__) . "/../../class.XSLTransformer.php";
}
$transformer = new XSLTransformer();
$defFile = new DefFile(dirname(__FILE__) . "/../../scielo.def.php");
//Adicionado para flag de log comentado por Jamil Atta Junior (jamil.atta@bireme.org)
$flagLog = $defFile->getKeyValue('ENABLE_SERVICES_LOG');
$related_Service = $defFile->getKeyValue($serviceName);
$related_Service = str_replace("PARAM_PID", $pid, $related_Service);
$related_Service = str_replace("PARAM_TEXT", $text, $related_Service);
$xmlh = "";
$xmlh = file_get_contents(str_replace(' ', '%20', utf8_decode(urldecode($related_Service))));
$xmlh = str_replace("&lt;", "<", $xmlh);
$xmlh = str_replace("&gt;", ">", $xmlh);
//$xmlh = str_replace("&amp;","&",$xmlh);
$xmlh = str_replace("&quot;", "\"", $xmlh);
for ($chr = 0; $chr < 32; $chr++) {
    $xmlh = str_replace(chr($chr), "", $xmlh);
}
$xmlh = str_replace(chr(146), "", $xmlh);