i am looking to develop a functionality that lists new content available to users. It would provide a list of last contents published with a link and, if possible, a brief description.
Using PageVersionApproveListener, I managed to retrieve the currently approved version of the page, the previously approved version of the same page and i am able to detect new Blocks based on isOriginal and getBlockRelationID.
It does not handle scheduled publication.
Adding a new page works fine. Adding blocks to that page works fine.
But it does not seem to work at all when, for instance in provided test site, adding a new ressource : it creates a new block with a different RelationId (although it is an update of an existing block) that appears as a creation to my code.
thanks for your answer.
I’m trying indeed to capture exclusively new content. To make it more clear :
creating a new blog entry, i identify a new Block : it is original and its BlockRelationID is not present in previously approved version
Updating this same block creates a new Block but its BlockRelationID is present in previously approved version. I discard it, this a modification.
But when i update attributes (eg : description) of the Block (in designer page) : a new Block is created with a new BlockRelationID.
In the situation you’re describing, the event on_block_duplicate is triggered.
Through this event you get both the old and new block. And through the block you can get the page or pages it is on.