Foren

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

thumbnail
Anuvab Ghosh, geändert vor 7 Jahren.

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

Regular Member Beiträge: 130 Beitrittsdatum: 18.04.15 Neueste Beiträge
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, geändert vor 7 Jahren.

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

Regular Member Beiträge: 130 Beitrittsdatum: 18.04.15 Neueste Beiträge
Anyone can help me about this matter. It is really urgent.
thumbnail
Arnab Saha, geändert vor 7 Jahren.

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

New Member Beiträge: 10 Beitrittsdatum: 16.03.15 Neueste Beiträge
Hi,

Did you got the solution? cam you share please
thumbnail
Vishnudas Lokhande, geändert vor 7 Jahren.

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

Regular Member Beiträge: 152 Beitrittsdatum: 27.05.13 Neueste Beiträge
Have you tried server side or client side IPC if your requirement matches.
thumbnail
Anuvab Ghosh, geändert vor 7 Jahren.

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

Regular Member Beiträge: 130 Beitrittsdatum: 18.04.15 Neueste Beiträge
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, geändert vor 7 Jahren.

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

New Member Beiträge: 7 Beitrittsdatum: 17.05.15 Neueste Beiträge
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, geändert vor 7 Jahren.

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

Regular Member Beiträge: 130 Beitrittsdatum: 18.04.15 Neueste Beiträge
But portletA and PortletB both are from different portlet projects.

Thanks and Regards,
Anuvab
thumbnail
Harvey Tamayo, geändert vor 7 Jahren.

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

New Member Beiträge: 7 Beitrittsdatum: 17.05.15 Neueste Beiträge
Hi anuvab,
Yes, both are differents portlet projects, each one with differents class loaders.

Regards,
H. Tamayo
thumbnail
Anuvab Ghosh, geändert vor 7 Jahren.

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

Regular Member Beiträge: 130 Beitrittsdatum: 18.04.15 Neueste Beiträge
Thanks.

This is helpuful.

Moreover, I am doing this with friendly URL.

Regards,
Anuvab
thumbnail
Anuvab Ghosh, geändert vor 7 Jahren.

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

Regular Member Beiträge: 130 Beitrittsdatum: 18.04.15 Neueste Beiträge
No, till now I did not get any answer.

Thanks and Regards,
Anuvab
Paul P, geändert vor 7 Jahren.

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

New Member Beiträge: 19 Beitrittsdatum: 05.08.15 Neueste Beiträge
Look at <liferay-portlet:renderURL> tag. For example, here:
www.liferaysavvy.com/2013/11/working-with-liferay-urls.html
thumbnail
David H Nebinger, geändert vor 7 Jahren.

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

Liferay Legend Beiträge: 14919 Beitrittsdatum: 02.09.06 Neueste Beiträge
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.