/**
  * Return list of page images for representation or media attribute value to display in document viewer interface
  */
 public function GetPageListAsJSON()
 {
     list($vn_subject_id, $t_subject) = $this->_initView();
     $pn_representation_id = $this->request->getParameter('representation_id', pInteger);
     $pn_value_id = $this->request->getParameter('value_id', pInteger);
     $ps_content_mode = $this->request->getParameter('content_mode', pString);
     $o_view = new View($this->request, $this->request->getViewsDirectoryPath() . '/bundles/');
     $vs_page_cache_key = md5($vn_subject_id . '/' . $pn_representation_id . '/' . $pn_value_id);
     $o_view->setVar('page_cache_key', $vs_page_cache_key);
     $o_view->setVar('t_subject', $t_subject);
     $o_view->setVar('t_representation', new ca_object_representations($pn_representation_id));
     $o_view->setVar('t_attribute_value', new ca_attribute_values($pn_value_id));
     $o_view->setVar('content_mode', $ps_content_mode);
     $va_page_list_cache = $this->request->session->getVar('caDocumentViewerPageListCache');
     $va_pages = $va_page_list_cache[$vs_page_cache_key];
     if (!isset($va_pages)) {
         // Page cache not set?
         $this->postError(1100, _t('Invalid object/representation'), 'ObjectEditorController->GetPage');
         return;
     }
     $va_section_cache = $this->request->session->getVar('caDocumentViewerSectionCache');
     $o_view->setVar('pages', $va_pages);
     $o_view->setVar('sections', $va_section_cache[$vs_page_cache_key]);
     $o_view->setVar('is_searchable', MediaContentLocationIndexer::hasIndexing('ca_object_representations', $pn_representation_id));
     $this->response->addContent($o_view->render('media_page_list_json.php'));
 }
Example #2
0
 /**
  * 
  */
 public function GetPageListAsJSON()
 {
     $pn_object_id = $this->request->getParameter('object_id', pInteger);
     $pn_representation_id = $this->request->getParameter('representation_id', pInteger);
     $ps_content_mode = $this->request->getParameter('content_mode', pString);
     $this->view->setVar('object_id', $pn_object_id);
     $this->view->setVar('representation_id', $pn_representation_id);
     $this->view->setVar('content_mode', $ps_content_mode);
     $t_rep = new ca_object_representations($pn_representation_id);
     $va_download_display_info = caGetMediaDisplayInfo('download', $t_rep->getMediaInfo('media', 'INPUT', 'MIMETYPE'));
     $vs_download_version = $va_download_display_info['display_version'];
     $this->view->setVar('download_version', $vs_download_version);
     $va_page_list_cache = $this->request->session->getVar('caDocumentViewerPageListCache');
     $va_pages = $va_page_list_cache[$pn_object_id . '/' . $pn_representation_id];
     if (!isset($va_pages)) {
         // Page cache not set?
         $this->postError(1100, _t('Invalid object/representation'), 'DetailController->GetPage');
         return;
     }
     $va_section_cache = $this->request->session->getVar('caDocumentViewerSectionCache');
     $this->view->setVar('pages', $va_pages);
     $this->view->setVar('sections', $va_section_cache[$pn_object_id . '/' . $pn_representation_id]);
     $this->view->setVar('is_searchable', MediaContentLocationIndexer::hasIndexing('ca_object_representations', $pn_representation_id));
     $this->render('Details/object_representation_page_list_json.php');
 }
Example #3
0
 /**
  * 
  */
 public function GetPageListAsJSON()
 {
     if (!($vs_table = $this->request->getActionExtra())) {
         $vs_table = 'ca_objects';
     }
     if (!($t_subject = $this->opo_datamodel->getInstanceByTableName($vs_table, true))) {
         $this->postError(1100, _t('Invalid table'), 'DetailController->GetPage');
         return;
     }
     $pn_subject_id = $this->request->getParameter($t_subject->primaryKey(), pInteger);
     $pn_representation_id = $this->request->getParameter('representation_id', pInteger);
     $pn_value_id = $this->request->getParameter('value_id', pInteger);
     $ps_content_mode = $this->request->getParameter('content_mode', pString);
     $t_subject->load($pn_subject_id);
     $vs_page_cache_key = md5($pn_subject_id . '/' . $pn_representation_id . '/' . $pn_value_id);
     $this->view->setVar('page_cache_key', $vs_page_cache_key);
     $this->view->setVar('t_subject', $t_subject);
     $this->view->setVar('t_representation', new ca_object_representations($pn_representation_id));
     $this->view->setVar('t_attribute_value', new ca_attribute_values($pn_value_id));
     $this->view->setVar('content_mode', $ps_content_mode);
     $va_page_list_cache = $this->request->session->getVar('caDocumentViewerPageListCache');
     $va_pages = $va_page_list_cache[$vs_page_cache_key];
     if (!isset($va_pages)) {
         // Page cache not set?
         $this->postError(1100, _t('Invalid object/representation'), 'DetailController->GetPage');
         return;
     }
     $va_section_cache = $this->request->session->getVar('caDocumentViewerSectionCache');
     $this->view->setVar('pages', $va_pages);
     $this->view->setVar('sections', $va_section_cache[$vs_page_cache_key]);
     $this->view->setVar('is_searchable', MediaContentLocationIndexer::hasIndexing('ca_object_representations', $pn_representation_id));
     $this->render('bundles/media_page_list_json.php');
 }