예제 #1
0
 /**
  * 
  */
 public static function initApp(&$view, &$model, $backend, $context, $modelIri, $serviceUrl, $staticUrlBase, $baseImagesPath, $dataHash, $uiHash, $titleHelperLimit, $dimensionElementLimit)
 {
     // if cubeVizApp was not loaded yet
     if (false === CubeViz_ViewHelper::$isCubeVizAppLoaded) {
         // get information about the selected model
         $modelStore = $model->getStore();
         $modelInformation = CubeViz_ViewHelper::getModelInformation($modelStore, $model, $modelIri);
         /**
          * Set view and some of its properties.
          */
         $view->cubevizImagesPath = $baseImagesPath;
         /**
          * Get hashes from parameter list
          */
         // hash for data
         if (null == $dataHash) {
             $dataHash = null;
         }
         // hash for ui
         if (null == $uiHash) {
             $uiHash = null;
         }
         $view->isCubeVizDataselectionModuleLoaded = false === isset($view->isCubeVizDataselectionModuleLoaded) ? false : $view->isCubeVizDataselectionModuleLoaded;
         /**
          * Read information from files according to given hashes
          */
         $c = new CubeViz_ConfigurationLink($model, $titleHelperLimit, $dimensionElementLimit);
         $config = array();
         $generatedDataHash = '';
         $generatedUiHash = '';
         list($config['data'], $generatedDataHash) = $c->read($dataHash, 'data');
         list($config['ui'], $generatedUiHash) = $c->read($uiHash, 'ui');
         $config['backend'] = array('context' => $context, 'database' => $backend, 'dataHash' => $generatedDataHash, 'imagesPath' => $baseImagesPath, 'modelInformation' => $modelInformation, 'modelUrl' => $modelIri, 'serviceUrl' => $serviceUrl, 'uiHash' => $generatedUiHash, 'uiParts' => array('dataselectionModule' => array('isLoaded' => CubeViz_ViewHelper::$isCubeVizDataselectionModuleLoaded), 'index' => array('isLoaded' => CubeViz_ViewHelper::$isCubeVizIndexLoaded)), 'uiSettings' => array(), 'url' => $staticUrlBase . 'cubeviz/');
         CubeViz_ViewHelper::$isCubeVizAppLoaded = true;
         return $config;
     }
     return null;
 }
 /**
  *
  */
 public function modelinfoAction()
 {
     if (true === isset($this->_request->m)) {
         // reset resource/class
         unset($this->_owApp->selectedResource);
         unset($this->_owApp->selectedClass);
         unset($this->_session->hierarchyOpen);
     }
     $on = $this->_owApp->getNavigation();
     $on->disableNavigation();
     // disable OntoWiki's Navigation
     /**
      * Load model information
      */
     $graph = $this->_owApp->selectedModel;
     $resource = $this->_owApp->selectedResource;
     $erfurt = $this->_owApp->erfurt;
     $store = $this->_owApp->erfurt->getStore();
     /**
      * Load model information
      */
     $model = $this->_owApp->selectedModel;
     $modelIri = $model->getModelIri();
     $modelStore = $model->getStore();
     $modelInformation = CubeViz_ViewHelper::getModelInformation($modelStore, $model, $modelIri);
     $modelInformation['rdfs:label'] = true === isset($modelInformation['http://www.w3.org/2000/01/rdf-schema#label']) ? $modelInformation['http://www.w3.org/2000/01/rdf-schema#label']['content'] : $modelIri;
     $this->view->sparqlService = $erfurt->getConfig()->store->sparql->serviceUrl;
     $this->view->modelTitle = $modelInformation['rdfs:label'];
     $this->view->modelDescriptions = array();
     foreach ($modelInformation as $url => $entry) {
         if ('http://www.w3.org/2004/02/skos/core#description' == $url || 'http://www.w3.org/2000/01/rdf-schema#comment' == $url) {
             $this->view->modelDescriptions[] = $entry['content'];
         }
     }
     // check for DataCube information
     $query = new DataCube_Query($model, $this->_titleHelperLimit, $this->_dimensionElementLimit);
     $this->view->containsDataCubeInformation = $query->containsDataCubeInformation();
 }