Retrieves the the repository info objects.

@param string|null $repositoryId
@throws CmisConnectionException
@return RepositoryInfo[] Returns ALL Repository Infos that are available and not just the one requested by id.
963758
protected function getRepositoriesInternal($repositoryId = null)
    {
        $repositoryUrlCache = $this->getRepositoryUrlCache();

        if ($repositoryId === null) {
            // no repository id provided -> get all
            $url = $repositoryUrlCache->buildUrl($this->getServiceUrl());
        } else {
            // use URL of the specified repository
            $url = $repositoryUrlCache->getRepositoryUrl($repositoryId, Constants::SELECTOR_REPOSITORY_INFO) ??
                $repositoryUrlCache->buildUrl($this->getServiceUrl());
        }

        $repositoryInfos = [];
        $result = $this->readJson($url);
        if (!is_array($result)) {
            throw new CmisConnectionException(
                'Could not fetch repository info! Response is not a valid JSON.',
                1416343166
            );
        }
        foreach ($result as $item) {
            if (is_array($item)) {
                $repositoryInfo = $this->getJsonConverter()->convertRepositoryInfo($item);

                if ($repositoryInfo instanceof RepositoryInfoBrowserBinding) {
                    $id = $repositoryInfo->getId();
                    $repositoryUrl = $repositoryInfo->getRepositoryUrl();
                    $rootUrl = $repositoryInfo->getRootUrl();

                    if (empty($id) || empty($repositoryUrl) || empty($rootUrl)) {
                        throw new CmisConnectionException(
                            sprintf('Found invalid Repository Info! (id: %s)', $id),
                            1415187765
                        );
                    }

                    $this->getRepositoryUrlCache()->addRepository($id, $repositoryUrl, $rootUrl);

                    $repositoryInfos[] = $repositoryInfo;
                }
            } else {
                throw new CmisConnectionException(
                    sprintf(
                        'Found invalid repository info! Value of type "array" was expected'
                        . 'but value of type "%s" was given.',
                        gettype($item)
                    ),
                    1415187764
                );
            }
        }

        return $repositoryInfos;
    }
185311
public function getLocationPath($locationId): array
    {
        try {
            $location = $this->loadLocation($locationId);

            $locationPath = $location->path;
            array_shift($locationPath);

            $translatedNames = [];

            foreach ($locationPath as $locationPathId) {
                $locationInPath = $this->loadLocation($locationPathId);
                $translatedNames[] = $this->getContentName($locationInPath->contentInfo->id);
            }

            return $translatedNames;
        } catch (Throwable $t) {
            return [];
        }
    }
1359734
private Document cmisRepository() {
        RepositoryInfo info = session.getRepositoryInfo();
        DocumentWriter writer = newDocument(ObjectId.toString(ObjectId.Type.REPOSITORY_INFO, ""));

        writer.setPrimaryType(CmisLexicon.REPOSITORY);
        writer.setId(REPOSITORY_INFO_ID);

        // product name/vendor/version
        writer.addProperty(CmisLexicon.VENDOR_NAME, info.getVendorName());
        writer.addProperty(CmisLexicon.PRODUCT_NAME, info.getProductName());
        writer.addProperty(CmisLexicon.PRODUCT_VERSION, info.getProductVersion());

        return writer.document();
    }
169495
public function loadRenditionContentLink($repositoryId, $documentId, $streamId)
    {
        $result = $this->getRepositoryUrlCache()->getObjectUrl($repositoryId, $documentId, Constants::SELECTOR_CONTENT);
        if ($result !== null) {
            $result->getQuery()->modify([Constants::PARAM_STREAM_ID => $streamId]);
            $result = (string) $result;
        }
        return $result;
    }
1074219
public function getList($id = 0)
	{
		// Build the request path.
		$uri = new Uri($this->fetchUrl('/repositories'));

		if ($id)
		{
			$uri->setVar('since', (int) $id);
		}

		// Send the request.
		return $this->processResponse($this->client->get($uri));
	}
767543
protected function getRepositoryAndIndices(
        InputInterface $input,
        OutputInterface $output
    ): array {
        $appName = $input->getArgument('app-name');
        $configuration = $this->repositoryBucket->getConfiguration();

        if (!isset($configuration[$appName])) {
            throw new Exception(sprintf('App %s not found under apisearch configuration', $appName));
        }

        $appId = $configuration[$appName]['app_id'];
        self::printInfoMessage(
            $output,
            $this->getHeader(),
            "App: <strong>{$appName} / {$appId}</strong>"
        );

        if (!$input->hasOption('index-name')) {
            return [$configuration[$appName]['app_id'], []];
        }

        $indexNamesAsArray = $configuration[$appName]['indices'] ?? [];

        $indices = array_map(function (string $indexName) use ($indexNamesAsArray, $appName, $output) {
            if (!isset($indexNamesAsArray[$indexName])) {
                throw new Exception(sprintf(
                    'Index %s not found under %s repository. Indices availables: %s',
                    $indexName,
                    $appName,
                    implode(', ', array_keys($indexNamesAsArray))
                ));
            }

            $indexId = $indexNamesAsArray[$indexName];
            self::printInfoMessage(
                $output,
                $this->getHeader(),
                "Index: <strong>{$indexName} / {$indexId}</strong>"
            );

            return IndexUUID::createById($indexId);
        }, $input->getOption('index-name'));

        return [
            AppUUID::createById($appId),
            $indices,
        ];
    }
