Example usage for com.liferay.portal.kernel.repository LocalRepository getFolders

List of usage examples for com.liferay.portal.kernel.repository LocalRepository getFolders

Introduction

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

Prototype

public List<Folder> getFolders(long parentFolderId, boolean includeMountFolders, int start, int end,
            OrderByComparator<Folder> obc) throws PortalException;

Source Link

Usage

From source file:com.liferay.portlet.documentlibrary.service.impl.DLAppLocalServiceImpl.java

License:Open Source License

/**
 * Returns an ordered range of all the immediate subfolders of the parent
 * folder./*  w  ww  .  j  av a2s.c o  m*/
 *
 * <p>
 * Useful when paginating results. Returns a maximum of <code>end -
 * start</code> instances. <code>start</code> and <code>end</code> are not
 * primary keys, they are indexes in the result set. Thus, <code>0</code>
 * refers to the first result in the set. Setting both <code>start</code>
 * and <code>end</code> to {@link
 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
 * result set.
 * </p>
 *
 * @param  repositoryId the primary key of the folder's repository
 * @param  parentFolderId the primary key of the folder's parent folder
 * @param  includeMountFolders whether to include mount folders for
 *         third-party repositories
 * @param  start the lower bound of the range of results
 * @param  end the upper bound of the range of results (not inclusive)
 * @param  obc the comparator to order the folders (optionally
 *         <code>null</code>)
 * @return the range of immediate subfolders of the parent folder ordered by
 *         comparator <code>obc</code>
 * @throws PortalException if the parent folder could not be found
 * @throws SystemException if a system exception occurred
 */
public List<Folder> getFolders(long repositoryId, long parentFolderId, boolean includeMountFolders, int start,
        int end, OrderByComparator obc) throws PortalException, SystemException {

    LocalRepository localRepository = getLocalRepository(repositoryId);

    return localRepository.getFolders(parentFolderId, includeMountFolders, start, end, obc);
}