Initializes a set index configurations for a given site.

@param Site $site
@param array $indexingConfigurationNames if one of the names is a * (wildcard) all configurations are used,
@return array
171708
public function initializeBySiteAndIndexConfigurations(Site $site, array $indexingConfigurationNames): array
    {
        $initializationStatus = [];

        $hasWildcardConfiguration = in_array('*', $indexingConfigurationNames);
        $indexingConfigurationNames = $hasWildcardConfiguration ? $site->getSolrConfiguration()->getEnabledIndexQueueConfigurationNames() : $indexingConfigurationNames;
        foreach ($indexingConfigurationNames as $indexingConfigurationName) {
            $initializationStatus[$indexingConfigurationName] = $this->applyInitialization($site, (string)$indexingConfigurationName);
        }

        if (!is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['postProcessIndexQueueInitialization'])) {
            return $initializationStatus;
        }

        foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['postProcessIndexQueueInitialization'] as $classReference) {
            $indexQueueInitializationPostProcessor = GeneralUtility::makeInstance($classReference);
            if ($indexQueueInitializationPostProcessor instanceof InitializationPostProcessor) {
                $indexQueueInitializationPostProcessor->postProcessIndexQueueInitialization($site, $indexingConfigurationNames, $initializationStatus);
            } else {
                throw new \UnexpectedValueException(get_class($indexQueueInitializationPostProcessor) . ' must implement interface ' . InitializationPostProcessor::class, 1345815561);
            }
        }

        return $initializationStatus;
    }
611531
public function getSettingList(Site $site)
    {
        $settingList = [];
        $items       = $this->getSettingBySiteId($site->getId());
        /** @var $setting \PageBuilder\Entity\Setting */
        foreach ($items as $setting) {
            $code               = $setting->getSettingKey()->getCode();
            $value              = $setting->getSettingValue() ?: $setting->getSettingKey()->getDefaultValue();
            $settingList[$code] = $value;
        }

        $locale                = $site->getLocale() ?: 'en_GB';
        $settingList           = array_merge($settingList, \Locale::parseLocale($locale));
        $settingList['locale'] = $locale;

        return $settingList;
    }
644829
public function generateErrorPages(ReadSiteInterface $site)
    {
        $filenames = array();
        $errorNodes = array();

        $nodeCollection = $this->nodeRepository->findPublishedByType($site->getSiteId(), ReadNodeInterface::TYPE_ERROR);
        foreach ($nodeCollection as $translatedError) {
            $errorNodes[$translatedError->getLanguage()][$translatedError->getNodeId()] = $translatedError;
        }

        foreach ($site->getAliases() as $aliasId => $alias) {
            if (isset($errorNodes[$alias->getLanguage()])) {
                foreach ($errorNodes[$alias->getLanguage()] as $errorNode) {
                    $filenames[] = $this->dumpErrorPageForSiteAlias($errorNode, $aliasId, $site->getSiteId());
                }
            }
        }

        return $filenames;
    }
1052580
public function setSite($site){
        if(!$this->setModified('site', $site)->isModified()){
            return $this;
        }
        $this->site = $site;

        return $this;
    }
132881
private synchronized Map<String, Map<String, Collection<Index<Node>>>> initIndexConfiguration() {
        Map<String, Map<String, Collection<Index<Node>>>> indexesByLabelAndProperty = new HashMap<>();
        try (Transaction tx = graphDatabaseService.beginTx() ) {

            final IndexManager indexManager = graphDatabaseService.index();
            for (String indexName : indexManager.nodeIndexNames()) {

                final Index<Node> index = indexManager.forNodes(indexName);
                Map<String, String> indexConfig = indexManager.getConfiguration(index);

                if (Util.toBoolean(indexConfig.get("autoUpdate"))) {
                    String labels = indexConfig.getOrDefault("labels", "");
                    for (String label : labels.split(":")) {
                        Map<String, Collection<Index<Node>>> propertyKeyToIndexMap = indexesByLabelAndProperty.computeIfAbsent(label, s -> new HashMap<>());
                        String[] keysForLabel = indexConfig.getOrDefault("keysForLabel:" + label, "").split(":");
                        for (String property : keysForLabel) {
                            propertyKeyToIndexMap.computeIfAbsent(property, s -> new ArrayList<>()).add(index);
                        }
                    }
                }
            }
            tx.success();
        }
        return indexesByLabelAndProperty;
    }
1146859
public List<String> getSubSitePaths(CmsObject cms, String subSiteRoot) {

        List<String> result = new ArrayList<String>();
        String normalizedRootPath = CmsStringUtil.joinPaths("/", subSiteRoot, "/");
        CmsADEConfigCacheState state = getCacheState(isOnline(cms));
        Set<String> siteConfigurationPaths = state.getSiteConfigurationPaths();
        for (String path : siteConfigurationPaths) {
            if ((path.length() > normalizedRootPath.length()) && path.startsWith(normalizedRootPath)) {
                result.add(path);
            }
        }
        return result;
    }
474280
public function setSite($site = null)
    {
        $this->site = null;

        if (($site = SiteHelper::resolve($site)) === null) {
            $this->site = $this->siteId = null;
        } else {
            $this->siteId = $site->id;
            $this->site = $site;
        }

        return $this;
    }