1176150
public function getSiteInfo(int $appId) : array
    {
        Assert::that($appId)->greaterThan(0, 'The $appId has to be positive');
        return (array)$this->master->doRequest(
            'GET',
            sprintf(
                '/admin/WEBAPI/Endpoints/v1_0/PluginService/{KEY}/SiteInfo/%s',
                $appId
            )
        );
    }
191644
public function getUidInfo($uid)
    {
        $fd = $this->getFdFromUid($uid);
        if (empty($fd)) {
            if (!$this->isCluster()) {
                return [];
            } else {
                $fdInfo = ProcessManager::getInstance()->getRpcCall(ClusterProcess::class)->my_getUidInfo($uid);

                return $fdInfo;
            }
        } else {
            $fdInfo = $this->getFdInfo($fd);
            $fdInfo['node'] = getNodeName();

            return $fdInfo;
        }
    }
332111
public function loadContentLink($repositoryId, $documentId)
    {
        $result = $this->getRepositoryUrlCache()->getObjectUrl($repositoryId, $documentId, Constants::SELECTOR_CONTENT);
        return $result === null ? null : (string) $result;
    }
197648
public function addRepository($repositoryId, $repositoryUrl, $rootUrl)
    {
        if (empty($repositoryId) || empty($repositoryUrl) || empty($rootUrl)) {
            throw new CmisInvalidArgumentException(
                'Repository Id or Repository URL or Root URL is not set!',
                1408536098
            );
        }

        $this->repositoryUrls[$repositoryId] = $repositoryUrl;
        $this->rootUrls[$repositoryId] = $rootUrl;
    }
673018
public function loadContentVersions($contentId, Request $request)
    {
        $contentInfo = $this->repository->getContentService()->loadContentInfo($contentId);

        return new Values\VersionList(
            $this->repository->getContentService()->loadVersions($contentInfo),
            $request->getPathInfo()
        );
    }
238328
public function getLeaves($rootId = null): Collection
    {
        $list = $this->repo->pushCriteria(new GetLeaves($rootId))
            ->all([
                'id',
                'pid',
                'root_id',
                'deep',
                'name'
            ]);

        return $list;
    }
789817
protected function getRepositoryUrl($repositoryId, $selector = null)
    {
        $result = $this->getRepositoryUrlCache()->getRepositoryUrl($repositoryId, $selector);

        if ($result === null) {
            $this->getRepositoriesInternal($repositoryId);
            $result = $this->getRepositoryUrlCache()->getRepositoryUrl($repositoryId, $selector);
        }

        if ($result === null) {
            throw new CmisObjectNotFoundException(
                sprintf(
                    'Unknown repository! Repository: "%s" | Selector: "%s"',
                    $repositoryId,
                    $selector
                )
            );
        }

        return $result;
    }
1161601
public function getConnectorName(string $serverId)
    {
        if (!$this->hasServerConfiguration($serverId)) {
            return null;
        }

        return $this->configuration['connections'][$serverId]['connector'];
    }
1182155
public function getUserCapabilities(string $userId): array
    {
        if (empty($this->userCapabilities)) {
            $this->userCapabilities = Utils::fetchUserCapabilities($userId);
        }

        return $this->userCapabilities;
    }
778780
public function getOne($repository, $id)
    {
        $repoConfig = $this->repos[$repository];
        /** @var $q \Doctrine\ORM\QueryBuilder */
        return $this->doctrine
            ->getRepository($repoConfig['repository'])
            ->find($id);
    }
1234183
public function get_external_files($repositoryid, $sort = '') {
        global $DB;
        $sql = "SELECT ".self::instance_sql_fields('f', 'r')."
                  FROM {files} f
             LEFT JOIN {files_reference} r
                       ON f.referencefileid = r.id
                 WHERE r.repositoryid = ?";
        if (!empty($sort)) {
            $sql .= " ORDER BY {$sort}";
        }

        $result = array();
        $filerecords = $DB->get_records_sql($sql, array($repositoryid));
        foreach ($filerecords as $filerecord) {
            $result[$filerecord->pathnamehash] = $this->get_file_instance($filerecord);
        }
        return $result;
    }