Laliwala IT Services

Laliwala IT Services
Website Development

Wednesday, February 23, 2011

ServiceBuilder and Utils classes, journal articale, update, create, finds, example




Carlo Cavallieri : Hi all,





i can see that for Liferay Services there are various *Utils classes, for example JournalArticale has its own JournalArticleUtil and all the update, create, finds ecc...








go through these methods








If i use service builder these Utils won't be created, so my question is:








if i need to add a method, for example i have an entity "MyEntity" and want to add the method createWithMyParams(); where is the right place to add it?








in the "mypackage.model.impl.MyEntityImpl" class? or is better to create an Util for these cases?






Mazhar Anwar : You can build service classes either in ext or in plugins-sdk.








So, whenever you build service in ext using service builder, Liferay creates its Util classes in ext-service. And in case of Plugins it will be in your portlet-folder/WEB_INF/service folder.








You have to write all your methods in Impl Classes and need to build-service again, and your Util classes will be generated.








HTH.






Mazhar Anwar : You can get more information at






Carlo Cavallieri : thanks

No comments:

Post a Comment