Skip to content

Commit

Permalink
Moving a document from one client into another
Browse files Browse the repository at this point in the history
  • Loading branch information
claussni committed Jun 14, 2021
1 parent 134b43b commit f02d33e
Show file tree
Hide file tree
Showing 51 changed files with 1,355 additions and 210 deletions.
48 changes: 25 additions & 23 deletions Classes/Configuration/ClientConfigurationManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,10 @@
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
use TYPO3\CMS\Extbase\Object\ObjectManager;
use EWW\Dpf\Domain\Repository\ClientRepository;
use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;

class ClientConfigurationManager
{

/**
* objectManager
*
* @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
* @TYPO3\CMS\Extbase\Annotation\Inject
*/
protected $objectManager;

/**
* clientRepository
*
* @var \EWW\Dpf\Domain\Repository\ClientRepository
* @TYPO3\CMS\Extbase\Annotation\Inject
*/
protected $clientRepository;

/**
* settings
*
Expand All @@ -64,11 +48,11 @@ class ClientConfigurationManager

public function __construct()
{
$objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(ObjectManager::class);
$objectManager = GeneralUtility::makeInstance(ObjectManager::class);
$clientRepository = $objectManager->get(ClientRepository::class);

if (TYPO3_MODE === 'BE') {
$selectedPageId = (int)\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('id');
$selectedPageId = (int)GeneralUtility::_GP('id');
if ($selectedPageId) {
$this->client = $clientRepository->findAll()->current();

Expand All @@ -82,25 +66,32 @@ public function __construct()

$configurationManager = $objectManager->get(ConfigurationManager::class);
$this->settings = $configurationManager->getConfiguration(
\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS
ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS
);

}

$this->extensionConfiguration = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
\TYPO3\CMS\Core\Configuration\ExtensionConfiguration::class
$this->extensionConfiguration = GeneralUtility::makeInstance(
ExtensionConfiguration::class
)->get('dpf');

}

public function setConfigurationPid($pid)
{
$objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(ObjectManager::class);
$objectManager = GeneralUtility::makeInstance(ObjectManager::class);
$clientRepository = $objectManager->get(ClientRepository::class);

$this->client = $clientRepository->findAllByPid($pid)->current();
}

/**
* @return int|null
*/
public function getClientPid()
{
return $this->client->getPid();
}

/**
* Get setting from client or extension configuration.
Expand Down Expand Up @@ -173,6 +164,11 @@ public function getElasticSearchPort()
return $this->getSetting("elasticSearchPort", "elasticSearchPort");
}

public function getElasticSearchIndexName()
{
return $this->getSetting("elasticSearchIndexName", "elasticSearchIndexName");
}

public function getUploadDirectory()
{
return $this->getSetting("uploadDirectory", "uploadDirectory");
Expand Down Expand Up @@ -374,6 +370,12 @@ public function getFedoraNamespace()
return $settings['fedoraNamespace'];
}

public function getUniversityCollection()
{
$settings = $this->getTypoScriptSettings();
return $settings['universityCollection'];
}

public function getTypoScriptSettings()
{
$objectManager = GeneralUtility::makeInstance(ObjectManager::class);
Expand Down
Loading

0 comments on commit f02d33e

Please sign in to comment.