问题描述
我试图让Liferay(6.0.6)Asset Publisher在门户主页上发布跨多个社区的所有更改.通过单击链接,可以将用户重定向到另一个社区并查看新的Web内容.问题在于,资产发布者的默认行为(即使带有钩子来收集所有社区的信息)也试图通过搜索当前页面的组(其中没有内容)来获取URL.我决定更改显示页面的jsp,以搜索所有社区中的所有页面,并找到第一个包含具有所需Web内容的portlet的页面.所以
I'm trying to make the Liferay (6.0.6) Asset Publisher publish all changes across multiple communities on the portal homepage. By clicking on a link the user is supposed to be redirected to another community and see the new web content. The problem is that the default behaviour of asset publisher (even with the hook to gather info from all communities) tries to get the url by searching the group of the current page (in which the content is not).I decided to change the jsp showing the page to search all pages across all communities and find the first one containing the portlet with the desired web content. So
- 如何通过Web内容的日记ID获取包含Web内容的portlet?
- 如何获取包含portlet的页面?
谢谢
推荐答案
数据库中的 PortletPreferences 表包含系统中每个Portlet的配置. Web内容显示Portlet的articleId的配置作为首选项存储在此表中.如果您查看该表,则有3个重要的列:
The PortletPreferences table in the database contains the configurations of each portlet in the system. The configuration of an articleId for a Web Content Display portlet is stored as a preference in this table. If you look at that table, there are 3 important columns:
- 已折叠包含放置Portlet的布局(=页面)的ID.
- portletid 包含该portlet的 instance id.对于Web Content Display Portlet,此ID的格式为56_INSTANCE_XXXX,其中XXXX是唯一的哈希.
- 首选项是该portlet的所有首选项及其值的XML格式的字符串.
- plid contains the id of the Layout (=page) on which the portlet was dropped.
- portletid contains the instance id of the portlet. For Web Content Display portlet, this ID has the format 56_INSTANCE_XXXX where XXXX is a unique hash.
- preferences is an XML formatted string of all preferences and their values for this portlet.
首选项 XML的示例:
<portlet-preferences>
<preference><name>group-id</name><value>10139</value></preference>
<preference><name>article-id</name><value>14295</value></preference>
</portlet-preferences>
因此,这只是使您的SQL查询正确的问题.据我所知,没有服务可以直接为此致电.
So it's just a question of getting your SQL queries right. As far as I know, there is no service you can call directly for this.
SELECT l.friendlyURL
FROM PortletPreferences p, Layout l
WHERE p.plid=l.plid
AND p.portletid LIKE '56_INSTANCE_%'
AND p.preferences LIKE '<preference><name>article-id</name><value>14295</value></preference>';
这篇关于在Liferay中获取包含Web内容的portlet/页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!