在Liferay中获取包含Web内容的portlet/页面

编程入门 行业动态 更新时间:2024-10-18 03:36:44
本文介绍了在Liferay中获取包含Web内容的portlet/页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我试图让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/页面

    本文发布于:2023-07-17 02:47:59,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1128621.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:页面   内容   Liferay   Web   portlet

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!