掲示板

Sample EJB3 portlet for LIferay

13年前 に Sam w によって更新されました。

Sample EJB3 portlet for LIferay

Liferay Master 投稿: 660 参加年月日: 09/03/03 最新の投稿
Hi,

Is there any documentation , wiki and tutorial about how to develop EJB3 portlet for Liferay?

Very appreciate for any suggestion and pointers to URL.

Thanks
Sam
11年前 に mohamed othmani によって更新されました。

RE: Sample EJB3 portlet for LIferay

New Member 投稿: 7 参加年月日: 12/05/18 最新の投稿
hi did find any doc ?
thumbnail
11年前 に Vitor Silva によって更新されました。

RE: Sample EJB3 portlet for LIferay

Junior Member 投稿: 36 参加年月日: 12/05/03 最新の投稿
Implementing EJB3 beans in a JEE server is more related to JEE than Liferay. You can use Liferay MVC and Alloy UI and when submitting your form you will invoke EJB3 session beans for example, obtaining them the same way you will do that with an ordinary Web application. I will recommend to follow EJB3 tutorials.
11年前 に mohamed othmani によって更新されました。

RE: Sample EJB3 portlet for LIferay

New Member 投稿: 7 参加年月日: 12/05/18 最新の投稿
can you explain more please Vitor
thumbnail
11年前 に Vitor Silva によって更新されました。

RE: Sample EJB3 portlet for LIferay

Junior Member 投稿: 36 参加年月日: 12/05/03 最新の投稿
Ok. you will need basic notions of J2EE. Please follow the tutorial http://docs.jboss.org/ejb3/app-server/tutorial/index.html
EJBs can be created along the same war file as the portlets or be in a separated instance. Once you have you ejb, lets say a SSB "Car". Your Car EJB has a transactional method called "drive". You then have your portlet java class "MyOwnPortlet" that extends from MVCPortlet, during the action phase upon form submission you will obtain a Car ejb from the ejb container and invoke the drive method. This has absolutely nothing to do with Liferay.
thumbnail
11年前 に Rajesh Chaurasia によって更新されました。

RE: Sample EJB3 portlet for LIferay

Regular Member 投稿: 183 参加年月日: 11/08/18 最新の投稿
I developed a portlet that uses JPA entity manager to do crud operations on an entity.I developed a servcie layer that called Dao layer methods and they were annotated with Transactional to demarcate transactions.

I created a portlet class that extended GenericPortlet .Defined RenderMode to be either VIEW, PRINT,EDIT etc and called required jsp files using
getPortletContext().getRequestDispatcher(renderResponse.encodeURL("/countryportlet/view.jsp")).include(renderRequest, renderResponse);
thumbnail
11年前 に Peter Ruzicka によって更新されました。

RE: Sample EJB3 portlet for LIferay

Junior Member 投稿: 48 参加年月日: 06/12/07 最新の投稿
Rajesh Chaurasia:
I developed a portlet that uses JPA entity manager to do crud operations on an entity.I developed a servcie layer that called Dao layer methods and they were annotated with Transactional to demarcate transactions.

I created a portlet class that extended GenericPortlet .Defined RenderMode to be either VIEW, PRINT,EDIT etc and called required jsp files using
getPortletContext().getRequestDispatcher(renderResponse.encodeURL("/countryportlet/view.jsp")).include(renderRequest, renderResponse);



Hello Rajesh.

I am very interested in using Liferay with J2EE6 (EJB3.1, JPA2.0). The main goals are application transactions.

Did you call Liferay API (e.g. for creating documents, tags etc) from Stateless EJBs? Were you able to rollback (your and Liferay) CRUD operations?

I should be very grateful if you provide some sample EJB and GenericPortlet code.

Thank you
thumbnail
11年前 に David H Nebinger によって更新されました。

RE: Sample EJB3 portlet for LIferay

Liferay Legend 投稿: 14917 参加年月日: 06/09/02 最新の投稿
Transaction management has nothing to do with whether running in a j2ee container or not.

Liferay manages the transactions itself, the j2ee container will not override that.

There's a note in this thread about wrapping calls to the Liferay APIs in your own transaction that should accomplish what you want. Federico does a good job explaining how it's done...
thumbnail
11年前 に Peter Ruzicka によって更新されました。

RE: Sample EJB3 portlet for LIferay

Junior Member 投稿: 48 参加年月日: 06/12/07 最新の投稿
Hello David,

Thank you for your fast response.

I don't have to write configuration files with EJB3.0-3.1 - I was waiting for this step in Java for long time.

I also like hooks in Liferay because of code separation (with Spring MVC).

Maybe I don't understand everything good, but I was using Service Builder in 2006 and thought this is not going to be here forever.

Service Builder codes are very Liferay specific for me and code generation from XML files is not my favorite neither.

These days is very common that I need to call many systems from my codes (e.g. LDAP - OIM, WS , OIF etc). It would be very hard if every system/API requires to generate their specific codes.

Distributed application/database transactions are not easy.

My use case is very common:
Liferay Hook,
my specific business logic with DB,
User/Role management from Liferay, storing document, tags, categories etc in Liferay
integration with other systems
cluster

I would like to use CDI, bean pooling in transaction safe way.

Thank you for your feedback and time