====== Oid-O-Matic connector ====== Oid-O-Matic is a web service catalogue between Museo Torino and Piedmont libraries Opac. ([[http://oidomatic.webhop.net/|Site]]) ([[https://github.com/sebastianomidolo/oidomatic|GitHUB]]) \\ \\ HowTo include Oid-O-Matic harvesting in Book view tab: \\ * Edit ''sites/all/modules/islandora_solution_pack_book/xsl/tocnr_book_view.xsl'' 
fedora/repository//TN

Dublin Core - MetaData

=

Download

Full PDF PDF
Hi-Res IMAGE TIFF
Only Low-Res available due to restricted rights
Low-Res IMAGE JPEG
TEXT TXT

External link

Hard copy
* Edit ''sites/all/modules/islandora_solution_pack_book/islandora_book.module'' Tip function islandora_book_create_book_hardcopy($pid,$modello) { $elelib = ''; if ($modello == "info:fedora/islandora:bookCModel") { $url="http://oidomatic.comperio.it/getinfo.xml?href=http%3A%2F%2Fwww.digibess.it%2Ffedora%2Frepository%2F".$pid; $k = 0; $oidom = new DOMDocument(); if (@$oidom->load($url) !== false){ if (is_object($root = $oidom->getElementsByTagName('objects'))) { if (is_object($root->item(0))) { if (is_object($objs = $root->item(0)->getElementsByTagName('object'))) { foreach($objs as $obj) { $label = $obj->getElementsByTagName('label')->item(0)->nodeValue."\n"; $href = $obj->getElementsByTagName('href')->item(0)->nodeValue."\n"; if(($label !== '') && ($href !== '')) { $elelib .= "

".htmlentities($label,ENT_COMPAT, 'UTF-8')."

"; $k++; } } } } } } } return $elelib; }
... Tip function islandora_book_create_book_view($pid, $query = NULL) { global $user; module_load_include('inc', 'fedora_repository', 'ObjectHelper'); $path = drupal_get_path('module', 'islandora_book'); $objectHelper = new ObjectHelper; // $xml = $objectHelper->getStream($pid, 'MODS'); $xml = $objectHelper->getStream($pid, 'DC'); $dc_xml = $objectHelper->getStream($pid, 'DC'); $rels_xml = $objectHelper->getStream($pid, 'RELS-EXT'); if (!$rels_xml) { drupal_set_message(t('Object does not exist.'), 'error'); return ''; } $simpleRELSxml = simplexml_load_string($rels_xml); // $modello = $simpleRELSxml->xpath('//fedora-model:hasModel@rdf:resource'); // $modello = $simpleRELSxml->xpath('//rdf:RDF/rdf:Description/@rdf:about')."pippo"; $modello = $simpleRELSxml->xpath('//rdf:RDF/rdf:Description/fedora-model:hasModel/@rdf:resource'); $modello = $modello[0]; if (!$dc_xml) { drupal_set_message(t('Object does not exist.'), 'error'); return ''; } $simpleDCxml = simplexml_load_string($dc_xml); $types = $simpleDCxml->xpath('//dc:type'); $ingested = 'false'; if (!empty($types)) { foreach ($types as $type) { if ($type == 'ingested') { $ingested = 'true'; } } } if (!isset($pid)) { drupal_set_message(t('Error getting book view, no identifier specified.')); return; } $proc = NULL; try { $proc = new XsltProcessor(); } catch (Exception $e) { drupal_set_message(t('Error loading Book View XSLT: $e', array('!e' => $e->getMessage()))); return; } $elelib = islandora_book_create_book_hardcopy($pid, $modello); //inject into xsl stylesheet $proc->setParameter('', 'userID', $user->uid); $proc->setParameter('', 'objectsPage', base_path()); $proc->setParameter('', 'pid', $pid); $proc->setParameter('', 'ingested', $ingested); $proc->setParameter('', 'modello', $modello); $proc->setParameter('', 'elelib', $elelib); $xsl = new DomDocument(); $test = $xsl->load($path . '/xsl/tocnr_book_view.xsl'); if (!isset($test)) { drupal_set_message(t('Error loading search results XSLT.')); return t('Error loading search results XSLT.'); } $input = new DomDocument(); $didLoadOk = $input->loadXML($xml); $output = NULL; if (!isset($didLoadOk)) { drupal_set_message(t('Error loading Book View XML.')); return t('Error loading Book View XML.'); } else { $xsl = $proc->importStylesheet($xsl); $newdom = $proc->transformToDoc($input); $output .= $newdom->saveXML(); } if (isset($query)) { module_load_include('inc', 'fedora_repository', 'SearchClass'); $searchClass = new SearchClass(); $pageQuery = convert_query_to_page_query($query, $pid); $output .= '
' . $searchClass->custom_search($pageQuery, $startPage, '/xsl/pageResults.xsl', 500) . '
'; //limit results to 500 pages of a book since there is no paging if we enable paging in xslt this can be changed //return $output."
used this query to find this page $query and new query = $pageQuery
"; return $output; } else { return $output; } }
...