Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Unable to delete folder which created using DLFolderLocalServiceUtil
LR 7.2.0) A folder created pragmatically using "DLFolderLocalServiceUtil", using addFolder() method and it creates the folder inside the Documents and Mediasection in liferay portal. But when I try to delete that folder from Documents and media section or move it to recycle-bin, Liferay gives error message on site which is attached here and no logs in server. Unable to find the error. If anyone know about it guide me in it.
Attachments:
Hi ,
Try using this DLAppLocalServiceUtil.addFolder(userId, repositoryId, parentFolderId, name, description, serviceContext) for creating folder
Try using this DLAppLocalServiceUtil.addFolder(userId, repositoryId, parentFolderId, name, description, serviceContext) for creating folder
Hey, I create folder using DLAppLocalServiceUtil.addFolder(userId, repositoryId, parentFolderId, name, description, serviceContext) and folder created successfully in documents and media section but unable to delete it from portal where we show all folders and documents for site.
Hi,
Please share error log when you delete the folder from portal.
Please share error log when you delete the folder from portal.
There is no error log or didn't found any error in browser console. In portal it just result message Failed to execute the request. Which I attached screenshot here.
Attachments:
1) Read the folder and manually created folders using the API and compare them. Maybe you see differences.
2) Check the permissions. Maybe there is something wrong there.
3) Set the loglevel to debug/trace for the whole com.liferay.document.library.kernel.service package.
4) Can you delete it through the API?
2) Check the permissions. Maybe there is something wrong there.
3) Set the loglevel to debug/trace for the whole com.liferay.document.library.kernel.service package.
4) Can you delete it through the API?
I created folders both ways using API and from portal.
User has permission to delete folder which one is created by API.
No logs in server or browser console.
Yes I can delete those folders using API.But not able to delete that folder from portal.
User has permission to delete folder which one is created by API.
No logs in server or browser console.
Yes I can delete those folders using API.But not able to delete that folder from portal.
Hi.
It has been a long time since you wrote the question, but today I have just fixed it. I am working with Liferay 7.3.
When you create a folder, file... in Liferay portal, an assetEntry is generated too. So, if you create a folder or a document, you need to generate this assetEntry.
In this case, after the addFolder line, you need to add another code line with this functionality:
folder = dLFolderLocalService.addFolder(userId, groupId, ...);
assetEntryLocalService.updateEntry(userId, groupId, folder.getCreateDate(), folder.getModifiedDate(), DLFolder.class.getName(), ...);
I hope it helps you for the future :)
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™