[英]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? DLAppLocal是Liferay 6.1中的一个新界面,它不鼓励旧的DLFileEntry用于应用程序级代码吗?
What is the difference between these services
DLFileEntryLocalServiceUtil
andDLAppLocalServiceUtil
? 这些服务DLFileEntryLocalServiceUtil
和DLAppLocalServiceUtil
什么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. DLFileEntry
服务和DLFolderEntry
服务专门用于在liferay的数据库中存储文件和文件夹条目,并且完全不知道6.1中引入的新存储库概念 。 The user-guide & this wiki explains how to add a new repository. 用户指南和此Wiki介绍了如何添加新存储库。
Were as DLApp
( DLAppService
& DLAppLocalService
) services take into account these things ie to say that they take care of syncing documents between liferay database and other repositories, and not just store entries in Liferay database. 当DLApp
( DLAppService
和DLAppLocalService
)服务考虑到这些事情时,即他们负责在liferay数据库和其他存储库之间同步文档,而不仅仅是在Liferay数据库中存储条目。
The documentation for the class DLAppServiceImpl
explains it all (this is almost same for DLAppLocalServiceImpl
), the following is an excerpt from the documentation: DLAppServiceImpl
类的文档解释了这一切(这与DLAppLocalServiceImpl
几乎相同),以下是文档的摘录:
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. 所有portlet都应该通过此类或通过DLAppServiceImpl与文档库交互,而不是通过单个文档库服务类。
This class provides a unified interface to all Liferay and third party repositories. 此类为所有Liferay和第三方存储库提供统一接口。 While the method signatures are universal for all repositories. 虽然方法签名对所有存储库都是通用的。 Additional implementation-specific parameters may be specified in the serviceContext. 可以在serviceContext中指定其他特定于实现的参数。
The
repositoryId
parameter used by most of the methods is the primary key of the specific repository. 大多数方法使用的repositoryId
参数是特定存储库的主键。 If the repository is a default Liferay repository, therepositoryId
is thegroupId
orscopeGroupId
. 如果存储库是默认的Liferay存储库,则repositoryId
是groupId
或scopeGroupId
。 Otherwise, the repositoryId will correspond to values obtained fromRepositoryLocalServiceUtil
. 否则,repositoryId将对应于从RepositoryLocalServiceUtil
获取的值。
Is DLAppLocal a new interface in Liferay 6.1? DLAppLocal是Liferay 6.1中的新界面吗?
Yes 是
which discourages the old DLFileEntry for application level code? 这会阻止旧的DLFileEntry获取应用程序级代码?
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. DlAppLocalServices
更好用,因为它的范围远远大于单个文档服务。 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. 仍然如果你想使用这些接口来存储自定义插件portlet中的文档和媒体,你可以继续使用它们,我认为不应该有问题,因为即使DlAppLocalServices
也在内部使用单独的文档服务进行存储liferay存储库。
Hope this provides some relevant information for your question. 希望这能为您的问题提供一些相关信息。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.