/** * Returns download for given parameters * * @return string * @throws Exception */ public function downloadAction() { if ($this->listIdentifier == $this->exportListIdentifier || !$this->exportListIdentifier) { $list = $this->listFactory->createList($this->dataBackend, $this->configurationBuilder); } else { $exportListConfiguration = $this->settings['listConfig'][$this->exportListIdentifier]; if (!is_array($exportListConfiguration)) { throw new Exception('No export list configuration found for listIdentifier ' . $this->exportListIdentifier, 1317116470); } $extListContext = Tx_PtExtlist_ExtlistContext_ExtlistContextFactory::getContextByCustomConfiguration($exportListConfiguration, $this->listIdentifier, false); $list = $extListContext->getList(true); } $this->view->setExportConfiguration($this->configurationBuilder->buildExportConfiguration()); $this->view->initConfiguration(); $this->view->assign('listHeader', $list->getListHeader()); $this->view->assign('listCaptions', $list->getRenderedListHeader()); $this->view->assign('listData', $list->getRenderedListData()); $this->view->assign('aggregateRows', $list->getRenderedAggregateListData()); return $this->view->render(); }
/** * Getter for album list extlist context * */ public function getAlbumListContext() { if ($this->albumListContext === NULL) { $this->albumListContext = Tx_PtExtlist_ExtlistContext_ExtlistContextFactory::getContextByCustomConfiguration($this->configurationBuilder->buildExtlistConfiguration()->getExtlistSettingsByListId(self::ALBUM_LIST_ID), self::ALBUM_LIST_ID . $this->identifier, FALSE); } return $this->albumListContext; }
/** * @test * @dataProvider performanceDataProvider * @param $colCount * @param $rowCount */ public function iterationListDataPerformance($colCount, $rowCount) { $listSettings = $this->getExtListTypoScript(); $memoryBefore = memory_get_usage(true); $timeBefore = microtime(true); // TODO we are calling a static method on an object here... make this non-static and remove static methods from extlist context factory! Tx_PtExtlist_ExtlistContext_ExtlistContextFactory::setExtListTyposSript($listSettings); $extListContext = Tx_PtExtlist_ExtlistContext_ExtlistContextFactory::getContextByListIdentifier('performanceTestList'); $extListContext->getDataBackend()->setColCount($colCount)->setRowCount($rowCount); $iterationListData = $extListContext->getDataBackend()->getIterationListData(); $iterationListData->current(); /** * This loop renders the complete data set */ foreach ($iterationListData as $row) { /** @var $row Tx_PtExtlist_Domain_Model_List_Row */ } $usedMemory = memory_get_usage(true) - $memoryBefore; $readableMemoryUsage = $usedMemory / (1024 * 1024); $readableMemoryPeakUsage = memory_get_peak_usage(true) / (1024 * 1024); $usedMicroseconds = microtime(true) - $timeBefore; $info = sprintf("\n\t\t\tMemory Usage: %s MB <br />\n\t\t\tMemory Peak Usage %s MB <br />\n\t\t\tProcessing Time: %s Mircroseconds.", $readableMemoryUsage, $readableMemoryPeakUsage, $usedMicroseconds); //die($info); $this->assertTrue(true); }
/** * @static * @param array $extListTypoScript * @return void */ public static function setExtListTyposSript($extListTypoScript) { self::$extListTyposcript = $extListTypoScript; }
/** * @return void */ protected function renderFilterStates() { $activeSheet = $this->objPHPExcel->getActiveSheet(); $extlistContext = Tx_PtExtlist_ExtlistContext_ExtlistContextFactory::getContextByListIdentifier($this->exportConfiguration->getListIdentifier()); $filterBoxCollection = $extlistContext->getFilterBoxCollection(); $activeSheet->setCellValueByColumnAndRow(0, $this->rowNumber, 'Filter'); $this->activeSheet->getStyleByColumnAndRow(0, $this->rowNumber)->applyFromArray(array('font' => array('bold' => true))); $this->rowNumber++; foreach ($filterBoxCollection as $filterBox) { /** @var $filterBox Tx_PtExtlist_Domain_Model_Filter_Filterbox */ foreach ($filterBox as $filter) { /** @var $filter Tx_PtExtlist_Domain_Model_Filter_AbstractFilter */ $activeSheet->setCellValueByColumnAndRow(0, $this->rowNumber, $extlistContext->getConfigurationBuilder()->buildFilterConfiguration()->getFilterBoxConfig($filter->getFilterConfig()->getFilterboxIdentifier())->getFilterConfigByFilterIdentifier($filter->getFilterConfig()->getFilterIdentifier())->getLabel()); $activeSheet->setCellValueByColumnAndRow(1, $this->rowNumber++, $this->renderFilterValues($filter)); } } $activeSheet->setCellValueByColumnAndRow(0, $this->rowNumber++, ''); }
/** * @param string $exportIdentifier * @return string * @throws Exception */ public function downloadAction($exportIdentifier) { $exportSettingsPath = $this->extlistTypoScriptSettingsPath . '.export.exportConfigs.' . $exportIdentifier; $exportSettings = \PunktDe\PtExtbase\Utility\NamespaceUtility::getArrayContentByArrayAndNamespace($this->settings, $exportSettingsPath); if (!is_array($exportSettings) || empty($exportSettings)) { throw new Exception('No export settings found within the path ' . $exportSettingsPath, 1331644291); } $exportConfig = new Tx_PtExtlist_Domain_Configuration_Export_ExportConfig($this->configurationBuilder, $exportSettings); if (array_key_exists('exportListSettingsPath', $exportSettings)) { $exportListSettings = \PunktDe\PtExtbase\Utility\NamespaceUtility::getArrayContentByArrayAndNamespace($this->settings, $exportSettings['exportListSettingsPath']); } else { $exportListSettings = $this->configurationBuilder->getSettings(); } $extListContext = Tx_PtExtlist_ExtlistContext_ExtlistContextFactory::getContextByCustomConfiguration($exportListSettings, $this->listIdentifier, false); $list = $extListContext->getList(true); $view = $this->objectManager->get($exportConfig->getViewClassName()); $view->setConfigurationBuilder($extListContext->getConfigurationBuilder()); $view->setExportConfiguration($exportConfig); $view->assign('listHeader', $list->getListHeader()); $view->assign('listCaptions', $list->getRenderedListHeader()); $view->assign('listData', $list->getRenderedListData()); $view->assign('aggregateRows', $list->getRenderedAggregateListData()); return $view->render(); }