Example usage for com.liferay.portal.kernel.repository RepositoryProviderUtil getRepository

List of usage examples for com.liferay.portal.kernel.repository RepositoryProviderUtil getRepository

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.repository RepositoryProviderUtil getRepository.

Prototype

public static Repository getRepository(long repositoryId) throws PortalException 

Source Link

Usage

From source file:com.liferay.document.library.repository.cmis.internal.model.CMISFileEntry.java

License:Open Source License

@Override
public <T extends Capability> T getRepositoryCapability(Class<T> capabilityClass) {

    try {//from w  w  w. j  ava 2s . c o  m
        Repository repository = RepositoryProviderUtil.getRepository(getRepositoryId());

        return repository.getCapability(capabilityClass);
    } catch (PortalException pe) {
        throw new SystemException("Unable to access repository " + getRepositoryId(), pe);
    }
}

From source file:com.liferay.document.library.repository.cmis.internal.model.CMISFileEntry.java

License:Open Source License

protected Repository getRepository() {
    try {//  ww w. j  a  v a 2 s  .co  m
        return RepositoryProviderUtil.getRepository(getRepositoryId());
    } catch (PortalException pe) {
        throw new SystemException("Unable to get repository for file entry " + getFileEntryId(), pe);
    }
}

From source file:com.liferay.document.library.web.internal.util.DLTrashUtil.java

License:Open Source License

public static boolean isTrashEnabled(long groupId, long repositoryId) throws PortalException {

    if (!TrashUtil.isTrashEnabled(groupId)) {
        return false;
    }//from   w  w w  . j  a  v a  2s . c o  m

    if (repositoryId == groupId) {
        return true;
    }

    Repository repository = RepositoryProviderUtil.getRepository(repositoryId);

    return repository.isCapabilityProvided(TrashCapability.class);
}