[OJS] Dev Question: How to archive galleys

[OJS 2.4]
Hi,
I am writing a plugin, which updates PDF Galleys. After generating the new PDF I do the following:

        $galleyDao =& DAORegistry::getDAO('ArticleGalleyDAO');
        $galley = new ArticleGalley();
        $galley->setLabel('PDF');
        $galley->setArticleId($articleId);        
        $galley->setLocale($oldGalley->getLocale());        
        import('classes.file.ArticleFileManager');
        $articleFileManager = new ArticleFileManager(articleId);
        $fileId = $articleFileManager->copyPublicFile($newFile, 'application/pdf');
        $galley->setFileId($fileId);
        $galleyDao->insertGalley($galley);
        $galleyDao->deleteGalley($oldGalley);

It works like a charm - except for one thing: The old Galleys are removed now (not the files, but the entries in the DB). In fact I would like to archive them non-public, so that the Admin could revert the process if desired. I see that if I would use $galleyDao->updateGalley it would happen pretty much the same. So is there a mechanic I overlooked, which I could use to store the old galley somehow in the history or something like that?

Thank you in advance and thank you so much for all the previous support by the way!

Hi @paf,

Could you describe what feature you’re working to add? It’s possible that I could recommend a different approach but some context might help.

Regards,
Alec Smecher
Public Knowledge Project Team

I generate new front matters for the PDFs by script and replace the old ones by the new ones.
Best Regards

Hi @paf,

Have you considered just updating the file, and leaving the galley object as it is?

Regards,
Alec Smecher
Public Knowledge Project Team

Yes, but I want to obtain a new URN, so a need a new Galley and Galley-ID.

Hi @paf,

Would you want old galleys to be accessible in any way, e.g. via the OAI interface etc? What about galleys that were previously deposited e.g. to CrossRef or picked up by Google Scholar, which were then removed?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi Alec,
we decided no to delete the old galleys, and not preserve them, so the question is obsolete. But thank you anyway!