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?
What is the difference between these services
DLFileEntryLocalServiceUtil
andDLAppLocalServiceUtil
?
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, therepositoryId
is thegroupId
orscopeGroupId
. Otherwise, the repositoryId will correspond to values obtained fromRepositoryLocalServiceUtil
.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With