I have a scenario like component must be unpublished when the expiration date meet. am using core service to do that.
Suppose when a component published with template A & B, When I tried to un-publish the component by core service its un-publishing only last published .Means it’s un-publishing only the component with Template B. I want to un-publish completely with all templates it got published. Is there any way using core service?
sample code used:
ComponentData cData = csClient.Read("idhere", new ReadOptions()) as ComponentData;
PublishInfoData[] pubdatas = csClient.GetListPublishInfo(cData.Id);
List<string> targets=new List<string>();
UnPublishInstructionData unpubInstruction = new UnPublishInstructionData()
{
ResolveInstruction = new ResolveInstructionData()
{
IncludeChildPublications = false,
Purpose = ResolvePurpose.UnPublish,
},
RollbackOnFailure = true
};
foreach (PublishInfoData pdi in pubdatas)
{
targets.Add(pdi.PublicationTarget.IdRef);
string repo= pdi.Repository.IdRef;
}
csClient.UnPublish(new string[] { cData.Id }, unpubInstruction, targets.ToArray(), PublishPriority.Normal, new ReadOptions());
with addition to that FYI we are using deployer extension. i have found only one argument in instruction.XML when doing un-publish in the transport package
Action
Undeploy
ActionArguments
ComponentPresentation ComponentId="cmpidhere" TemplateId="tempidhere"
Arguments
is this expected behavior ? my thought is it should have two with different template id. am i correct ?. if so is there any way i can correct this ?.