Foros de discusión

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

thumbnail
Anuvab Ghosh, modificado hace 7 años.

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

Regular Member Mensajes: 130 Fecha de incorporación: 18/04/15 Mensajes recientes
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, modificado hace 7 años.

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

Regular Member Mensajes: 130 Fecha de incorporación: 18/04/15 Mensajes recientes
Anyone can help me about this matter. It is really urgent.
thumbnail
Arnab Saha, modificado hace 7 años.

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

New Member Mensajes: 10 Fecha de incorporación: 16/03/15 Mensajes recientes
Hi,

Did you got the solution? cam you share please
thumbnail
Vishnudas Lokhande, modificado hace 7 años.

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

Regular Member Mensajes: 152 Fecha de incorporación: 27/05/13 Mensajes recientes
Have you tried server side or client side IPC if your requirement matches.
thumbnail
Anuvab Ghosh, modificado hace 7 años.

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

Regular Member Mensajes: 130 Fecha de incorporación: 18/04/15 Mensajes recientes
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, modificado hace 7 años.

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

New Member Mensajes: 7 Fecha de incorporación: 17/05/15 Mensajes recientes
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, modificado hace 7 años.

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

Regular Member Mensajes: 130 Fecha de incorporación: 18/04/15 Mensajes recientes
But portletA and PortletB both are from different portlet projects.

Thanks and Regards,
Anuvab
thumbnail
Harvey Tamayo, modificado hace 7 años.

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

New Member Mensajes: 7 Fecha de incorporación: 17/05/15 Mensajes recientes
Hi anuvab,
Yes, both are differents portlet projects, each one with differents class loaders.

Regards,
H. Tamayo
thumbnail
Anuvab Ghosh, modificado hace 7 años.

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

Regular Member Mensajes: 130 Fecha de incorporación: 18/04/15 Mensajes recientes
Thanks.

This is helpuful.

Moreover, I am doing this with friendly URL.

Regards,
Anuvab
thumbnail
Anuvab Ghosh, modificado hace 7 años.

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

Regular Member Mensajes: 130 Fecha de incorporación: 18/04/15 Mensajes recientes
No, till now I did not get any answer.

Thanks and Regards,
Anuvab
Paul P, modificado hace 7 años.

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

New Member Mensajes: 19 Fecha de incorporación: 5/08/15 Mensajes recientes
Look at <liferay-portlet:renderURL> tag. For example, here:
www.liferaysavvy.com/2013/11/working-with-liferay-urls.html
thumbnail
David H Nebinger, modificado hace 7 años.

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

Liferay Legend Mensajes: 14919 Fecha de incorporación: 2/09/06 Mensajes recientes
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.