示例#1
0
文件: index.php 项目: riskatlas/micka
$cswClient = new CSWClient();
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);