示例#1
0
文件: index.php 项目: riskatlas/micka
session_start();
// *************************** MAIN *****************************
//---uprava vstupu
$lang = $_REQUEST['lang'] ? $_REQUEST['lang'] : 'cze';
if ($_REQUEST["action"] != 'pasPrint') {
    $_REQUEST["creationDate"] = Kote::date2iso($_REQUEST["creationDate"]);
    $_REQUEST["publicationDate"] = Kote::date2iso($_REQUEST["publicationDate"]);
    $_REQUEST["revisionDate"] = Kote::date2iso($_REQUEST["revisionDate"]);
}
$input = Kote::processForm($_REQUEST);
$params = array('datestamp' => date('Y-m-d'), 'lang' => $lang, 'mickaURL' => MICKA_URL);
if ($_REQUEST["action-save"]) {
    // --- ulozeni do CSW
    $s = $cswClient->processTemplate($input, dirname(__FILE__) . '/resources/kote2iso.xsl', $params);
    $cswClient->prepareUpdate($s);
    $cswClient->setParams("debug=1");
    $s = $cswClient->runRequest(KOTE_SERVICE, "kote", dirname(__FILE__) . '/resources/transaction2kote.xsl', 'SID@' . $_COOKIE[CSW_TOKEN], '');
    echo $s;
} else {
    if ($_REQUEST["action-xml"]) {
        header("Content-type: application/xml");
        //echo $input; exit;
        reset($_REQUEST);
        //header("Pragma: no-cache");
        //header('Content-Disposition: attachment; filename="metadata_'.$_REQUEST['md']['fileIdentifier'].'.xml"');
        echo $cswClient->processTemplate($input, dirname(__FILE__) . '/resources/kote2iso.xsl', $params);
    } else {
        if ($_REQUEST["action-eu"]) {
            $xml = $cswClient->processTemplate($input, 'resources/kote2iso.xsl', $params);
            echo Kote::postFileForm(JRC_VALIDATOR, $xml);
        } else {
示例#2
0
文件: test.php 项目: riskatlas/micka
<?php

$xmlHead = "<?xml version='1.0' encoding='UTF-8'?" . ">";
require '../include/application/micka_config.php';
require PHPPRG_DIR . "/CswClient.php";
if ($_REQUEST['serviceURL']) {
    $csw = new CSWClient();
    $csw->reqData = $xmlHead . $_REQUEST['qstr'];
    $csw->setParams("debug={$_REQUEST['debuk']}|typeNames={$_REQUEST['typeNames']}|sortBy={$sort}|startPosition=1|maxRecords=25");
    $csw->method = $_REQUEST['method'];
    if ($_REQUEST['template'] == 1) {
        $tmpl = CSW_XSL . "/iso2rss.xsl";
    }
    if ($_REQUEST['template'] == 2) {
        $tmpl = CSW_XSL . "/iso2json.xsl";
    }
    $s = $csw->runRequest($_REQUEST['serviceURL'], "pokus", $tmpl, $_REQUEST["user"], $_REQUEST["pwd"], array('startPosition' => 1));
    if ($_REQUEST['debuk']) {
        $s = htmlspecialchars_decode($s);
    } else {
        if (!$_REQUEST['template']) {
            header("Content-type: application/xml");
        } else {
            if ($_REQUEST['template'] == 1) {
                header("Content-type: application/xhtml+xml; charset=utf-8");
            } else {
                if ($_REQUEST['template'] == 2) {
                    header("Content-type: application/json; charset=utf-8");
                }
            }
        }