Get images from Liferay Document Library whose id

2019-07-27 07:14发布

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?

0条回答
登录 后发表回答