Liferay: Difference between DLFileEntryLocalServiceUtil and DLAppLocalServiceUtil?

What is the difference between these services?

DLFileEntryLocalServiceUtil 

and

 DLAppLocalServiceUtil 

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

+6
source share
1 answer

What is the difference between these DLFileEntryLocalServiceUtil and DLAppLocalServiceUtil ?

Services

DLFileEntry and DLFileEntry services DLFolderEntry designed specifically for storing records in files and folders in the liferay database and are completely unaware of the new repository concept presented in 6.1. user-guide and this wiki explains how to add a new repository.
Since DLApp services ( DLAppService and DLAppLocalService ) take these things into account, that is, they say that they take care of synchronizing documents between the liferay database and other repositories, rather than just storing records in the Liferay database.

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

Local document library service. All portlets must interact with the document library through this class or through DLAppServiceImpl, and not through the service classes of individual documents.

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

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


Is DLAppLocal the new interface in Liferay 6.1?

Yes

which prevents old DLFileEntry for application level code?

In a sense, yes, see the explanation above. DlAppLocalServices much better to use, since its scope is much larger than the individual document services. However, if you want to use these interfaces for storing documents and multimedia from your user plugin portlet, you can continue to use them, I donโ€™t think the problem should be a problem, since even DlAppLocalServices also internally uses separate document services for saving to the repository liferay.

We hope this provides some relevant information for your question.

+16
source

Source: https://habr.com/ru/post/923573/


All Articles