swapnil butani
swapnil butani

Reputation: 27

Count total no. of downloads of a file from document library

I'm trying to make a portlet which shows most downloaded files from document library.

Thanks in advance.

Upvotes: 2

Views: 1620

Answers (1)

Martin Gamulin
Martin Gamulin

Reputation: 3865

Take a look at com.liferay.portlet.documentlibrary.service.DLFileEntryServiceUtil

Specifically

com.liferay.portlet.documentlibrary.service.DLFileEntryServiceUtil.getFileEntry(long groupId, long folderId, java.lang.String name)

You will get DLFileEntry so

DLFileEntry dlfe = com.liferay.portlet.documentlibrary.service.DLFileEntryServiceUtil.getFileEntry(my-group-id, folder-id, name);
dlfe.getReadCount();

will get you what you want.

Upvotes: 6

Related Questions