Search in sources :

Example 1 with Network

use of org.alfresco.repo.tenant.Network in project alfresco-remote-api by Alfresco.

the class PublicApiAlfrescoCmisService method getRepositoryInfos.

@Override
public List<RepositoryInfo> getRepositoryInfos(ExtensionsData extension) {
    // for currently authenticated user
    PagingResults<Network> networks = networksService.getNetworks(new PagingRequest(0, Integer.MAX_VALUE));
    List<Network> page = networks.getPage();
    final List<RepositoryInfo> repoInfos = new ArrayList<RepositoryInfo>(page.size() + 1);
    for (Network network : page) {
        repoInfos.add(getRepositoryInfo(network));
    }
    return repoInfos;
}
Also used : RepositoryInfo(org.apache.chemistry.opencmis.commons.data.RepositoryInfo) Network(org.alfresco.repo.tenant.Network) ArrayList(java.util.ArrayList) PagingRequest(org.alfresco.query.PagingRequest)

Example 2 with Network

use of org.alfresco.repo.tenant.Network in project alfresco-remote-api by Alfresco.

the class PublicApiAlfrescoCmisService method getRepositoryInfo.

@Override
public RepositoryInfo getRepositoryInfo(String repositoryId, ExtensionsData extension) {
    Network network = null;
    try {
        checkRepositoryId(repositoryId);
        network = networksService.getNetwork(repositoryId);
    } catch (Exception e) {
        // ACE-2540: Avoid information leak. Same response if repository does not exist or if user is not a member
        throw new CmisObjectNotFoundException("Unknown repository '" + repositoryId + "'!");
    }
    return getRepositoryInfo(network);
}
Also used : CmisObjectNotFoundException(org.apache.chemistry.opencmis.commons.exceptions.CmisObjectNotFoundException) Network(org.alfresco.repo.tenant.Network) CmisObjectNotFoundException(org.apache.chemistry.opencmis.commons.exceptions.CmisObjectNotFoundException)

Aggregations

Network (org.alfresco.repo.tenant.Network)2 ArrayList (java.util.ArrayList)1 PagingRequest (org.alfresco.query.PagingRequest)1 RepositoryInfo (org.apache.chemistry.opencmis.commons.data.RepositoryInfo)1 CmisObjectNotFoundException (org.apache.chemistry.opencmis.commons.exceptions.CmisObjectNotFoundException)1