コード例 #1
0
ファイル: export.act.php プロジェクト: adamfranco/polyphony
 /**
  * Save our results. Tearing down and unsetting the Wizard is handled by
  * in {@link runWizard()} and does not need to be implemented here.
  * 
  * @param string $cacheName
  * @return boolean TRUE if save was successful and tear-down/cleanup of the
  *		Wizard should ensue.
  * @access public
  * @since 4/28/05
  */
 function saveWizard($cacheName)
 {
     $wizard = $this->getWizard($cacheName);
     $properties = $wizard->getAllValues();
     // instantiate new exporter
     $exporter = XMLAssetExporter::withCompression($properties['compression']);
     $dir = $exporter->exportList($this->_exportList);
     $this->_archiveFile = $exporter->compressWithStatus();
     $this->_archiveFileKey = str_replace('.', '', basename($this->_archiveFile, $properties['compression']));
     // 		printpre($this->_archiveFile);
     // For security, only files listed in the following array will be allowed
     // to be downloaded.
     if (!isset($_SESSION['EXPORTED_FILES'])) {
         $_SESSION['EXPORTED_FILES'] = array();
     }
     $_SESSION['EXPORTED_FILES'][$this->_archiveFileKey] = array('file' => $this->_archiveFile, 'name' => basename($properties['filepath'] . $properties['compression']), 'mime' => 'application/x-gzip');
     return TRUE;
 }
コード例 #2
0
 /**
  * Exporter of Assets
  * 
  * @access public
  * @since 10/17/05
  */
 function exportAssets()
 {
     $hasRootSearch = FALSE;
     $rootSearchType = new HarmoniType("Repository", "edu.middlebury.harmoni", "RootAssets", "");
     $searchTypes = $this->_object->getSearchTypes();
     while ($searchTypes->hasNext()) {
         if ($rootSearchType->isEqual($searchTypes->next())) {
             $hasRootSearch = TRUE;
             break;
         }
     }
     if ($hasRootSearch) {
         $criteria = NULL;
         $children = $this->_object->getAssetsBySearch($criteria, $rootSearchType, new HarmoniProperties(new Type('Repository', 'edu.middlebury', 'null')));
     } else {
         $children = $this->_object->getAssets();
     }
     $this->_status = new StatusStars(str_replace('%1', $this->_object->getDisplayName(), _("Exporting all Assets in the Collection, '%1'")));
     $this->_status->initializeStatistics($children->count(), 100);
     while ($children->hasNext()) {
         $child = $children->next();
         $exporter = XMLAssetExporter::withDir($this->_xml, $this->_repDir);
         $exporter->export($child);
         $this->_status->updateStatistics();
     }
     unset($exporter);
 }
コード例 #3
0
 /**
  * Exporter of child Assets
  * 
  * @access public
  * @since 10/17/05
  */
 function exportAssets()
 {
     $children = $this->_object->getAssets();
     while ($children->hasNext()) {
         $child = $children->next();
         $exporter = XMLAssetExporter::withDir($this->_xml, $this->_fileDir);
         $exporter->export($child);
         unset($exporter);
     }
 }