留言板

Can I access any portlet directly using url??

thumbnail
Pradip A Bhatt,修改在10 年前。

Can I access any portlet directly using url??

Junior Member 帖子: 51 加入日期: 13-1-29 最近的帖子
Hi All...

I am using Liferay 6.2.0m2.

In Normal tomcat we can access any application like http://localhost:<port>/ApplicationName.

Is there any mechanism in which i can access that portlet directly url pattern.???

I integrated Jersey RESTful + JSON web service in liferay. This same concept successfully run in normal application.

Where in Liferay, it will returning portlet html data instead fetching any method's data which i want.

Another thing, how can I access service facility of another portlet?? Can you show me basic example of Web Service in Liferay?


Thanks ssss in Advance..

Pradip Bhatt
thumbnail
mohammad azaruddin,修改在10 年前。

RE: Can I access any portlet directly using url??

Expert 帖子: 492 加入日期: 12-9-17 最近的帖子
Hi
Portlets are not directly URL addressable. U can't send somebody URL of a portlet. U can
send him the URL of the page containing a portlet.

Regards
azhar
thumbnail
Pradip A Bhatt,修改在10 年前。

RE: Can I access any portlet directly using url??

Junior Member 帖子: 51 加入日期: 13-1-29 最近的帖子
Thanks Sir,

Then what is the solution for this??

I implementing Jersey + Json web service concept in my normal application. Now how can I access Service layer of other portlet?

In short... If I want to access data of other portlet then what is the solution for this??? It means my one portlet fetches data from other portlet service and fulfulling requirement/

Example :

There are two portlet project .
1) Employee
2) Admin

- Now from Employee portlet I want to fetching data of Admin portlet (Job Category) and displaying list of Job Category in Employee portlet Project.


Please Help me.

Thankssssssssss
Gwowen Fu,修改在10 年前。

RE: Can I access any portlet directly using url??

Expert 帖子: 315 加入日期: 10-12-27 最近的帖子
Actually you can access a portlet service through a URL. You can build the URL in your java code, JSP, or Javascript.
For Javascript, it looks like this, the main thing here is the portlet id:
      AUI().use('liferay-portlet-url', 'liferay-service', function(a) {
		var resourceURL= Liferay.PortletURL.createResourceURL();
		resourceURL.setResourceId(methodName);
		resourceURL.setPortletMode('view');
		resourceURL.setWindowState('normal');
		resourceURL.setPortletId('fusion_WAR_learnplugin');
		url = resourceURL.toString();
      });
thumbnail
Pradip A Bhatt,修改在10 年前。

RE: Can I access any portlet directly using url??

Junior Member 帖子: 51 加入日期: 13-1-29 最近的帖子
@Gwowen Fu Sir,

Thankss sir,

Can you please provide me JAVA code for this?? Main thing I am using liferay as a container. My all code in these portlets from Struts2 + Spring + Hibernate. And I am also not using Service Builder.

I hope you help me.

Thankssssssss
thumbnail
Tejas patel,修改在10 年前。

RE: Can I access any portlet directly using url??

Junior Member 帖子: 71 加入日期: 12-1-24 最近的帖子
Hey Pradip,

You can use under given way to call the any portlet using url, this code is for jsp page.
in this code when the link is clicked the xyzportlet called directly.



&lt;%
long pid=PortalUtil.getPlidFromPortletId(themeDisplay.getScopeGroupId(), "xyz_WAR_xyzportlet");
%&gt;
<liferay-portlet:renderurl portletName="xyz_WAR_xyzportlet" plid="${pid}" var="link" />
						
<a href="<%=link.toString()%>">link</a>

thumbnail
Pradip A Bhatt,修改在10 年前。

RE: Can I access any portlet directly using url?? (答复)

Junior Member 帖子: 51 加入日期: 13-1-29 最近的帖子
Thanksssssss Dear,

Finally I found the solution of this problem.

Finally i successfully integrated Jersey RESTful web service which returns JSON string as a other portlet's service output. Its done.

Thanksssssssssss All....