From d29999076548e6d2acdab853f3ca8deef31c99e3 Mon Sep 17 00:00:00 2001 From: Dirk Date: Wed, 19 Feb 2020 09:08:15 +0100 Subject: [PATCH] Add rest mode to destination data import --- Classes/Service/DestinationDataImportService.php | 7 ++++++- Configuration/TypoScript/constants.typoscript | 2 ++ Configuration/TypoScript/setup.typoscript | 3 ++- Resources/Private/Partials/Date/ListTable.html | 2 +- Resources/Private/Templates/Date/Search.html | 2 +- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Classes/Service/DestinationDataImportService.php b/Classes/Service/DestinationDataImportService.php index da15e9a..b0c81c9 100644 --- a/Classes/Service/DestinationDataImportService.php +++ b/Classes/Service/DestinationDataImportService.php @@ -42,6 +42,10 @@ class DestinationDataImportService { * @var */ protected $restLimit; + /** + * @var + */ + protected $restMode; /** * @var */ @@ -189,6 +193,7 @@ class DestinationDataImportService { $this->restLicenseKey = $this->settings['destinationData']['license']; $this->restType = $this->settings['destinationData']['restType']; $this->restLimit = $this->settings['destinationData']['restLimit']; + $this->restMode = $this->settings['destinationData']['restMode']; $this->restTemplate = $this->settings['destinationData']['restTemplate']; $this->sysCategoriesPid = $this->settings['destinationData']['categoriesPid']; $this->categoryParentUid = $this->settings['destinationData']['categoryParentUid']; @@ -224,7 +229,7 @@ class DestinationDataImportService { $this->logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(__CLASS__); $this->logger->info('Starting Destination Data Import Service'); - $restUrl = $this->restUrl . '?experience=' . $this->restExperience . '&licensekey=' . $this->restLicenseKey . '&type=' . $this->restType . '&limit=' . $this->restLimit . '&template=' . $this->restTemplate; + $restUrl = $this->restUrl . '?experience=' . $this->restExperience . '&licensekey=' . $this->restLicenseKey . '&type=' . $this->restType . '&mode=' . $this->restMode . '&limit=' . $this->restLimit . '&template=' . $this->restTemplate; $this->logger->info('Try to get data from ' . $restUrl); if ($jsonResponse = json_decode(file_get_contents($restUrl),true)) { diff --git a/Configuration/TypoScript/constants.typoscript b/Configuration/TypoScript/constants.typoscript index 6ae8951..2e94d1c 100644 --- a/Configuration/TypoScript/constants.typoscript +++ b/Configuration/TypoScript/constants.typoscript @@ -24,6 +24,8 @@ plugin.tx_events { restType = Event # cat=plugin.tx_events//a; type=string; label=Data Limit restLimit = 200 + # cat=plugin.tx_events//a; type=string; label=Mode + restMode = next_months,12 # cat=plugin.tx_events//a; type=string; label=Data Template restTemplate = ET2014A.json # cat=plugin.tx_events//a; type=string; Label=Category Storage diff --git a/Configuration/TypoScript/setup.typoscript b/Configuration/TypoScript/setup.typoscript index c3d1660..46197a6 100644 --- a/Configuration/TypoScript/setup.typoscript +++ b/Configuration/TypoScript/setup.typoscript @@ -51,6 +51,7 @@ plugin.tx_events { license = {$plugin.tx_events.settings.destinationData.license} restType = {$plugin.tx_events.settings.destinationData.restType} restLimit = {$plugin.tx_events.settings.destinationData.restLimit} + restMode = {$plugin.tx_events.settings.destinationData.restMode} restTemplate = {$plugin.tx_events.settings.destinationData.restTemplate} categoriesPid = {$plugin.tx_events.settings.destinationData.categoriesPid} categoryParentUid = {$plugin.tx_events.settings.destinationData.categoryParentUid} @@ -58,4 +59,4 @@ plugin.tx_events { } } -module.tx_events < plugin.tx_events \ No newline at end of file +module.tx_events < plugin.tx_events diff --git a/Resources/Private/Partials/Date/ListTable.html b/Resources/Private/Partials/Date/ListTable.html index 9b49ae6..48505e9 100644 --- a/Resources/Private/Partials/Date/ListTable.html +++ b/Resources/Private/Partials/Date/ListTable.html @@ -49,4 +49,4 @@ - \ No newline at end of file + diff --git a/Resources/Private/Templates/Date/Search.html b/Resources/Private/Templates/Date/Search.html index ffb62ff..8267fe0 100644 --- a/Resources/Private/Templates/Date/Search.html +++ b/Resources/Private/Templates/Date/Search.html @@ -72,4 +72,4 @@ - \ No newline at end of file +