I have a deployer extension written in java in which I have customised logic for generating some PDF files based on condition check during publishing of component using DCP. We have named the PDF files based on field added in custom meta data.
And while unpublishing component using DCP, I need to delete the PDF files from the corresponding location.
For this I need to access the custom meta data of components as PDF files are named based on one of the fields in custom meta data. So, I want to know what are the possible ways in which I can access the custom meta data of component.
I have tried querying broker database for getting custom meta data but it seems like I am unable to access custom meta data of the component which is getting unpublished by directly querying broker database. I need to know if this approach would actually work or not and if this approach won't work then what is the right approach for this requirement.
In this case what's weird is that when I query the database manually and check, I am able to fetch the corresponding record but when I execute same query from my code, I am not able to access that record although there is no issue with my database connection or query. What may be the reason for this?