简体   繁体   English

Liferay Service Builder和Portlet实例特定数据

[英]Liferay Service Builder and portlet instance specific data

Does Liferay Service Builder peristence provide mechanism for isolating stored data into separate portlet instance specific (portlet added into two separate pages) tables? Liferay Service Builder持久性是否提供将存储的数据隔离到特定于单独的Portlet实例 (将Portlet添加到两个单独的页面)表中的机制?

If it is not possible what is the preferred approach to avoid mixing portlet data on two different portal pages? 如果不可能,最好的方法是避免在两个不同的门户网站页面上混合Portlet数据?

As this is stackoverflow and related to anything with source code: You can create that single scope yourself - Liferay's scope is just on "group". 因为这是stackoverflow,并且与任何与源代码有关的内容:您可以自己创建一个作用域-Liferay的作用域仅在“组”上。 Any other criteria that you add to the data can be there, but the filtering needs to be handled by you. 您添加到数据中的任何其他条件都可以在这里,但是过滤需要由您来处理。

A non-programming way to achieve your goal is to open a subscope for your portlet. 实现目标的非编程方法是为Portlet打开子范围。 This can be inspected with (for example) the MessageBoards portlet: In its configuration you can select if you want the scope to be the "Site" or the "Page". 可以使用(例如)MessageBoards portlet进行检查:在其配置中,您可以选择是否要将范围设为“站点”或“页面”。 Effectively this creates a new "group" (the API name for the scope) and you can just handle the data as if they were in a completely different site. 有效地,这将创建一个新的“组”(范围的API名称),您可以像处理数据一样将它们放在完全不同的站点中。

This illustrates one of the reasons why the API calls it groupId and not siteId , because it's not limited to denote a site. 这说明了API之所以将其称为groupId而不是siteId的原因之一,因为它不限于表示站点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM