Fórum

How to do Liferay 7 Osgi Integrate with Spring Data

pawan kumar, modificado 7 Anos atrás.

How to do Liferay 7 Osgi Integrate with Spring Data

New Member Postagens: 14 Data de Entrada: 07/02/13 Postagens Recentes
Hi,

I want to create my own service layer using Spring data or Spring JDBC which has to be deployed on liferay 7 with OSGI.
please suggest me how could i make SPring with OSGi.

Regards,
Pawan Kumar
thumbnail
David H Nebinger, modificado 7 Anos atrás.

RE: How to do Liferay 7 Osgi Integrate with Spring Data

Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
Don't do it. You can't possibly think of all of the aspects of building a shared service layer with transaction management, class loader knowledge, encapsulation of logic to hide dependencies from other modules, ...

Just stick with Service Builder. It's designed to work in the portal and it will build the appropriate API and service layers.
pawan kumar, modificado 7 Anos atrás.

RE: How to do Liferay 7 Osgi Integrate with Spring Data

New Member Postagens: 14 Data de Entrada: 07/02/13 Postagens Recentes
@David.
Appreciated your Words.

But we have been asked not to use service builder since we will be connecting external database and with service builder there are lots of restriction are there as of now.
Our idea is to create the persistence and service layer(Spring Data/Spring JDBC.) by our self and will add dependency to all the portlet.
Even i had done this before in liferay 6.2 version but this time as you know liferay come with OSGI.
So just want to clear can we do that with OSGI.,if it is not possible can we do separate layer with spring without OSGI,will it be recommended.

Regards
Pawan Kumar
thumbnail
David H Nebinger, modificado 7 Anos atrás.

RE: How to do Liferay 7 Osgi Integrate with Spring Data

Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
Sorry, but I'm not going to help do things the wrong way. Too many folks come here looking for the right way to do things in Liferay, and what you're wanting to do is not one of those.

SB has no restrictions; often what you might claim is a restriction is actually a lack of understanding how things work in the portal.
András Soltész, modificado 6 Anos atrás.

RE: How to do Liferay 7 Osgi Integrate with Spring Data

New Member Postagens: 5 Data de Entrada: 21/03/16 Postagens Recentes
@pawan

What was the solution you selected in the end? How well did it work?

We have a similar situation to yours. We need to handle entities coming from different databases and build a unified database about them + show them in the portal.

It seems that Spring Data has problems under Liferay7 (as of CE 7.0 GA3, transaction management classes immediately collide with that of Liferay at deploy time).

I am considering a solution that we implement the backend completely outside of Liferay due to the limitations and serve the unified data for the portal via Spring Data REST services (a micro-service). Only the GUI (portlets) would be running under Liferay, everything else would be outside.
That would have some positive side-effects:
- development would be faster since the external app could be developed as a standalone, full-blown, container-less Spring Boot micro-service for which we could use Spring Loaded and quick container restarts during development
- the application would be more portable, having no hard-dependency on Liferay's service builder

Negative side effect would be increased complexity but I think we could handle most of that with the tools provided by Spring, Maven and Docker.
thumbnail
David H Nebinger, modificado 6 Anos atrás.

RE: How to do Liferay 7 Osgi Integrate with Spring Data

Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
Can I ask if you've even considered ServiceBuilder? And if so, why was it eliminated?








Come meet me at the 2017 LSNA!
Dipak Ahuja, modificado 3 Anos atrás.

RE: How to do Liferay 7 Osgi Integrate with Spring Data

New Member Postagens: 7 Data de Entrada: 22/07/20 Postagens Recentes
Hello David and Team,
I understood from the above conversation that Service Builder is the recommended way for the data layer with Liferay 7. However, we have a situation where all the modules are built using Spring Portlet MVC and Spring Data in conjunction with Liferay 6.1 and we are planning to migrate to Liferay 7.3. We have leveraged Spring support with Liferay at maximum and we would like to continue using Spring Data with Liferay. It would be a great help from your end if you could please suggest to us some direction to achieve this feat.

Thanks in advance.


Cheers,
Dipak
thumbnail
David H Nebinger, modificado 3 Anos atrás.

RE: How to do Liferay 7 Osgi Integrate with Spring Data

Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
You're going to have to do it in the same way you did for 6.1 - portlet wars with spring, etc. wired up inside, plus you'll be stuck with the same limitations on service visibility outside of your spring portlet war that you had in 6.1...