Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Liferay: Difference between DLFileEntryLocalServiceUtil and DLAppLocalServiceUtil?

What is the difference between this services?

DLFileEntryLocalServiceUtil

and

DLAppLocalServiceUtil

When should we use one and when the other? Is DLAppLocal a new interface in Liferay 6.1 which discourages the old DLFileEntry for application level code?

like image 535
Whimusical Avatar asked Aug 23 '12 15:08

Whimusical


1 Answers

What is the difference between these services DLFileEntryLocalServiceUtil and DLAppLocalServiceUtil?

DLFileEntry services and DLFolderEntry services are specifically for storing file and folder entries in liferay's database and are totally unaware of the new repository concept introduced in 6.1. The user-guide & this wiki explains how to add a new repository.
Were as DLApp (DLAppService & DLAppLocalService) services take into account these things i.e. to say that they take care of syncing documents between liferay database and other repositories, and not just store entries in Liferay database.

The documentation for the class DLAppServiceImpl explains it all (this is almost same for DLAppLocalServiceImpl), the following is an excerpt from the documentation:

The document library local service. All portlets should interact with the document library through this class or through DLAppServiceImpl, rather than through the individual document library service classes.

This class provides a unified interface to all Liferay and third party repositories. While the method signatures are universal for all repositories. Additional implementation-specific parameters may be specified in the serviceContext.

The repositoryId parameter used by most of the methods is the primary key of the specific repository. If the repository is a default Liferay repository, the repositoryId is the groupId or scopeGroupId. Otherwise, the repositoryId will correspond to values obtained from RepositoryLocalServiceUtil.


Is DLAppLocal a new interface in Liferay 6.1?

Yes

which discourages the old DLFileEntry for application level code?

In a sense yes, refer the above explanation. DlAppLocalServices is much better to use as its scope is much greater than the individual document services. Still if you want to use these interfaces for storing the documents & media from your custom plugin portlet you can go ahead and use these, I don't think there should be a problem since even DlAppLocalServices also internally uses the individual document services for storing in liferay repository.

Hope this provides some relevant information for your question.

like image 114
Prakash K Avatar answered Oct 16 '22 21:10

Prakash K