I am writing a C# TBB for CT. i need to check all images in a folder and publish them. Do we have any method to check published path of a particular binary. I don't want to republish the binaries untill its not changed.
if (Component.Schema.Title.Equals("Album"))
{
string k = Component.OrganizationalItem.Id;
OrganizationalItem folder = engine.GetObject(k) as OrganizationalItem;
IList<Component> list = folder.Components(true);
foreach (Component comp in list)
{
if (comp.Schema.Title.Equals("multimedia image schema") )
{
Filter f = new Filter();
//f.Conditions["ItemType"] = ItemType.Component;
f.Conditions["ItemType"] = ItemType.MultimediaType;
xml.WriteStartElement("image");
xml.WriteAttributeString("id", comp.Id);
// need to check if binaries are published and what its published path
xml.WriteAttributeString("src", PublishBinary(comp));
xml.WriteEndElement();//image
}
}
}
I am publishing an xml containing all information of those multimedia types like alt text, src, date, country etc.