Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionNext revisionBoth sides next revision | ||
buechereielektrik:unapi:picarecord.php [2009-12-10 19:41] – created strols | buechereielektrik:unapi:picarecord.php [2009-12-20 14:51] – Some minor bugfixes. strols | ||
---|---|---|---|
Line 1: | Line 1: | ||
< | < | ||
- | <? | + | <?php |
- | + | ||
- | // hatop@ub.uni-marburg.de 2008-12-08 2009-12-03 | + | |
- | // http:// | + | |
/* Copyright 2008 2009 Goetz Hatop | /* Copyright 2008 2009 Goetz Hatop | ||
Line 29: | Line 26: | ||
/* Changelog | /* Changelog | ||
- | | + | * |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | Put header() in the case-loops in final switch(). | + | |
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | * Added functions | ||
+ | * "Picappn". | ||
+ | * Added functions " | ||
+ | | ||
| | ||
*/ | */ | ||
- | require(' | + | $opac_url = " |
+ | //$opac_url = " | ||
+ | //$opac_url = " | ||
+ | //$opac_url = " | ||
- | $noparam | + | $bibsonomy_url |
- | < | + | |
- | <format name=\" | + | |
- | <format name=\" | + | |
- | <format name=\" | + | |
- | <format name=\" | + | |
- | </ | + | |
- | "; | + | |
- | $idparam | + | $filter_nice |
- | <formats id=\" | + | ' |
- | <format name=\" | + | ' |
- | </ | + | ); |
- | "; | + | |
- | if (!isset($_GET[id]) || $_GET[id]=='' | + | /** represents a bibliographic data record from oclc/pica LBS |
- | | + | */ |
- | | + | class PicaRecord |
- | | + | |
- | } | + | var $contributor, |
+ | | ||
+ | | ||
+ | // 1 for me | ||
+ | var $signatur; | ||
- | $pica = new Picappn(); | + | function PicaRecord() { |
- | //$pica->setOpac("http:// | + | |
- | //$pica->setOpac("http:// | + | $this->type = "Text"; |
- | //$pica->setOpac(" | + | |
- | $pica-> | + | |
+ | } | ||
- | if ($_GET[format] | + | /** private -- make pica data behave well */ |
- | | + | function decodePica($str) { |
- | | + | $tag = ""; |
- | | + | $res = "" |
- | die(0); | + | for ($i=0; |
- | } | + | $ch = substr($str, |
+ | switch (ord($ch)) { | ||
+ | case 31: // | ||
+ | $ch = substr($str, | ||
+ | if ($tag!="" | ||
+ | $res .= "</" | ||
+ | $tag = $this->getTagName($ch); | ||
+ | $res .= "<" | ||
+ | } else { | ||
+ | $tag = $this-> | ||
+ | $res .= "<" | ||
+ | } | ||
+ | | ||
- | switch ($_GET[format]) { | + | case 30: // |
- | case 'dc': | + | $res .= "</" |
- | header(' | + | $tag = ""; |
- | echo $pica->getDublinCore(); | + | |
- | break; | + | |
- | case 'extpp': | + | case 226: //pica two byte char accent like " |
- | header('Content-type: application/xml'); | + | $ch = substr($str, |
- | echo $pica->getPicaPlus(); | + | $res .= $this-> |
- | | + | |
- | case 'plain': | + | |
- | echo $pica->getPlain(); | + | default: |
- | | + | $res .= $this-> |
- | case 'rdf': | + | |
- | header('Content-type: application/xml'); | + | } //switch |
- | echo $pica->getDublinCoreRDF(); | + | |
- | | + | } |
- | case 'text': | + | $res .= "</" |
- | header('Content-type: text/plain'); | + | return $res; |
- | echo $pica->getText(); | + | } |
- | | + | |
- | case 'xml': | + | /** private -- make pica data behave well and put them to an array*/ |
- | header('Content-type: application/xml'); | + | function decodePica_array($str) { |
- | echo $pica->getXmlData(); | + | $tag = ""; |
- | break; | + | $res = ""; |
- | | + | for ($i=0; |
- | header('Content-type: | + | $ch = substr($str, |
- | echo "$idparam"; | + | switch (ord($ch)) { |
- | | + | case 31: // |
+ | $ch = substr($str, | ||
+ | $tag = $this-> | ||
+ | $res[$tag] = ""; | ||
+ | | ||
+ | case 30: // | ||
+ | | ||
+ | case 226: //pica two byte char accent like " | ||
+ | $ch = substr($str, | ||
+ | | ||
+ | | ||
+ | default: | ||
+ | | ||
+ | | ||
+ | } //switch | ||
+ | } | ||
+ | return $res; | ||
+ | } | ||
+ | |||
+ | /** public -- transform raw pica data to array */ | ||
+ | function getArray($str) { | ||
+ | // pica record separator is ascii record separator | ||
+ | | ||
+ | $res = ""; | ||
+ | | ||
+ | $in1 = ltrim($line); | ||
+ | $ch1 = substr($in1, | ||
+ | // | ||
+ | if (ord($ch1) >47 && ord($ch1)< | ||
+ | $pos = strpos($in1, | ||
+ | $key = substr($in1, | ||
+ | $val = substr($in1, | ||
+ | $val = $this-> | ||
+ | $pica_array[$key] = $val; | ||
+ | } else { | ||
+ | //not valid | ||
+ | } | ||
+ | } | ||
+ | $res = $pica_array; | ||
+ | | ||
+ | | ||
+ | |||
+ | /** private -- recode pica charset */ | ||
+ | function getCode($ch) { | ||
+ | $xx = ord($ch); | ||
+ | | ||
+ | // | ||
+ | // | ||
+ | case 10: return " | ||
+ | // case 60: return " | ||
+ | case 60: return "& | ||
+ | // case 62: return " | ||
+ | case 62: return "& | ||
+ | case 64: return ""; | ||
+ | case 209: return " | ||
+ | case 210: return " | ||
+ | case 211: return " | ||
+ | case 216: return " | ||
+ | case 193: return " | ||
+ | case 194: return " | ||
+ | case 195: return " | ||
+ | | ||
+ | if ($xx<30 || $xx>128) { | ||
+ | | ||
+ | } | ||
+ | return $ch; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | /** private -- not complete set of double byte pica characters started with | ||
+ | an accent sign */ | ||
+ | function getCode2($ch) { | ||
+ | | ||
+ | case 'e' : return " | ||
+ | case ' | ||
+ | case ' | ||
+ | case ' | ||
+ | case ' | ||
+ | case ' | ||
+ | case ' | ||
+ | case ' | ||
+ | | ||
+ | | ||
+ | } | ||
+ | } | ||
+ | |||
+ | /** public -- return simple dublin core record from pica data */ | ||
+ | //used by unapi | ||
+ | function getDublinCore($str) { | ||
+ | $res = $this-> | ||
+ | |||
+ | if (empty($res)) return ""; | ||
+ | |||
+ | $res = "<? | ||
+ | $res .="< | ||
+ | $res .= "< | ||
+ | $res .= "< | ||
+ | $res .= "< | ||
+ | $res .= "< | ||
+ | $res .= "< | ||
+ | $res .= "< | ||
+ | $res .= "< | ||
+ | $res .= "< | ||
+ | $res .= "< | ||
+ | $res .= "< | ||
+ | $res .= "< | ||
+ | $res .= "< | ||
+ | $res .= "< | ||
+ | $res .= "< | ||
+ | $res .= "<type>" | ||
+ | $res .="</ | ||
+ | return $res; | ||
+ | } | ||
+ | |||
+ | /** public -- transform raw pica plus to a more readable diagnostic format */ | ||
+ | //used by unapi | ||
+ | function getPicaPlus($str) { | ||
+ | $res = $this-> | ||
+ | $res = $this-> | ||
+ | return $res; | ||
+ | } | ||
+ | |||
+ | /** private -- rename numeric tags not allowed in xml */ | ||
+ | function getTagName($ch) { | ||
+ | if (ord($ch) >47 && ord($ch)< | ||
+ | return " | ||
+ | } else { | ||
+ | return | ||
+ | } | ||
+ | } | ||
+ | |||
+ | /** public -- transform raw pica data to valid xml */ | ||
+ | //used by unapi | ||
+ | function getXmlData($str) { | ||
+ | // pica record separator is ascii record separator | ||
+ | | ||
+ | $res = ""; | ||
+ | | ||
+ | $in1 = ltrim($line); | ||
+ | $ch1 = substr($in1, | ||
+ | // | ||
+ | if (ord($ch1) | ||
+ | $pos = strpos($in1, | ||
+ | $key = substr($in1, | ||
+ | $val = substr($in1, | ||
+ | $val = $this-> | ||
+ | //$res .= " | ||
+ | $res .= "< | ||
+ | //side effect to scan dublin core elements | ||
+ | $this-> | ||
+ | } else { | ||
+ | //not valid | ||
+ | } | ||
+ | } | ||
+ | | ||
+ | | ||
+ | |||
+ | /** private -- read dublin core elements */ | ||
+ | function readData($key, | ||
+ | // | ||
+ | | ||
+ | case '028C': | ||
+ | | ||
+ | break; | ||
+ | | ||
+ | // The spatial or temporal topic of the resource | ||
+ | // $this-> | ||
+ | break; | ||
+ | case ' | ||
+ | //The spatial or temporal topic of the resource | ||
+ | $this-> | ||
+ | break; | ||
+ | | ||
+ | $this-> | ||
+ | | ||
+ | case ' | ||
+ | // $this->creator .= " " | ||
+ | break; | ||
+ | | ||
+ | $this->date = $this-> | ||
+ | break; | ||
+ | | ||
+ | | ||
+ | break; | ||
+ | | ||
+ | //related : A related resource. | ||
+ | $this-> | ||
+ | break; | ||
+ | case ' | ||
+ | //related : A related resource. | ||
+ | $this-> | ||
+ | break; | ||
+ | | ||
+ | $this-> | ||
+ | | ||
+ | case ' | ||
+ | | ||
+ | break; | ||
+ | | ||
+ | | ||
+ | break; | ||
+ | | ||
+ | $this-> | ||
+ | break; | ||
+ | case ' | ||
+ | $this-> | ||
+ | break; | ||
+ | | ||
+ | $pub1 = $this-> | ||
+ | $pub2 = $this->readTag($val, " | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | break; | ||
+ | | ||
+ | $this->rights = $this-> | ||
+ | break; | ||
+ | case ' | ||
+ | //source : A related resource from which the described is derived. | ||
+ | $this-> | ||
+ | // | ||
+ | break; | ||
+ | | ||
+ | $this-> | ||
+ | break; | ||
+ | case ' | ||
+ | $this-> | ||
+ | break; | ||
+ | case ' | ||
+ | if ($this-> | ||
+ | $this-> | ||
+ | break; | ||
+ | case ' | ||
+ | if ($this-> | ||
+ | $this-> | ||
+ | break; | ||
+ | case ' | ||
+ | if ($this-> | ||
+ | $this-> | ||
+ | break; | ||
+ | case ' | ||
+ | if ($this-> | ||
+ | $this-> | ||
+ | break; | ||
+ | case ' | ||
+ | if ($this-> | ||
+ | $this-> | ||
+ | break; | ||
+ | case ' | ||
+ | $this-> | ||
+ | $subtitle = $this-> | ||
+ | if ($subtitle!="" | ||
+ | break; | ||
+ | case ' | ||
+ | //type The nature or genre of the resource. | ||
+ | $this-> | ||
+ | break; | ||
+ | | ||
+ | break; | ||
+ | } | ||
+ | // | ||
+ | } | ||
+ | |||
+ | /** public -- parse dublin core data */ | ||
+ | //client functionality | ||
+ | // comment out if using PHP4 | ||
+ | function readDublinCore($str) { | ||
+ | $doc = new DomDocument(); | ||
+ | | ||
+ | $xp = new DomXPath($doc); | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | /** public -- parse dublin core data */ | ||
+ | // experimental, | ||
+ | /* | ||
+ | function readRDF_DC($str) { | ||
+ | $doc = new DomDocument(); | ||
+ | $doc -> loadXML($str); | ||
+ | $xp = new DomXPath($doc); | ||
+ | | ||
+ | $this-> | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | */ | ||
+ | |||
+ | /** private -- read tag content from string */ | ||
+ | function readTag($val, | ||
+ | $x = strpos($val,"<" | ||
+ | $y = strpos($val,"</" | ||
+ | if ($x===FALSE) return ""; | ||
+ | | ||
+ | } | ||
+ | |||
+ | /** public -- read XML data */ | ||
+ | // client functionality | ||
+ | function readXmlData($str) { | ||
+ | | ||
+ | // | ||
+ | | ||
+ | $line = trim($line); | ||
+ | if ($line=="" | ||
+ | $x = strpos($line, | ||
+ | if ($x!==0) continue; | ||
+ | $y = strpos($line, | ||
+ | $key = substr($line, | ||
+ | $z = strpos($line, | ||
+ | if ($z===FALSE) continue; | ||
+ | $val = substr($line, | ||
+ | | ||
+ | // | ||
+ | } | ||
+ | // | ||
+ | } | ||
+ | |||
+ | /** private -- transcribe separators to diagnostic format */ | ||
+ | function transcribe_pica_rec($str) { | ||
+ | | ||
+ | " | ||
+ | )); | ||
+ | } | ||
+ | |||
+ | /** private -- pica charset handling (we want utf8) */ | ||
+ | function transcribe_pica_utf8($str) { | ||
+ | | ||
+ | " | ||
+ | " | ||
+ | )); | ||
+ | } | ||
+ | } //end class PicaRecord | ||
+ | |||
+ | /** get a pica record via pica xml web interface and return */ | ||
+ | class Picappn { | ||
+ | // require php5-curl | ||
+ | var $opac; | ||
+ | var $url; | ||
+ | var $ppn; | ||
+ | var $myself; | ||
+ | |||
+ | var $prec; // a picarecord | ||
+ | |||
+ | // | ||
+ | function Picappn() { | ||
+ | //probably localhost on a typical pica psi production system | ||
+ | global $opac_url; | ||
+ | $this-> | ||
+ | $this-> | ||
+ | $this-> | ||
+ | } | ||
+ | |||
+ | /** public -- convert for output using raw array data*/ | ||
+ | function convOutput($array, | ||
+ | if (empty($array)) return ""; | ||
+ | if (!empty($subfield)) { | ||
+ | if (empty($array[$category][$subfield])) return ""; | ||
+ | $res = $text.$separator.$array[$category][$subfield].$suffix; | ||
+ | } else { | ||
+ | if (empty($array[$category])) return ""; | ||
+ | $res = $text.$separator.$array[$category].$suffix; | ||
+ | } | ||
+ | return $res; | ||
+ | } | ||
+ | |||
+ | /** public -- convert for output using nice array data*/ | ||
+ | function convOutputNice($array_nice, | ||
+ | if (empty($array_nice)) return ""; | ||
+ | if (empty($array_nice[$key])) return ""; | ||
+ | $res = $array_text[$key].$prefix.$array_nice[$key].$suffix; | ||
+ | return $res; | ||
+ | } | ||
+ | |||
+ | /** public -- return record as Array */ | ||
+ | function getArray() { | ||
+ | if ($this-> | ||
+ | $res = $this-> | ||
+ | $res = $this-> | ||
+ | return $res; | ||
+ | } | ||
+ | |||
+ | /** public -- return array with speaking keys */ | ||
+ | function getArrayNice($array_raw) { | ||
+ | if (empty($array_raw)) return ""; | ||
+ | $record = $array_raw; | ||
+ | |||
+ | global $filter_nice; | ||
+ | |||
+ | //Type | ||
+ | $res['type'] = strtr($record[' | ||
+ | |||
+ | //Author | ||
+ | $res[' | ||
+ | //Editor | ||
+ | $res[' | ||
+ | |||
+ | //Title | ||
+ | $res[' | ||
+ | |||
+ | //Series | ||
+ | $res[' | ||
+ | |||
+ | //Address, especially city | ||
+ | $res[' | ||
+ | // | ||
+ | $res[' | ||
+ | //Edition | ||
+ | $res[' | ||
+ | //Year | ||
+ | $res[' | ||
+ | |||
+ | //ISBNs | ||
+ | $res[' | ||
+ | $res[' | ||
+ | |||
+ | //PPN | ||
+ | $res[' | ||
+ | return $res; | ||
+ | } | ||
+ | |||
+ | /** public | ||
+ | //used by bibsonomy | ||
+ | function getBibsonomy() { | ||
+ | if ($this-> | ||
+ | |||
+ | $res = $this-> | ||
+ | $res = urlencode($res); | ||
+ | |||
+ | global $bibsonomy_url; | ||
+ | $res = $bibsonomy_url.$res; | ||
+ | |||
+ | return $res; | ||
+ | } | ||
+ | |||
+ | /** public -- return BibTex record from pica data */ | ||
+ | //used by unapi | ||
+ | function getBibTex() { | ||
+ | if ($this-> | ||
+ | $record_raw = $this-> | ||
+ | $record_nice = $this-> | ||
+ | $keys_nice = $this-> | ||
+ | |||
+ | //make sure there is only one ISBN | ||
+ | if (!empty($record_nice[' | ||
+ | |||
+ | if (substr($record_nice[' | ||
+ | //Type | ||
+ | $res = "@book {"; | ||
+ | |||
+ | //create identifier | ||
+ | $res .= $this-> | ||
+ | $res .= $this-> | ||
+ | |||
+ | //Author et al. | ||
+ | $i = array(' | ||
+ | ' | ||
+ | |||
+ | foreach ($i as $j) { | ||
+ | $res .= $this-> | ||
+ | } | ||
+ | |||
+ | //Call Number | ||
+ | $res .= $this-> | ||
+ | } | ||
+ | $res .= " | ||
+ | return $res; | ||
+ | } | ||
+ | |||
+ | /** private -- get data via pica xml interface */ | ||
+ | function getData($ppn) { | ||
+ | //check whether curl-Module is available, if not available use fallback | ||
+ | if (function_exists(' | ||
+ | $ch = curl_init(" | ||
+ | curl_setopt($ch, | ||
+ | curl_setopt($ch, | ||
+ | // | ||
+ | curl_setopt($ch, | ||
+ | $res = curl_exec($ch); | ||
+ | curl_close($ch); | ||
+ | } else { | ||
+ | $res = file_get_contents(" | ||
+ | } | ||
+ | return $res; | ||
+ | } | ||
+ | |||
+ | /** public -- return simple dublin core record data from pica record */ | ||
+ | function getDublinCore() { | ||
+ | $res = $this-> | ||
+ | $res = $this-> | ||
+ | return $res; | ||
+ | } | ||
+ | |||
+ | /** public -- return dublin core rdf data from pica record */ | ||
+ | function getDublinCoreRDF() { | ||
+ | $res = $this-> | ||
+ | $res = $this-> | ||
+ | |||
+ | if (empty($res)) return ""; | ||
+ | |||
+ | $res = "<? | ||
+ | $res .= "< | ||
+ | $res .= " | ||
+ | $res .= " | ||
+ | $res .= " | ||
+ | $res .= "< | ||
+ | | ||
+ | $res .= "< | ||
+ | .$this-> | ||
+ | $res .= "< | ||
+ | $res .= "< | ||
+ | $res .= "< | ||
+ | $res .= "< | ||
+ | $res .= "< | ||
+ | $res .= "< | ||
+ | $res .= "< | ||
+ | $res .= "< | ||
+ | $res .= "< | ||
+ | $res .= "< | ||
+ | $res .= "< | ||
+ | $res .= "< | ||
+ | $res .= "< | ||
+ | $res .= "< | ||
+ | $res .= "< | ||
+ | $res .= "</ | ||
+ | $res .= "</ | ||
+ | return $res; | ||
+ | } | ||
+ | |||
+ | /** public -- return JSON record from pica data */ | ||
+ | //used by unapi | ||
+ | function getJson() { | ||
+ | if ($this-> | ||
+ | |||
+ | $res = $this-> | ||
+ | //(PHP 5 >= 5.2.0, PECL json >= 1.2.0) | ||
+ | $res = json_encode($res); | ||
+ | |||
+ | return $res; | ||
+ | } | ||
+ | |||
+ | /** public -- return array with key names for BibTex*/ | ||
+ | function getKeysBibTex() { | ||
+ | //Type | ||
+ | $res['type'] = ' | ||
+ | |||
+ | //Author | ||
+ | $res[' | ||
+ | //Editor | ||
+ | $res[' | ||
+ | |||
+ | //Title | ||
+ | $res[' | ||
+ | |||
+ | //Series | ||
+ | $res[' | ||
+ | |||
+ | //Address, especially city | ||
+ | $res[' | ||
+ | // | ||
+ | $res[' | ||
+ | //Edition | ||
+ | $res[' | ||
+ | //Year | ||
+ | $res[' | ||
+ | |||
+ | //ISBNs | ||
+ | $res[' | ||
+ | $res[' | ||
+ | |||
+ | //PPN | ||
+ | $res[' | ||
+ | return $res; | ||
+ | } | ||
+ | |||
+ | /** public -- return array with key names for text*/ | ||
+ | function getKeysText() { | ||
+ | //Type | ||
+ | $res[' | ||
+ | |||
+ | //Author | ||
+ | $res[' | ||
+ | //Editor | ||
+ | $res[' | ||
+ | |||
+ | //Title | ||
+ | $res[' | ||
+ | |||
+ | //Series | ||
+ | $res[' | ||
+ | |||
+ | //Address, especially city | ||
+ | $res[' | ||
+ | // | ||
+ | $res[' | ||
+ | //Edition | ||
+ | $res[' | ||
+ | //Year | ||
+ | $res[' | ||
+ | |||
+ | //ISBNs | ||
+ | $res[' | ||
+ | $res[' | ||
+ | |||
+ | //PPN | ||
+ | $res[' | ||
+ | return $res; | ||
+ | } | ||
+ | |||
+ | /** public -- return formated pica plus record */ | ||
+ | function getPicaPlus() { | ||
+ | if ($this-> | ||
+ | | ||
+ | $res = $this-> | ||
+ | $head = "<? | ||
+ | $head .= "< | ||
+ | $tail = "</ | ||
+ | return $head.$res.$tail; | ||
+ | } | ||
+ | |||
+ | /** public -- return formated plain record */ | ||
+ | function getPlain() { | ||
+ | if ($this-> | ||
+ | $res = $this-> | ||
+ | $res = $this-> | ||
+ | return $res; | ||
+ | } | ||
+ | |||
+ | /** public -- return simple text record from pica data */ | ||
+ | //used by unapi | ||
+ | function getText() { | ||
+ | if ($this-> | ||
+ | $record_raw = $this-> | ||
+ | $record_nice = $this-> | ||
+ | $keys_nice = $this-> | ||
+ | $res = ""; | ||
+ | |||
+ | if (substr($record_nice[' | ||
+ | //Type | ||
+ | $res .= " | ||
+ | |||
+ | //Author | ||
+ | $res .= $this-> | ||
+ | //Editor | ||
+ | $res .= $this-> | ||
+ | |||
+ | //Title | ||
+ | $res .= $this-> | ||
+ | |||
+ | //Series | ||
+ | $res .= $this-> | ||
+ | |||
+ | //Address, especially city | ||
+ | $res .= $this-> | ||
+ | // | ||
+ | $res .= $this-> | ||
+ | //Edition | ||
+ | $res .= $this-> | ||
+ | //Year | ||
+ | $res .= $this-> | ||
+ | |||
+ | //ISBNs | ||
+ | $res .= $this-> | ||
+ | $res .= $this-> | ||
+ | |||
+ | //Call Number | ||
+ | $i = 1; | ||
+ | $j = 0; | ||
+ | while ( $i <= 99 ) { | ||
+ | if (($i <= 9) && ($j == 0)) { | ||
+ | $j = " | ||
+ | } elseif (($i > 9) && ($j == 0)) { | ||
+ | $j = $i; | ||
+ | } | ||
+ | $res .= $this-> | ||
+ | $i++; | ||
+ | if ($i <= 9 ) { | ||
+ | $j = " | ||
+ | } else { | ||
+ | $j = $i; | ||
+ | } | ||
+ | if (empty($record_raw[" | ||
+ | } | ||
+ | |||
+ | $res .= $this-> | ||
+ | } | ||
+ | return $res; | ||
+ | } | ||
+ | |||
+ | /** public -- return xml formated pica record */ | ||
+ | function getXmlData() { | ||
+ | if ($this-> | ||
+ | $res = $this-> | ||
+ | $res = $this-> | ||
+ | $head = "<? | ||
+ | //$head .= "< | ||
+ | //$head .= "< | ||
+ | //$head .= "< | ||
+ | //$head .= "< | ||
+ | //$head .= "< | ||
+ | $head .= "< | ||
+ | $tail = "</ | ||
+ | return $head.$res.$tail; | ||
+ | } | ||
+ | |||
+ | //public | ||
+ | function setOpac($opac) { | ||
+ | $this-> | ||
+ | } | ||
+ | |||
+ | //public -- set ppn, the unapi identifier | ||
+ | function setPpn($ppn) { | ||
+ | $this-> | ||
+ | $this-> | ||
+ | $this-> | ||
+ | } | ||
+ | |||
+ | } //end class Picappn | ||
+ | |||
+ | /* Return result or 404 */ | ||
+ | function final_result($res, | ||
+ | if (!empty($res)) { | ||
+ | header(" | ||
+ | echo $res; | ||
+ | } else { | ||
+ | header(' | ||
+ | } | ||
} | } | ||
+ | |||
?> | ?> | ||
</ | </ |