English (United Kingdom)
English (United States)
(Opens New Window)
Mark as an Answer
Find All DLFolder and DLFileEntry items
February 18, 2013 8:40 AM
Rank: Junior Member
Join Date: July 19, 2012
I'm creating a JSON Web Service that returns all of the DLFolder and DLFileEntry items a user has access to. Currently, I'm figuring out all of the groups that the user belongs to, and then using a liferay API call to retrieve all of the DLFolder and DLFileEntry items that group has access to. I do this for each group the user is in. My current code looks like this:
// Get Groups that the current user is in
long allGroupIds = currentUser.getGroupIds();
// Get Files and Folders based on group ids
List<DLFolder> allFolders = new ArrayList<DLFolder>();
List<DLFileEntry> allFileEntries = new ArrayList<DLFileEntry>();
for(int i = 0; i < allGroupIds.length; i++)
What I want is something like this:
// Get all Files and Folders
List<DLFolder> allFolders = DLFolderUtil.filterFindAll();
List<DLFileEntry> allFileEntries = DLFileEntryUtil.filterFindAll();
I have looked through the liferay API and can't seem to find a way to retrieve all the DLFolder and DLFileEntry items without looping through the groups. (Note: There are liferay API calls that return all of the files and folders on the entire site, but I only want the ones that a user has access too.)
Is there a way to do this?
Sign in to vote.
Please sign in to flag this as inappropriate.