I have a list of component tcm ids, and a list of target tcm ids but I don't know which component will publish with which target. How can I calculate the mapping?
This is my code to check which Component I have to publish in which target
public static void PublishComponents(SessionAwareCoreServiceClient client,string[] listofComponentsTCM)
{
List<KeyValuePair<string, string>> listodtargets = getAlltargetTCM(client);
try
{
string[] Components = new string[] { "tcm:71-16393" };
var targets = new string[] { "tcm:0-1023-65537" };
PublishInstructionData instruction = GetPublishInstructionData(arguments);
client.Publish(Components, instruction, targets, arguments.Priority, null);
var data = client.GetListPublishInfo("tcm:71-16393");
}
catch (Exception ex)
{
throw ex;
}
finally
{
}
}
I am using SDL Tridion 2013 with CM DLL