protected function perform_GET_RDF($type = 'application/rdf+xml') { $uri = $this->request->pageUri; if (strlen($uri) > 1 && substr($uri, -1) == '/') { $uri = substr($uri, 0, -1); } if (!isset($this->object)) { $doc = new RDFDocument($uri . 'rdf', $uri); } else { if ($this->isDataSet) { $doc = new RDFDocument($uri . '.rdf', $this->request->base . $this->object->__get('relativeURI')); } else { $doc = new RDFDocument($uri . '.rdf', $this->request->base . $this->object->__get('instanceRelativeURI')); } } if (isset($this->object)) { $this->object->rdf($doc, $this->request); } else { $this->populateRDF($doc); } $this->request->header('Content-type', 'application/rdf+xml'); $this->request->flush(); $xml = $doc->asXML(); if (is_array($xml)) { writeLn(implode("\n", $xml)); } else { writeLn($xml); } }
protected function perform_GET_RDF_XXX() { $this->request->header('Content-type', 'application/rdf+xml'); $this->request->flush(); $uri = $this->request->pageUri; if (strlen($uri) > 1 && substr($uri, -1) == '/') { $uri = substr($uri, 0, -1); } writeLn('<?xml version="1.0" encoding="utf-8" ?>'); writeLn('<rdf:RDF ' . 'xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" ' . 'xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" ' . 'xmlns:owl="http://www.w3.org/2002/07/owl#" ' . 'xmlns:foaf="http://xmlns.com/foaf/0.1/" ' . 'xmlns:po="http://purl.org/ontology/po/" ' . 'xmlns:mo="http://purl.org/ontology/mo/" ' . 'xmlns:skos="http://www.w3.org/2008/05/skos#" ' . 'xmlns:time="http://www.w3.org/2006/time#" ' . 'xmlns:dc="http://purl.org/dc/elements/1.1/" ' . 'xmlns:dcterms="http://purl.org/dc/terms/" ' . 'xmlns:wgs84_pos="http://www.w3.org/2003/01/geo/wgs84_pos#" ' . 'xmlns:timeline="http://purl.org/NET/c4dm/timeline.owl#" ' . 'xmlns:event="http://purl.org/NET/c4dm/event.owl#" ' . 'xmlns:ma="http://www.w3.org/ns/ma-ont">'); writeLn(); writeLn('<rdf:Description rdf:about="' . _e($uri) . '.rdf">'); writeLn('<rdfs:label>Description of the version ' . _e($this->title) . ' of the episode ' . _e($this->episode->title) . '</rdfs:label>'); writeLn('<dcterms:created rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">' . strftime('%Y-%m-%dT%H:%M:%SZ', parse_datetime($this->object->created)) . '</dcterms:created>'); writeLn('<dcterms:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">' . strftime('%Y-%m-%dT%H:%M:%SZ', parse_datetime($this->object->modified)) . '</dcterms:modified>'); writeLn('<foaf:primaryTopic rdf:resource="' . _e($uri . '#version') . '" />'); writeLn('</rdf:Description>'); writeLn(); writeLn('<po:Version rdf:resource="' . _e($uri . '#version') . '">'); writeLn('<po:pid>' . _e($this->object->uuid) . '</po:pid>'); writeLn('<rdfs:label>A version of ' . _e($this->episode->title) . '</rdfs:label>'); writeLn('</po:Version>'); writeLn(); writeLn('<po:Episode rdf:about="' . _e($this->request->root . $this->episode->relativeURI . '#episode') . '">'); writeLn('<rdfs:label>' . _e($this->episode->title) . '</rdfs:label>'); writeLn('<po:version rdf:resource="' . _e($uri . '#version') . '" />'); writeLn('</po:Episode>'); writeLn(); writeLn('<po:Availability>'); foreach ($this->object->resources as $loc) { if (empty($loc->available)) { continue; } if (!empty($loc->offline)) { continue; } writeLn('<po:media_item>'); writeLn('<po:MediaItem rdf:about="' . _e($uri . '#' . $loc->uuid) . '">'); writeLn('<po:pid>' . _e($loc->uuid) . '</po:pid>'); writeLn('<ma:locator rdf:resource="' . _e($loc->uri) . '" />'); writeLn('</po:MediaItem>'); writeLn('</po:media_item>'); } writeLn('</po:Availability>'); writeLn(); writeLn('</rdf:RDF>'); }
protected function perform_GET_RDF() { $uri = $this->request->pageUri; if (strlen($uri) > 1 && substr($uri, -1) == '/') { $uri = substr($uri, 0, -1); } header('Content-Location: ' . $uri . '.rdf'); $doc = new RDFDocument($uri . '.rdf', $this->request->root . $this->object->__get('instanceRelativeURI')); $this->object->rdf($doc, $this->request); $this->request->header('Content-type', 'application/rdf+xml'); $this->request->flush(); $xml = $doc->asXML(); if (is_array($xml)) { writeLn(implode("\n", $xml)); } else { writeLn($xml); } }
require_once 'baseconfig.inc.php'; require_once 'installdata.inc.php'; writeLn(str_repeat('=', 80) . "\r\n" . BO_NAME . " package builder.\r\n" . str_repeat('=', 80) . "\r\n"); if ($_SERVER['argc'] > 3 && strcmp($_SERVER['argv'][1], '-b') === 0) { $configDir = $dir['configs'] . '\\' . basename($_SERVER['argv'][2]); loadPackageConfig($configDir); } else { $helpMessage = "\t-b [config file] [signature] - build package.\r\n"; writeLn("Commands:\r\n" . $helpMessage); die(1); } /////////////////////////////////////////////////////////////////////////////////////////////////// // Вывод заголовка сборки. /////////////////////////////////////////////////////////////////////////////////////////////////// define('BO_SIGNATURE', $_SERVER['argv'][3]); writeLn("-> Configuration: " . basename($configDir) . "\n" . "-> Debug: " . $config['debug'] . "\n" . "-> Version: " . BO_CLIENT_VERSION . "\n" . "-> Signature: " . BO_SIGNATURE); if (getenv('BO_SLIENT') === FALSE) { waitAnyKey(); } /////////////////////////////////////////////////////////////////////////////////////////////////// // Начало сборки. /////////////////////////////////////////////////////////////////////////////////////////////////// require_once $dir['source']['common'] . '\\defines.php'; writeStep('CLEARING'); clearTemp(1); writeStep('PREPARING'); writeFile($dir['output'][0] . '\\config', basename($configDir)); writeFile($dir['source']['common'] . '\\config.h', generateDefaultConfigHeader("#define BO_SIGNATURE \"" . BO_SIGNATURE . "\"\r\n" . "#define BO_SIGNATURE_HASH \"" . sprintf("0x%08X", crc32(BO_SIGNATURE)) . "\"\r\n" . "\r\n//List of common defines from defines.php\r\n" . generateXDefines($_COMMON_DEFINE, 'c'))); if (configBool('buildtools_platforms')) { writeStep("BUILDING BUILDTOOLS"); buildBinary('buildtools', 1, true, false);
protected function writeRDFResource($tag, $uri, $fragment) { if (UUID::isUUID($uri)) { /* Fetch target */ } else { if (substr($uri, 0, 1) == '/') { writeLn('<' . $tag . ' rdf:resource="' . _e($uri . '#' . $fragment) . '" />'); } else { writeLn('<' . $tag . ' rdf:resource="' . _e($uri) . '" />'); } } }
function writeStep($name) { global $___curstep; $___curstep++; writeLn("\nSTEP #" . $___curstep . ": " . $name); }
$sldata = array(); writeLn('<h2>' . _e($storylineTitle) . '</h2>'); writeLn('<div id="storyline-data">'); writeLn('</div>'); writeLn('<ul class="storyline">'); foreach ($storyLine as $obj) { $date = 'Date Unknown'; if (isset($obj->date)) { $date = $obj->date; } $synopsis = ''; if (isset($obj->shortDescription)) { $synopsis = $obj->shortDescription; } if (isset($obj->thumbnail)) { $style = ' style="background-image: url(\'' . _e($obj->thumbnail) . '\');"'; } else { $style = ''; } $slinfo = array('title' => $obj->title, 'date' => $date, 'synopsis' => $synopsis, 'description' => isset($obj->mediumDescription) ? $obj->mediumDescription : (isset($obj->shortDescription) ? $obj->shortDescription : ''), 'characters' => array()); if (isset($obj['agents'])) { foreach ($obj['agents'] as $agent) { $slinfo['characters'][$agent->uuid] = array('name' => $agent->title, 'link' => $request->root . $agent->relativeURI, 'thumb' => isset($agent->thumb) ? $agent->thumb : ''); } } $sldata[$obj->uuid] = $slinfo; writeLn('<li data-uuid="' . _e($obj->uuid) . '">' . '<span class="inner">' . '<a ' . $style . 'href="' . _e($request->root . $obj->relativeURI) . '" title="' . _e($date . ': ' . $obj->title) . '"> </a>' . '</span>' . '</li>'); } writeLn('</ul>'); writeLn('<script>window.storylineData = ' . json_encode($sldata) . '</script>');
protected function writeTVATerm($node, $depth = "\t") { if (!isset($node->sameAs)) { return; } $termId = null; foreach ($node->sameAs as $uri) { if (!strncmp($uri, $this->tvaNamespace, strlen($this->tvaNamespace))) { $termId = substr($uri, strlen($this->tvaNamespace)); break; } } if ($termId === null) { return; } writeLn($depth . '<Term termID="' . _e($termId) . '">'); $ndepth = "\t" . $depth; writeLn($ndepth . '<Name>' . _e($node->title) . '</Name>'); writeLn($ndepth . '<Definition>' . _e($node->title) . '</Definition>'); foreach ($node->sameAs as $same) { if (!strcmp($same, $uri)) { continue; } writeLn($ndepth . '<owl:sameAs rdf:resource="' . _e($same) . '" />'); } $children = $this->model->query(array('kind' => $this->kind, 'parent' => $node->uuid)); while ($child = $children->next()) { $this->writeTVATerm($child, $ndepth); } writeLn($depth . '</Term>'); }