private function initializeSelectedSolrCoreConnection()
    {
        $moduleData = $this->moduleDataStorageService->loadModuleData();

        $solrCoreConnections = $this->solrConnectionManager->getConnectionsBySite($this->selectedSite);
        $currentSolrCorePath = $moduleData->getCore();
        if (empty($currentSolrCorePath)) {
            $this->initializeFirstAvailableSolrCoreConnection($solrCoreConnections, $moduleData);
            return;
        }
        foreach ($solrCoreConnections as $solrCoreConnection) {
            if ($solrCoreConnection->getAdminService()->getCorePath() == $currentSolrCorePath) {
                $this->selectedSolrCoreConnection = $solrCoreConnection;
            }
        }
        if (!$this->selectedSolrCoreConnection instanceof SolrCoreConnection && count($solrCoreConnections) > 0) {
            $this->initializeFirstAvailableSolrCoreConnection($solrCoreConnections, $moduleData);
            $message = LocalizationUtility::translate('coreselector_switched_to_default_core', 'solr', [$currentSolrCorePath, $this->selectedSite->getLabel(), $this->selectedSolrCoreConnection->getAdminService()->getCorePath()]);
            $this->addFlashMessage($message, '', AbstractMessage::NOTICE);
        }
    }
private function initializeSelectedSolrCoreConnection()
    {
        $moduleData = $this->moduleDataStorageService->loadModuleData();

        $solrCoreConnections = $this->solrConnectionManager->getConnectionsBySite($this->selectedSite);
        $currentSolrCorePath = $moduleData->getCore();
        if (empty($currentSolrCorePath)) {
            $this->initializeFirstAvailableSolrCoreConnection($solrCoreConnections, $moduleData);
            return;
        }
        foreach ($solrCoreConnections as $solrCoreConnection) {
            if ($solrCoreConnection->getAdminService()->getCorePath() == $currentSolrCorePath) {
                $this->selectedSolrCoreConnection = $solrCoreConnection;
            }
        }
        if (!$this->selectedSolrCoreConnection instanceof SolrCoreConnection && count($solrCoreConnections) > 0) {
            $this->initializeFirstAvailableSolrCoreConnection($solrCoreConnections, $moduleData);
            $message = LocalizationUtility::translate('coreselector_switched_to_default_core', 'solr', [$currentSolrCorePath, $this->selectedSite->getLabel(), $this->selectedSolrCoreConnection->getAdminService()->getCorePath()]);
            $this->addFlashMessage($message, '', AbstractMessage::NOTICE);
        }
    }
private function initializeSelectedSolrCoreConnection ( ) { $ moduleData = $ this -> moduleDataStorageService -> loadModuleData ( ) ; $ solrCoreConnections = $ this -> solrConnectionManager -> getConnectionsBySite ( $ this -> selectedSite ) ; $ currentSolrCorePath = $ moduleData -> getCore ( ) ; if ( empty ( $ currentSolrCorePath ) ) { $ this -> initializeFirstAvailableSolrCoreConnection ( $ solrCoreConnections , $ moduleData ) ; return ; } foreach ( $ solrCoreConnections as $ solrCoreConnection ) { if ( $ solrCoreConnection -> getAdminService ( ) -> getCorePath ( ) == $ currentSolrCorePath ) { $ this -> selectedSolrCoreConnection = $ solrCoreConnection ; } } if ( ! $ this -> selectedSolrCoreConnection instanceof SolrCoreConnection && count ( $ solrCoreConnections ) > 0 ) { $ this -> initializeFirstAvailableSolrCoreConnection ( $ solrCoreConnections , $ moduleData ) ; $ message = LocalizationUtility :: translate ( 'coreselector_switched_to_default_core' , 'solr' , [ $ currentSolrCorePath , $ this -> selectedSite -> getLabel ( ) , $ this -> selectedSolrCoreConnection -> getAdminService ( ) -> getCorePath ( ) ] ) ; $ this -> addFlashMessage ( $ message , '' , AbstractMessage :: NOTICE ) ; } }
Initializes the solr core connection considerately to the components state.
Uses and persists default core connection if persisted core in Site does not exist.
Initializes the solr core connection considerately to the components state . Uses and persists default core connection if persisted core in Site does not exist .