掲示板

How to do Liferay 7 Osgi Integrate with Spring Data

7年前 に pawan kumar によって更新されました。

How to do Liferay 7 Osgi Integrate with Spring Data

New Member 投稿: 14 参加年月日: 13/02/07 最新の投稿
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
7年前 に David H Nebinger によって更新されました。

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

Liferay Legend 投稿: 14919 参加年月日: 06/09/02 最新の投稿
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.
7年前 に pawan kumar によって更新されました。

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

New Member 投稿: 14 参加年月日: 13/02/07 最新の投稿
@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
7年前 に David H Nebinger によって更新されました。

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

Liferay Legend 投稿: 14919 参加年月日: 06/09/02 最新の投稿
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.
6年前 に András Soltész によって更新されました。

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

New Member 投稿: 5 参加年月日: 16/03/21 最新の投稿
@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
6年前 に David H Nebinger によって更新されました。

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

Liferay Legend 投稿: 14919 参加年月日: 06/09/02 最新の投稿
Can I ask if you've even considered ServiceBuilder? And if so, why was it eliminated?








Come meet me at the 2017 LSNA!
3年前 に Dipak Ahuja によって更新されました。

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

New Member 投稿: 7 参加年月日: 20/07/22 最新の投稿
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
3年前 に David H Nebinger によって更新されました。

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

Liferay Legend 投稿: 14919 参加年月日: 06/09/02 最新の投稿
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...