Foren
How to invoke service build in freemarker ADT
S H, geändert vor 7 Jahren.
How to invoke service build in freemarker ADT
Junior Member Beiträge: 30 Beitrittsdatum: 10.03.16 Neueste Beiträge
Hi All,
I created one service builder using eclipse sample code
I tried to invoke it by using below line in freemarker ADT
serviceLocator.findService("com.liferay.sample.service.FooLocalServiceUtil")
Below is the error I got.
Expression serviceLocator.findService("com.liferay.sample.service.FooLocalServiceUtil") is undefined on line 71, column 3 in 20155#20195#21307.
Is this the correct way to invoke custom service build in freemarker?
I created one service builder using eclipse sample code
I tried to invoke it by using below line in freemarker ADT
serviceLocator.findService("com.liferay.sample.service.FooLocalServiceUtil")
Below is the error I got.
Expression serviceLocator.findService("com.liferay.sample.service.FooLocalServiceUtil") is undefined on line 71, column 3 in 20155#20195#21307.
Is this the correct way to invoke custom service build in freemarker?
Kailash Yadav, geändert vor 7 Jahren.
RE: How to invoke service build in freemarker ADT
Regular Member Beiträge: 211 Beitrittsdatum: 18.10.11 Neueste Beiträge
Try using FooLocalService interface instead of FooLocalServiceUtil class
Also check this thread : https://web.liferay.com/community/forums/-/message_boards/message/73391506?_19_threadView=tree
<#assign fooLocalService= serviceLocator.findService("com.liferay.sample.service.FooLocalService") />
Also check this thread : https://web.liferay.com/community/forums/-/message_boards/message/73391506?_19_threadView=tree
S H, geändert vor 7 Jahren.
RE: How to invoke service build in freemarker ADT
Junior Member Beiträge: 30 Beitrittsdatum: 10.03.16 Neueste Beiträge
Thanks for the reply. But I already tried <#assign fooLocalService= serviceLocator.findService("com.liferay.sample.service.FooLocalService") /> , it has similar error
serviceLocator.findService("com.liferay.sample.service.FooLocalService") is undefined.
I also checked the article https://web.liferay.com/community/forums/-/message_boards/message/73391506?_19_threadView=tree, actually I have no issue using the OOTB service, <#assign journalArticleResourceLocalServiceUtil = serviceLocator.findService("com.liferay.portlet.journal.service.JournalArticleLocalService") /> is working for me. My issue happened when using custom service builder.
serviceLocator.findService("com.liferay.sample.service.FooLocalService") is undefined.
I also checked the article https://web.liferay.com/community/forums/-/message_boards/message/73391506?_19_threadView=tree, actually I have no issue using the OOTB service, <#assign journalArticleResourceLocalServiceUtil = serviceLocator.findService("com.liferay.portlet.journal.service.JournalArticleLocalService") /> is working for me. My issue happened when using custom service builder.
Kailash Yadav:
Try using FooLocalService interface instead of FooLocalServiceUtil class<#assign fooLocalService= serviceLocator.findService("com.liferay.sample.service.FooLocalService") />
Also check this thread : https://web.liferay.com/community/forums/-/message_boards/message/73391506?_19_threadView=tree
S H, geändert vor 7 Jahren.
RE: How to invoke service build in freemarker ADT (Antwort)
Junior Member Beiträge: 30 Beitrittsdatum: 10.03.16 Neueste Beiträge
I found how to use it
serviceLocator.findService("my-service-portlet","com.liferay.sample.service.FooLocalService")
serviceLocator.findService("my-service-portlet","com.liferay.sample.service.FooLocalService")