[opencms-dev] How do I figure out if a file was renamed on publish?

Christian Steinert christian_steinert at web.de
Sat May 12 19:52:17 CEST 2007


bessette schrieb:
> Is there a way that I can figure out if a file has been renamed from within
> the cms during the A_CmsModuleAction.publishProject method?  I'll have
> access to the CmsPublishList and the CmsResource objects.
>
> Thanks,
> Eric
>   
Dear Eric,

I am afraid that at this point it is probably too late.
All you have is a deleted file and a new file. I think these two are
siblings of each other (I'm about 75% sure, not totally certain) but
that would only be an indication that something *might* have moved. If
it really is this way, then you could check all deleted files, check if
they have a sibling that is new and then treat such cases as something
being moved. But please verify again, if old and new file are really
siblings of each other.
Even if it is like this, you would not notice files that have been moved
before having ever been published. For these you'll only see a new file
at the new location.

If you really want to be certain, then probably the only thing you can
do is to write a handler that listens to cms events and that notices
moves when they are being performed.The problem is, of course, that you
would then have to store this information, if you need it again only
later at publish time.


hth
Regards

christian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3269 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20070512/b3d4b32d/attachment.bin>


More information about the opencms-dev mailing list