简体   繁体   English

如何在Liferay中从另一个Portlet调用一个Portlet?

[英]How to call one portlet from another portlet in Liferay?

I have created 3 portlets (testimonial portlet, directory portlet, polling portlet), and I want to call testimonial portlet from directory portlet. 我已经创建了3个portlet(见证portlet,目录portlet,轮询portlet),并且我想从目录 portlet调用见证 portlet。 How to do this? 这该怎么做? Kindly help me. 请帮助我。

I have written the following code in my view.jsp file of directory portlet: 我在目录portlet的view.jsp文件中编写了以下代码:

<%@ taglib uri="http://liferay.com/tld/portlet" prefix="liferay-portlet" %>

<liferay-portlet:renderURL var="linkURL" portletName="testi" windowState="maximized" />
<br>
<a href="<%= linkURL%>">Testimonial</a>

I can redirect in another page, but I got error like 我可以重定向到另一个页面,但是出现类似

This portlet has been undeployed. 此Portlet已取消部署。 Please redeploy it or remove it from the page. 请重新部署它或将其从页面中删除。

Should I make changes in liferay-portlet.xml ? 我应该在liferay-portlet.xml中进行更改吗? Kindly help me. 请帮助我。

portletName attribute value , you specified seems incorrect. 您指定的portletName属性值似乎不正确。 Thats the reason, you are getting that message. 这就是原因,您正在收到该消息。 I just checked giving incorrect name "test" as portletName whereas there isnt any portlet with name test. 我只是检查了将不正确的名称“ test”指定为portletName,而没有任何带有名称test的portlet。

If <portlet-name>test</portlet-name> is the entry in your liferay-portlet.xml , then give portletName as test_WAR_testportlet , it will work. 如果<portlet-name>test</portlet-name>是liferay-portlet.xml中的条目,则将portletName命名为test_WAR_testportlet ,它将起作用。

If other portlet is Liferay's Out of Box portlet, you can utilize PortletKeys class. 如果其他portlet是Liferay的现成portlet,则可以利用PortletKeys类。

HTH 高温超导

I had same requirement. 我有同样的要求。 But i am very new in Liferay... So i have not much more knowledge of Liferay API. 但是我对Liferay非常陌生...因此,我对Liferay API的了解不多。

So I used web service for fetch portlet data to another portlet. 因此,我使用Web服务将Portlet数据提取到另一个Portlet。 Its really interesting and very easy.. 它真的很有趣,很容易..

You can find more help from this. 您可以从中找到更多帮助。

Jersey RestFul webService 泽西岛RestFul WebService

I done this and all working very well. 我做到了,一切都很好。

Thankssssss 谢谢

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

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