Forums de discussion

Call a method of a portlet from another portlet of a different project

thumbnail
Anuvab Ghosh, modifié il y a 7 années.

Call a method of a portlet from another portlet of a different project

Regular Member Publications: 130 Date d'inscription: 18/04/15 Publications récentes
Hi,

I am using Liferay 6.1. I want to call a request method from another portlet of different portlet-project.
There is two different portlet projects, Project I : A-portlet and Project II : B-portlet.
I want to call a request method of B-portlet from a button of A-portlet .jsp file.

Both war files of the projects are deployed in the same Tomcat server.

Please tell me how to meet this requirement.

Thanks in advance.

Thanks and Regards,
Anuvab
thumbnail
Anuvab Ghosh, modifié il y a 7 années.

RE: Call a method of a portlet from another portlet of a different project

Regular Member Publications: 130 Date d'inscription: 18/04/15 Publications récentes
Anyone can help me about this matter. It is really urgent.
thumbnail
Arnab Saha, modifié il y a 7 années.

RE: Call a method of a portlet from another portlet of a different project

New Member Publications: 10 Date d'inscription: 16/03/15 Publications récentes
Hi,

Did you got the solution? cam you share please
thumbnail
Vishnudas Lokhande, modifié il y a 7 années.

RE: Call a method of a portlet from another portlet of a different project

Regular Member Publications: 152 Date d'inscription: 27/05/13 Publications récentes
Have you tried server side or client side IPC if your requirement matches.
thumbnail
Anuvab Ghosh, modifié il y a 7 années.

RE: Call a method of a portlet from another portlet of a different project

Regular Member Publications: 130 Date d'inscription: 18/04/15 Publications récentes
Vishnudas Lokhande:
Have you tried server side or client side IPC if your requirement matches.


Thanks for your reply.
I did not try in this way. Can you explain it?

Thanks in advance.

Thanks and Regards,
Anuvab
thumbnail
Harvey Tamayo, modifié il y a 7 années.

RE: Call a method of a portlet from another portlet of a different project

New Member Publications: 7 Date d'inscription: 17/05/15 Publications récentes
Anuvab Ghosh:
Vishnudas Lokhande:
Have you tried server side or client side IPC if your requirement matches.


Thanks for your reply.
I did not try in this way. Can you explain it?

Thanks in advance.

Thanks and Regards,
Anuvab


Hi Anuvab, If i understood your question. You're trying to call one method, that belongs to the portletA, and you want call that method in portletB. If it is, look this page: http://www.liferaysavvy.com/2015/09/java-reflection-in-liferay.html

I hope that you can solve this issue

Regards.
H. Tamayo
thumbnail
Anuvab Ghosh, modifié il y a 7 années.

RE: Call a method of a portlet from another portlet of a different project

Regular Member Publications: 130 Date d'inscription: 18/04/15 Publications récentes
But portletA and PortletB both are from different portlet projects.

Thanks and Regards,
Anuvab
thumbnail
Harvey Tamayo, modifié il y a 7 années.

RE: Call a method of a portlet from another portlet of a different project

New Member Publications: 7 Date d'inscription: 17/05/15 Publications récentes
Hi anuvab,
Yes, both are differents portlet projects, each one with differents class loaders.

Regards,
H. Tamayo
thumbnail
Anuvab Ghosh, modifié il y a 7 années.

RE: Call a method of a portlet from another portlet of a different project

Regular Member Publications: 130 Date d'inscription: 18/04/15 Publications récentes
Thanks.

This is helpuful.

Moreover, I am doing this with friendly URL.

Regards,
Anuvab
thumbnail
Anuvab Ghosh, modifié il y a 7 années.

RE: Call a method of a portlet from another portlet of a different project

Regular Member Publications: 130 Date d'inscription: 18/04/15 Publications récentes
No, till now I did not get any answer.

Thanks and Regards,
Anuvab
Paul P, modifié il y a 7 années.

RE: Call a method of a portlet from another portlet of a different project

New Member Publications: 19 Date d'inscription: 05/08/15 Publications récentes
Look at <liferay-portlet:renderURL> tag. For example, here:
www.liferaysavvy.com/2013/11/working-with-liferay-urls.html
thumbnail
David H Nebinger, modifié il y a 7 années.

RE: Call a method of a portlet from another portlet of a different project

Liferay Legend Publications: 14919 Date d'inscription: 02/09/06 Publications récentes
Anuvab Ghosh:
I am using Liferay 6.1. I want to call a request method from another portlet of different portlet-project.
There is two different portlet projects, Project I : A-portlet and Project II : B-portlet.
I want to call a request method of B-portlet from a button of A-portlet .jsp file.


Sorry, but this really just means you have not encapsulated your business logic correctly. You're trying to build in some sort of dependency on an instance class from another portlet, one that you will not have any expectation that the portlet has been instantiated and the class has actually been loaded and ready.

When you have these kinds of dependencies, you must structure your application to isolate them from portlet instantiation.

For example, you could create a simple ServiceBuilder layer with a service entity (an <entity /> definition with no columns) and build the methods in there. They are isolated from the portlets and can be invoked at any time.

But for your predicament, it's practically impossible to do what you want because you have no real control over what is available when.