Foren
Get Folder Id with Folder Name
Guru k, geändert vor 12 Jahren.
Get Folder Id with Folder Name
Junior Member Beiträge: 64 Beitrittsdatum: 08.02.12 Neueste Beiträge
Hi,
How to get the Folder id of the folders in the document library with the folder name in document library hook.
Thanks
Guru
How to get the Folder id of the folders in the document library with the folder name in document library hook.
Thanks
Guru
Natalie D, geändert vor 12 Jahren.
RE: Get Folder Id with Folder Name
Junior Member Beiträge: 55 Beitrittsdatum: 06.02.12 Neueste BeiträgeGuru k:
Hi,
How to get the Folder id of the folders in the document library with the folder name in document library hook.
Thanks
Guru
It isn't that hard with DL API, but of course you have to know in which folder you want to search - because many folders inside different locations can have the same name.
Alternatively you can search recursively, starting from root folder
Long parentFolderId = DLFolderConstants.DEFAULT_PARENT_FOLDER_ID;
DLFolder dir = DLFolderLocalServiceUtil.getFolder(groupId, parentFolderId, dirName);
Guru k, geändert vor 12 Jahren.
RE: Get Folder Id with Folder Name
Junior Member Beiträge: 64 Beitrittsdatum: 08.02.12 Neueste Beiträge
Hi Natalie, Juhi
Thanks for your help... got the work done with
as i needing the folder id's of the current group doc lib ...
Thanks
Thanks for your help... got the work done with
Long parentFolderId = DLFolderConstants.DEFAULT_PARENT_FOLDER_ID;
DLFolder dir = DLFolderLocalServiceUtil.getFolder(groupId, parentFolderId, dirName);
as i needing the folder id's of the current group doc lib ...
Thanks
Juhi Kumari, geändert vor 12 Jahren.
RE: Get Folder Id with Folder Name
Expert Beiträge: 347 Beitrittsdatum: 12.12.11 Neueste Beiträge
Hi Guru,
Regards
Juhi
List<dlfolder> dlFolders = DLFolderLocalServiceUtil.getDLFolders(
0, DLFolderLocalServiceUtil.getDLFoldersCount());
for (DLFolder folder : dlFolders) {
System.out.println("Folder Id >> "+folder.getFolderId());
System.out.println("Folder Name >>"+folder.getName());
}</dlfolder>
Regards
Juhi