liferay-service-builder

Liferay: perform an action when a -LocalServiceUtil is available

廉价感情. 提交于 2019-12-23 05:47:12
问题 I have implemented a functional Liferay service using service builder and I want to call a method on the -LocalServiceUtil class just as soon as I possibly can. This is a task I wish to perform when the service starts and also when the service is redeployed. Even though all the methods on the -LocalServiceUtil class are static, they will throw a BeanLocatorException if they are called too soon. com.liferay.portal.kernel.bean.BeanLocatorException: BeanLocator has not been set for servlet

Delete record on sepecific field value in liferay service builder

一个人想着一个人 提交于 2019-12-14 02:16:38
问题 I want to delete specific record using Field Name Table : Dummy Entity Field Id Field Name public void deleteLocation(req, res){ String getLocationName = request.getParameter("locationName"); Location locationToDelete = new LocationImpl(); locationToDelete.setLocationName(getLocationName); LocationLocalServiceUtil.deleteLocation(locationToDelete); } It's not showing me any error but the record doesn't get deleted. Please hep me out. 回答1: The simplest way to achieve this is to add <finder>

Liferay and relationships in it

﹥>﹥吖頭↗ 提交于 2019-12-12 01:46:00
问题 I have a portlet, which can add/update/delete books and add authors. Moreover, you can choose existing authors when you try to add book. And now I need to show how many books were written by each author in "author" table. How can I do it? Im a newbie in liferay and I even have no idea. It's my service.xml <entity name="Book" local-service="true" remote-service="true" cache-enabled="false"> <column name="bookId" type="long" primary="true" /> <column name="bookName" type="String" /> <column

Finder in Liferay's ServiceBuilder

Deadly 提交于 2019-12-12 01:42:38
问题 I know I had already asked this question, but I have misunderstandings yet. My previous question: Liferay and relationships in it In two words: I have a portlet, which can add/update/delete books and add authors. Moreover, you can choose existing authors when you try to add book. http://i.stack.imgur.com/vzUjn.png And now I need to show how many books were written by each author in "author" table. My service.xml: <entity name="Book" local-service="true" remote-service="true" cache-enabled=

exception“:”java.lang.ClassCastException in liferay service builder

旧时模样 提交于 2019-12-10 10:56:24
问题 I have worked on implementation of the Entity remote service. I have created one custom service method in EntityServiceImpl,Created custom service method providing service through InstitutionServiceUtil. After deploy the portlet, while sending request to service method through from browser window,I am getting below Exception exception":"java.lang.ClassCastException: com.institutions.model.impl.InstitutionImpl cannot be cast to com.institutions.model.Institution Note: If I send the request

Liferay Service Builder 6.2: Many to one relationships

一世执手 提交于 2019-11-28 00:35:00
问题 I want to create a one to many relationships and I've used the following service.xml: <entity name="Student" local-service="true" remote-service="true" cache-enabled="false"> <column name="studentId" type="long" primary="true" /> <column name="courses" type="Collection" entity="Course"/> </entity> <entity name="Course" local-service="true" remote-service="true" cache-enabled="false"> <column name="courseId" type="long" primary="true" /> <column name="studentId" type="long"/> </entity> My