예제 #1
0
파일: index.php 프로젝트: Ethennoob/Web
 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");
 }
 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!");
     }
 }
예제 #3
0
    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":
        $packet = getRecord_OAI($self, $ws_client_url, $xslPath, $identifier, $metadataPrefix);
예제 #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;
 }
예제 #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>';
예제 #6
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();
예제 #7
0
파일: common.php 프로젝트: Ethennoob/Web
{
    $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);
//Trecho de gambiarra
$xmlh = str_replace("<surname>", "", $xmlh);