/** * Factory method for getting an instance of this class as a singleton * * @return Tx_Yag_Domain_Import_ZipImporter_ImporterBuilder Singleton instance of zip importer builder */ public static function getInstance() { if (self::$instance === NULL) { self::$instance = new self(Tx_Yag_Domain_Configuration_ConfigurationBuilderFactory::getInstance()); } return self::$instance; }
/** * Creates a new album and imports images from zip into that album * * TODO this method is not yet used and hence not tested! * * @param Tx_Yag_Domain_Model_Gallery $gallery Gallery to add album to * @param string $albumName Name of album to be created * @throws Exception */ public function createNewAlbumAndImportFromZipAction(Tx_Yag_Domain_Model_Gallery $gallery, $albumName) { $album = new Tx_Yag_Domain_Model_Album(); $album->setName($albumName); $album->addGallery($gallery); $gallery->addAlbum($album); $this->albumRepository->add($album); $persistenceManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\PersistenceManager'); $persistenceManager->persistAll(); if (!$album->getUid() > 0) { throw new Exception('Album hat keine UID!'); } $importer = Tx_Yag_Domain_Import_ZipImporter_ImporterBuilder::getInstance()->getZipImporterInstanceForAlbum($album); $importer->runImport(); $this->view->assign('album', $album); }
/** * Action for adding new items to an existing album * * @param Tx_Yag_Domain_Model_Album $album Album to add items to * @rbacNeedsAccess * @rbacObject album * @rbacAction edit */ public function addItemsAction(Tx_Yag_Domain_Model_Album $album) { $this->view->assign('zipImportAvailable', Tx_Yag_Domain_Import_ZipImporter_ImporterBuilder::checkIfImporterIsAvailable()); $this->view->assign('album', $album); }