Foren

Home » Liferay Portal » English » 3. Development

Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
Omkar Khandare
I want one common service builder portlet for all other portlets.
20. Februar 2013 04:22
Antwort

Omkar Khandare

Rang: Junior Member

Nachrichten: 40

Eintrittsdatum: 6. März 2012

Neue Beiträge

I want to create one common datamodel portlet with service.xml containing all entities
to be used by all other portlets.

even if they ahve any extra columns in their table for entity
then they can be able to add the service.xml with additional fields along with old fields in
parent entities mentioned in common datamodel portlet.

How this common data modelling can be achieved.
Plz Help.
David H Nebinger
RE: I want one common service builder portlet for all other portlets.
20. Februar 2013 05:33
Antwort

David H Nebinger

Rang: Liferay Legend

Nachrichten: 6692

Eintrittsdatum: 1. September 2006

Neue Beiträge

Don't understand the question here...

You are free to (and encouraged to) create a single portlet plugin that has your service.xml file that covers all of your entities. You then share the service jar with all other portlets, thus exposing your single service layer to all.
Omkar Khandare
RE: I want one common service builder portlet for all other portlets.
20. Februar 2013 06:38
Antwort

Omkar Khandare

Rang: Junior Member

Nachrichten: 40

Eintrittsdatum: 6. März 2012

Neue Beiträge

means i have to include service jar file of my common portlet into other portlets lib folder..??

So then how i can be able use all services of create, update & delete for any entity..?

& can i be able reuse columns of any entity & add more if needed.?

can explain in detail.
as I am using service builder for my project first time,
I don't know how can do common data modelling & implement the same.

Thanks
David H Nebinger
RE: I want one common service builder portlet for all other portlets.
20. Februar 2013 06:51
Antwort

David H Nebinger

Rang: Liferay Legend

Nachrichten: 6692

Eintrittsdatum: 1. September 2006

Neue Beiträge

Omkar Khandare:
means i have to include service jar file of my common portlet into other portlets lib folder..??


If you use the IDE and use the required deployment context in the other plugins, the service jar will be copied automatically.

So then how i can be able use all services of create, update & delete for any entity..?


The service jar will create XxxLocalServiceUtil classes which expose methods you can use for CRUD operations.

& can i be able reuse columns of any entity & add more if needed.?


Yes, and it's much easier. Use the service.xml to add new columns, rebuild the services, and your updated entities with new columns are there.
Hitoshi Ozawa
RE: I want one common service builder portlet for all other portlets.
20. Februar 2013 14:04
Antwort

Hitoshi Ozawa

Rang: Liferay Legend

Nachrichten: 7990

Eintrittsdatum: 23. März 2010

Neue Beiträge

means i have to include service jar file of my common portlet into other portlets lib folder..??


If you're going to have just one service jar file, do what liferay is doing and put the file in the application server's lib\ext directory.

Information on Service Builder is provlded in Liferay's online documentation:
http://www.liferay.com/documentation/liferay-portal/6.1/development/-/ai/service-build-5

BUT before doing that,

as I am using service builder for my project first time,
I don't know how can do common data modelling & implement the same.


Please also read the forum guidelines. Search and read before you post. There's plenty of information available.
http://www.liferay.com/community/forums/-/message_boards/message/572822
David H Nebinger
RE: I want one common service builder portlet for all other portlets.
20. Februar 2013 15:31
Antwort

David H Nebinger

Rang: Liferay Legend

Nachrichten: 6692

Eintrittsdatum: 1. September 2006

Neue Beiträge

Hitoshi Ozawa:
If you're going to have just one service jar file, do what liferay is doing and put the file in the application server's lib\ext directory.


I typically do not recommend this because of the restart requirement necessary for deploying updates. Liferay doesn't have this issue because it is handled by doing a full portal upgrade, but for a constantly changing service layer (adding new entities, methods, etc.) dealing w/ a server restart can be a pain.
Omkar Khandare
RE: I want one common service builder portlet for all other portlets.
20. Februar 2013 19:58
Antwort

Omkar Khandare

Rang: Junior Member

Nachrichten: 40

Eintrittsdatum: 6. März 2012

Neue Beiträge

Thanks Hitoshi & David.

I started working with it.
I am going well,
Only thing is, now i manually copied that jar file of common service into other portlet lib folders.
So now i am able instantiate all methods of xxxLocalServiceUtil.java & xxx.java in my xxxPortletAction.java methods.

Records are getting saved & fetched as well.

For development i will use in my portlets lib folder & at time of deployment I'll put that jar into Tomcat lib folder.

Thanks again.