Мне нужно получить записи DDL через запрос json. Ядро Liferay не имеет такого сервиса. Только getRecordSet.Liferay: как добавить новый метод JSONWebService
Я пишу DDLRecordSetService Hook, чтобы добавить новый метод getRecords(recordSetId)
. мой код:
public class ExtDDLRecordSetLocalServiceImpl extends DDLRecordSetServiceWrapper {
public ExtDDLRecordSetLocalServiceImpl(DDLRecordSetService ddlRecordSetService) {
super(ddlRecordSetService);
}
public com.liferay.portlet.dynamicdatalists.model.DDLRecordSet getRecordSet(long recordSetId) throws com.liferay.portal.kernel.exception.PortalException, com.liferay.portal.kernel.exception.SystemException{
System.out.println("------override getRecordSet ");
DDLRecordSet set = super.getRecordSet(recordSetId+10);
return set;
}
@JSONWebService
public List<DDLRecord> getRecords(long recordSetId) throws SystemException, PortalException {
System.out.println("------override getRecords");
return getRecordSet(recordSetId).getRecords();
}
}
я могу переопределить getRecordSet(), но я не доступ к getRecordSet() метод с помощью URL.
я получаю:
{"exception":"No JSON web service action associated with path /ddlrecordset/get-records and method GET for /"}
Как я могу добавить новый DDLRecordSetService, что может вернуть мне набор записей с помощью JSONWebService?