Exemplo n.º 1
0
 /**
  * Display an object.
  *
  * @param Omeka_Record $object The Fedora object record.
  * @return DOMDocument The HTML DOM for the datastream.
  */
 function display($object, $params = array())
 {
     $url = "{$object->getServer()->url}/objects/{$object->pid}" . "/datastreams/SCREEN/content";
     $dom = new DOMDocument();
     $node = $dom->createElement('img');
     $dom->appendChild($node);
     $node->setAttribute('class', 'fedora-renderer');
     $node->setAttribute('alt', 'image');
     $node->setAttribute('src', $url);
     return $dom;
 }
Exemplo n.º 2
0
 /**
  * Render a datastream.
  *
  * @param Omeka_Record $object The Fedora object record.
  * @return DOMDocument|null The output of the renderer.
  */
 public function display($object, $params = null)
 {
     foreach (explode(',', $object->dsids) as $dsid) {
         // Get mime type.
         $mimeType = $object->getServer()->getMimeType($object->pid, $dsid);
         // Try to get renderer.
         $renderer = $this->displayPlugins->getPlugin($mimeType);
         // Render.
         if (!is_null($renderer)) {
             return $renderer->display($object, $params);
         }
     }
 }
Exemplo n.º 3
0
 /**
  * Displays the image.
  *
  * @param Omeka_Record $object The Fedora object record.
  * @param string $size The size to scale the image to.
  *
  * @return DOMDocument The HTML DOM for the image.
  */
 private function _display($object, $params = array())
 {
     if (empty($params)) {
         $params = array('scale' => '400,0');
     }
     $server = $object->getServer();
     $url = "{$server->url}/{$server->getService()}/{$object->pid}" . "/methods/djatoka:jp2SDef/getRegion?" . http_build_query($params);
     $dom = new DOMDocument();
     $node = $dom->createElement('img');
     $dom->appendChild($node);
     $node->setAttribute('class', 'fedora-renderer');
     $node->setAttribute('alt', 'image');
     $node->setAttribute('src', $url);
     return $dom;
 }
Exemplo n.º 4
0
 /**
  * Displays the image.
  *
  * @param Omeka_Record $object The Fedora object record.
  * @param string $size The size to scale the image to.
  *
  * @return DOMDocument The HTML DOM for the image.
  */
 private function _display($object, $params = array())
 {
     if (empty($params)) {
         $params = array('scale' => '600');
     }
     $server = $object->getServer();
     $url = 'http://digital.case.edu/image-service/' . $object->pid . '/full/' . $params['scale'] . ',/0/native.jpg';
     $dom = new DOMDocument();
     $node = $dom->createElement('img');
     $dom->appendChild($node);
     $node->setAttribute('class', 'fedora-renderer');
     $node->setAttribute('alt', 'image');
     $node->setAttribute('src', $url);
     return $dom;
 }