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: Liferay 7.2 - Getting pages deleted logs
Hello,
I was wondering if I can somehow get the logs in my custom portlet of the pages deleted. Lets suppose the User A creates a page, and then deletes it. Can I somehow get that deletion log on my custom portlet?
Thank you for your future answers!
I was wondering if I can somehow get the logs in my custom portlet of the pages deleted. Lets suppose the User A creates a page, and then deletes it. Can I somehow get that deletion log on my custom portlet?
Thank you for your future answers!
I am not sure if there is a better way, but I would implement a LayoutModelListener and store the actions like create/update/delete somewhere, e.g. using servicebuilder in my own "audit table". Then you can easily use the data in your own portlet.
https://portal.liferay.dev/docs/7-1/tutorials/-/knowledge_base/t/model-listeners
https://portal.liferay.dev/docs/7-1/tutorials/-/knowledge_base/t/model-listeners
Hello Christoph,
So the solution would be to create a new table on my database using servicebuilder and each time a page is deleted I would add an entry to this table. Later I could get the values of this table to check the pages deleted. Did I understand correctly?
Thank you for your answer!
So the solution would be to create a new table on my database using servicebuilder and each time a page is deleted I would add an entry to this table. Later I could get the values of this table to check the pages deleted. Did I understand correctly?
Thank you for your answer!
Yes. It is probably the easiest solution.
I tried to create a Service Builder using this tutorial but I am getting an error on some generated classes. I can solve most of them, but there is one that I can't solve for nothing. The IDE cannot resolve "import com.liferay.portal.aop.AopService;". Probably its a depency left, but I can't seem to find which one.
PS: I have already posted this here, but until now I didn't find a solution.
EDIT: OK! I found what dependency I needed. I added compileOnly group: "com.liferay", name: "com.liferay.portal.aop.api" and it started working.
PS: I have already posted this here, but until now I didn't find a solution.
EDIT: OK! I found what dependency I needed. I added compileOnly group: "com.liferay", name: "com.liferay.portal.aop.api" and it started working.
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™