Fóruns

Início » Liferay Portal » English » 3. Development

Visualização combinada Visão plana Exibição em árvore
Tópicos [ Anterior | Próximo ]
toggle
Daniel Nordhoff-Vergien
[Maven] How to access ext from portlet
13 de Abril de 2013 07:55
Resposta

Daniel Nordhoff-Vergien

Ranking: New Member

Mensagens: 7

Data de entrada: 17 de Março de 2013

Mensagens recentes

Hi,

I have an maven project with an ext - where I have an service created with ServiceBuilder - and a portlet. Which dependencies do I have to add to the portlet pom to access the *ServiceUtil class from the ext?

Regards

Daniel
David H Nebinger
RE: [Maven] How to access ext from portlet
13 de Abril de 2013 07:59
Resposta

David H Nebinger

Ranking: Liferay Legend

Mensagens: 6958

Data de entrada: 1 de Setembro de 2006

Mensagens recentes

Defining a service within an EXT plugin has been deprecated for awhile and should be avoided.

Packaging a portlet within an EXT plugin is also deprecated and should be avoided.
Daniel Nordhoff-Vergien
RE: [Maven] How to access ext from portlet
13 de Abril de 2013 08:40
Resposta

Daniel Nordhoff-Vergien

Ranking: New Member

Mensagens: 7

Data de entrada: 17 de Março de 2013

Mensagens recentes

Thanks for the fast answer.

David H Nebinger:
Defining a service within an EXT plugin has been deprecated for awhile and should be avoided.

Which is the way to deploy a service used by several plugins then?
David H Nebinger:

Packaging a portlet within an EXT plugin is also deprecated and should be avoided.

The portlet is not in the EXT. The EXT and the portlet are just having the same parent pom to keep everything together.
David H Nebinger
RE: [Maven] How to access ext from portlet
13 de Abril de 2013 08:59
Resposta

David H Nebinger

Ranking: Liferay Legend

Mensagens: 6958

Data de entrada: 1 de Setembro de 2006

Mensagens recentes

Daniel Nordhoff-Vergien:
David H Nebinger:
Defining a service within an EXT plugin has been deprecated for awhile and should be avoided.

Which is the way to deploy a service used by several plugins then?


One portlet should be the 'service provider'. This portlet has the service.xml file, and when built should generate the corresponding service jar.

Other portlets are 'service consumers'. Their liferay-plugin-package.properties file should list the service provider portlet as a required deployment context. In the Liferay IDE, it will automagically copy the service jar from the service provider portlet to the service consumer portlets whenever the service is rebuilt. Honestly I'm not sure if the Liferay maven archetypes are 'smart enough' to do the same thing or whether you need to pull the jar in manually yourself.

Coincidentally, one portlet project can actually host multiple individual portlets (define multiple portlets in portlet.xml and liferay-portlet.xml). This introduces coupling into the portlet plugin project (may be undesirable) but would be a path to resolve multiple portlets accessing the same service jar.
Daniel Nordhoff-Vergien
RE: [Maven] How to access ext from portlet
19 de Abril de 2013 04:36
Resposta

Daniel Nordhoff-Vergien

Ranking: New Member

Mensagens: 7

Data de entrada: 17 de Março de 2013

Mensagens recentes

Thanks for the answer, the liferay-servicebuilder-archetype creates tow projects, one for the service provider and one to add to the consumer