Get images from Liferay Document Library whose id is stored in separate databse table

时光怂恿深爱的人放手 提交于 2019-12-11 10:52:42

问题


I have an Employee table which stores details of Employees (name,date of birth etc) I have a field in Employee table named fileEntryId which stores the Id of the employee pics which are stored in DL in liferay. What I want to do is if the fileEntryId in Employee matches with fileEntryId of the dlfileEntry table of the Document Library then display the images in the search container along with details from Employee table.

How to this?

EDITED:

I have a little problem here. All the images are displayed in each row. What I mean is suppose if I have 7 entries in the employee table (7 employees) then When I am displaying in the search container, all the 7 images are displayed for each employee

<!-- Code to display Employee Image -->


<%
 List <Employee> employee;
 employee= EmployeeLocalServiceUtil.getEmployees(-1,-1);
 String LImageId = String.valueOf(search.getFileEntryId());
 long ImageId = Long.valueOf(LImageId);
  for(Employee emp: employee) {
 DLFileEntry image = DLFileEntryLocalServiceUtil
 .getFileEntry(emp.getFileEntryId());
 String imageURL = "/documents/" + image.getGroupId() + "/" + image.getFolderId() + "/" + image.getTitle()+"/"+image.getUuid();
 %>

  <liferay-ui:search-container-column-text name="pic" href = "">
  <img src="<%=imageURL%>"/> 
 </liferay-ui:search-container-column-text>

I want one image per row. i.e. image of employee on every row..where am I going wrong?

来源:https://stackoverflow.com/questions/16229369/get-images-from-liferay-document-library-whose-id-is-stored-in-separate-databse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!