975355
public function configurationAction($sitePackageKey = null)
    {
        $sitePackageKey = $sitePackageKey ?: $this->getDefaultSitePackageKey();

        $value = [];
        $value['sitePackage'] = $sitePackageKey;
        $value['ui'] = [
            'sitePackages' =>  $this->getSitePackages(),
            'viewportPresets' => $this->configurationService->getSiteConfiguration($sitePackageKey, 'ui.viewportPresets'),
            'localePresets' => $this->configurationService->getSiteConfiguration($sitePackageKey, 'ui.localePresets'),
            'hotkeys' => $this->configurationService->getSiteConfiguration($sitePackageKey, 'ui.hotkeys'),
            'preview' => $this->configurationService->getSiteConfiguration($sitePackageKey, 'preview')
        ];
        $value['styleguideObjects'] = $this->getStyleguideObjects($sitePackageKey);

        $this->view->assign('value', $value);
    }
296908
protected function getChoices($site)
    {
        $choices = array();
        $index = array();

        foreach ($site->getAliases() as $aliasId => $alias) {
            $choices[$aliasId] = $alias->getDomain() . '(' . $alias->getLanguage();
            if ($alias->getPrefix() != '') {
                $choices[$aliasId] .= ' - ' . $alias->getPrefix();
            }
            $choices[$aliasId] .= ')';
            if ($alias->isMain()) {
                array_unshift($index, $aliasId);
            } else {
                $index[] = $aliasId;
            }
        }

        return array_merge(array_flip($index), $choices);
    }
352821
public function findOneByRootPidAndOptionalIndexingConfigurationName(int $rootPid, $indexingConfigurationName = null): QueueStatistic
    {
        $queryBuilder = $this->getQueryBuilder();
        $queryBuilder
            ->add('select', vsprintf('(%s < %s) AS %s', [
                $queryBuilder->quoteIdentifier('indexed'),
                $queryBuilder->quoteIdentifier('changed'),
                $queryBuilder->quoteIdentifier('pending')
            ]), true)
            ->add('select', vsprintf('(%s) AS %s', [
                $queryBuilder->expr()->notLike('errors', '""'),
                $queryBuilder->quoteIdentifier('failed')
            ]), true)
            ->add('select', $queryBuilder->expr()->count('*', 'count'), true)
            ->from($this->table)
            ->where($queryBuilder->expr()->eq('root', $queryBuilder->createNamedParameter($rootPid, \PDO::PARAM_INT)))
            ->groupBy('pending', 'failed');

        if (!empty($indexingConfigurationName)) {
            $queryBuilder->andWhere($queryBuilder->expr()->eq('indexing_configuration', $queryBuilder->createNamedParameter($indexingConfigurationName)));
        }

        return $this->buildQueueStatisticFromResultSet($queryBuilder->execute()->fetchAll());
    }
260237
protected function getTranslationOverlaysWithConfiguredSite($pageId, Site $site, $defaultLanguageUid, $siteLanguages)
    {
        $translationOverlays = $this->getTranslationOverlaysForPage($pageId, $site->getSysLanguageMode($defaultLanguageUid));

        foreach ($translationOverlays as $key => $translationOverlay) {
            if (!in_array($translationOverlay['sys_language_uid'], $siteLanguages)) {
                unset($translationOverlays[$key]);
            }
        }

        return $translationOverlays;
    }
410288
public function hasSite(Site $site)
    {
        return $this->sites()
            ->where(SiteModel::ATTR_ID, '=', $site->getId())
            ->exists();
    }
65860
public function setSiteConfig($siteConfig)
    {
        $siteConfig = $siteConfig === null ? FoxyStripeSetting::current_foxystripe_setting() : $siteConfig;
        if ($siteConfig instanceof FoxyStripeSetting) {
            $this->site_config = $siteConfig;

            return $this;
        }
        throw new \InvalidArgumentException('$siteConfig needs to be an instance of FoxyStripeSetting.');
    }
1014058
public function getConfigurationsBySite(Site $site)
    {
        $solrConfigurations = [];

        $allConfigurations = $this->getAllConfigurations();
        foreach ($allConfigurations as $configuration) {
            if ($configuration['rootPageUid'] == $site->getRootPageId()) {
                $solrConfigurations[] = $configuration;
            }
        }

        return $solrConfigurations;
    }
220329
private function getRootFolderName(SiteConfig $siteConfig)
    {
        return ($this->owner->has_extension('RootFolder')) ? $this->owner->getRootFolderName() : $siteConfig->getRootFolderName();
    }
724253
public function replaceIdxSiteContents(Site $site, array $contents)
    {
        $contentUids = $this->getAClassContentUids($contents);

        return $this->replaceIdxSiteContentsUid($site->getUid(), $contentUids);
    }
539437
protected function createNewSiteConfigDir($site_name) {
    $config_dir = $this->getConfigValue('docroot') . '/' . $this->getConfigValue('cm.core.path') . '/' . $site_name;
    $result = $this->taskFilesystemStack()
      ->mkdir($config_dir)
      ->setVerbosityThreshold(VerbosityThresholdInterface::VERBOSITY_VERBOSE)
      ->run();
    if (!$result->wasSuccessful()) {
      throw new BltException("Unable to create $config_dir.");
    }
  }