Foren

I want one common service builder portlet for all other portlets.

thumbnail
Omkar Khandare, geändert vor 11 Jahren.

I want one common service builder portlet for all other portlets.

Junior Member Beiträge: 49 Beitrittsdatum: 07.03.12 Neueste 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.
thumbnail
David H Nebinger, geändert vor 11 Jahren.

RE: I want one common service builder portlet for all other portlets.

Liferay Legend Beiträge: 14914 Beitrittsdatum: 02.09.06 Neueste 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.
thumbnail
Omkar Khandare, geändert vor 11 Jahren.

RE: I want one common service builder portlet for all other portlets.

Junior Member Beiträge: 49 Beitrittsdatum: 07.03.12 Neueste 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
thumbnail
David H Nebinger, geändert vor 11 Jahren.

RE: I want one common service builder portlet for all other portlets.

Liferay Legend Beiträge: 14914 Beitrittsdatum: 02.09.06 Neueste 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.
thumbnail
Hitoshi Ozawa, geändert vor 11 Jahren.

RE: I want one common service builder portlet for all other portlets.

Liferay Legend Beiträge: 7942 Beitrittsdatum: 24.03.10 Neueste 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
thumbnail
David H Nebinger, geändert vor 11 Jahren.

RE: I want one common service builder portlet for all other portlets.

Liferay Legend Beiträge: 14914 Beitrittsdatum: 02.09.06 Neueste 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.
thumbnail
Omkar Khandare, geändert vor 11 Jahren.

RE: I want one common service builder portlet for all other portlets.

Junior Member Beiträge: 49 Beitrittsdatum: 07.03.12 Neueste 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.
Carter Chen, geändert vor 9 Jahren.

RE: I want one common service builder portlet for all other portlets.

New Member Beiträge: 3 Beitrittsdatum: 25.03.15 Neueste Beiträge
Omkar Khandare:
means i have to include service jar file of my common portlet into other portlets lib folder..??


If you were using Maven to build your project, you can just add your shared Service as a dependency to other Porlets.
thumbnail
David H Nebinger, geändert vor 9 Jahren.

RE: I want one common service builder portlet for all other portlets.

Liferay Legend Beiträge: 14914 Beitrittsdatum: 02.09.06 Neueste Beiträge
Carter Chen:
If you were using Maven to build your project, you can just add your shared Service as a dependency to other Porlets.


It's not that simple.

On the service providing project you have to be religious about updating your pom's project version specification any time the services need to be rebuilt and you have to "mvn install" or "mvn deploy" (depending upon whether you have a local maven repo or not).

You still have the dependency issue in that all plugins that are dependent upon the service jar will need their poms updated with the new version and the plugins will need a (clean) rebuild and deploy. And you have to monitor the deployment to ensure that the old service jar really does get removed also.
Carter Chen, geändert vor 8 Jahren.

RE: I want one common service builder portlet for all other portlets.

New Member Beiträge: 3 Beitrittsdatum: 25.03.15 Neueste Beiträge
@David H Nebinger: what you said is implicit when one using Maven, but it's good to put it explicitly.
thumbnail
David H Nebinger, geändert vor 8 Jahren.

RE: I want one common service builder portlet for all other portlets.

Liferay Legend Beiträge: 14914 Beitrittsdatum: 02.09.06 Neueste Beiträge
That's not true in local dev environs, it may be true in your environment but that is per your standards.

I've worked in environs where the version is bumped when the artifact is promoted to the next phase of development or when it is released in production. I've found that few developers are going to go through 1.0.0, 1.0.1, 1.0.2, etc as they create new development builds, 1.0.0 is the label that is stuck on every artifact until it gets to GA.

For service builder, if you build services you need a new maven version no because you want to ensure that dependencies can always be updated to the latest possible version; earlier versions (even just a minor change from building services) just won't work.