论坛

主页 » Liferay Portal » English » 3. Development

组合视图 统一视图 树状图
讨论主题 [ 上一个 | 下一个 ]
toggle
Pradip A Bhatt
Can I access any portlet directly using url??
2013年5月2日 上午4:31
答复

Pradip A Bhatt

等级: Junior Member

帖子: 51

加入日期: 2013年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
mohammad azaruddin
RE: Can I access any portlet directly using url??
2013年5月2日 上午5:14
答复

mohammad azaruddin

等级: Expert

帖子: 457

加入日期: 2012年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
Pradip A Bhatt
RE: Can I access any portlet directly using url??
2013年5月2日 上午6:50
答复

Pradip A Bhatt

等级: Junior Member

帖子: 51

加入日期: 2013年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
RE: Can I access any portlet directly using url??
2013年5月2日 下午2:17
答复

Gwowen Fu

等级: Expert

帖子: 302

加入日期: 2010年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:
1      AUI().use('liferay-portlet-url', 'liferay-service', function(a) {
2        var resourceURL= Liferay.PortletURL.createResourceURL();
3        resourceURL.setResourceId(methodName);
4        resourceURL.setPortletMode('view');
5        resourceURL.setWindowState('normal');
6        resourceURL.setPortletId('fusion_WAR_learnplugin');
7        url = resourceURL.toString();
8      });
Pradip A Bhatt
RE: Can I access any portlet directly using url??
2013年5月2日 下午9:33
答复

Pradip A Bhatt

等级: Junior Member

帖子: 51

加入日期: 2013年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
Tejas patel
RE: Can I access any portlet directly using url??
2013年5月3日 上午5:58
答复

Tejas patel

等级: Junior Member

帖子: 71

加入日期: 2012年1月23日

最近的帖子

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.


1
2<%
3long pid=PortalUtil.getPlidFromPortletId(themeDisplay.getScopeGroupId(), "xyz_WAR_xyzportlet");
4%>
5<liferay-portlet:renderURL portletName="xyz_WAR_xyzportlet" plid="${pid}" var="link" />
6                        
7<a href="<%=link.toString()%>">link</a>
Pradip A Bhatt
RE: Can I access any portlet directly using url??
2013年5月3日 上午6:36
答复

Pradip A Bhatt

等级: Junior Member

帖子: 51

加入日期: 2013年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....