/** * Show a representation of a digital object image. * * @param sfWebRequest $request * */ public function execute($request) { // Get representation by usage type $this->representation = $this->resource->getRepresentationByUsage($this->usageType); // If we can't find a representation for this object, try their parent if (!$this->representation && ($parent = $this->resource->parent)) { $this->representation = $parent->getRepresentationByUsage($this->usageType); } // Set up display of video in flowplayer if ($this->representation) { $this->response->addJavaScript('/vendor/flowplayer/example/flowplayer-3.1.4.min.js'); $this->response->addJavaScript('flowplayer'); // If this is a reference movie, get the thumbnail representation for the // place holder image $this->showFlashPlayer = true; if (QubitTerm::REFERENCE_ID == $this->usageType) { $this->thumbnail = $this->resource->getRepresentationByUsage(QubitTerm::THUMBNAIL_ID); } list($this->width, $this->height) = QubitDigitalObject::getImageMaxDimensions($this->usageType); // For javascript_tag() $this->representationFullPath = public_path($this->representation->getFullPath()); } else { $this->showFlashPlayer = false; $this->representation = QubitDigitalObject::getGenericRepresentation($this->resource->mimeType, $this->usageType); } }