フォーラム

ホーム » Liferay Portal » English » 3. Development

構造的に表示 平面上に表示 ツリー上に表示
スレッド [ 前へ | 次へ ]
toggle
Seeya S Kudtarker
Get images from Liferay DL whose id is stored in separate database table
2013/05/07 6:02
答え

Seeya S Kudtarker

ランク: Regular Member

投稿: 187

参加年月日: 2013/01/15

最近の投稿

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 do I do this?
Amit Doshi
RE: Get images from Liferay DL whose id is stored in separate database tabl
2013/05/07 6:23
答え

Amit Doshi

ランク: Liferay Master

投稿: 549

参加年月日: 2010/12/29

最近の投稿

Seeya S Kudtarker:
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 do I do this?


Why you need to compare fileEntryId that stored in the Employee table with the Document Library fileEntryId.

Just Do Simple Thing.

In Search Container you will get the fileEntryId from the Employee table

And use the below code to get the image from it.

DLFileEntry image = DLFileEntryLocalServiceUtil
.getFileEntry(employee.getfileEntryId());
String imageURL = "/documents/" + image.getGroupId() + "/" + image.getFolderId() + "/" + image.getTitle()+"/"+image.getUuid();

Put the imageURL in the src attribute of html image tag and also specify height and width and your work is done.

Thanks & Regards,
Amit Doshi
Vilmos Papp
RE: Get images from Liferay DL whose id is stored in separate database tabl
2013/05/07 7:12
答え

Vilmos Papp

LIFERAY STAFF

ランク: Liferay Master

投稿: 521

参加年月日: 2010/10/21

最近の投稿

If you have a 1:1 connection to User_ table, then you could use the user's portait which url is accessible like this:
1user.getPortraitURL();

If you have no this connection, than you have to deal with the document library entries like stated above, but if your employees has a login to the portal, that would be pretty straight forward to have them as users as well and they could edit their accounts and change their pictures.
Seeya S Kudtarker
RE: Get images from Liferay DL whose id is stored in separate database tabl
2013/05/07 7:30
答え

Seeya S Kudtarker

ランク: Regular Member

投稿: 187

参加年月日: 2013/01/15

最近の投稿

Hey Amit,

Thanks that works but 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
Seeya S Kudtarker
RE: Get images from Liferay DL whose id is stored in separate database tabl
2013/05/07 7:39
答え

Seeya S Kudtarker

ランク: Regular Member

投稿: 187

参加年月日: 2013/01/15

最近の投稿

Vilmos,
Thanks Vilmos for the reply.
In the application that I am developing, the images of employees are stored by the person who will be filling the details. The employees may/may not get to use them. Well thanks for this info I will have to think about this too. Thanks for the idea. emoticon Simple but it never occured.. emoticon

Regards

Seeya
Mohamed Faisal
RE: Get images from Liferay DL whose id is stored in separate database tabl
2013/06/26 0:27
答え

Mohamed Faisal

ランク: Junior Member

投稿: 71

参加年月日: 2009/08/11

最近の投稿

It is working fine. Thanks.

Regards,
Faisa;l