I'm trying to capture when a component is unpublished. I try some approaches but I don't have the result that I want. My attempts are:
In Event System. But this not works because there are a known bug in Windows about MSXML and COM+.
I try to build my own IResolver but there I cannot determine if it's a publishing or unpublishing action.
I try to build my own ITransportPackageHandler. There, I have a function called HandleResolvedItemForUnPublishing but I don't have any information about PublicationTarget and I don't know if it's unpublished from staging or live.
Can someone help me? I think that I can solve the problem if:
- At the IResolver I can determine if the component is unpublishing.
- At the ITransportPackageHandler I can access to the PublicationTarget info
- If I can pass info from IResolver to the ITransportPackageHandler in a context variable or something similar.
thank you very much.
Gustavo.
You should be able to look at the
ResolvePurposeof theResolveInstructionthat you get as one of the parameters in the custom resolver. Something along these lines:EDIT
I refused to not find a way to make this work...
Indeed, in Tridion 2009 you don't have a
Purposeon the resolve instruction. You do have anActionin the Publish Transaction, but this one is not exposed directly in the resolver. Here's how I found out if I'm publishing or unpublishing - your call if think it's overkill, but performance on my non-production VM was pretty good.Actionattribute