是否可以在 SDL Tridion 2011 中使用 Tom.net API 发布页面?
问问题
580 次
2 回答
2
正如 Nuno 提到PublishEngine.Publish
的,使用并参考语法和示例
句法:
PublishEngine.Publish(
new IdentifiableObject[] { linkedComponent },
engine.PublishingContext.PublishInstruction,
new List() { engine.PublishingContext.PublicationTarget });
做这样的事情: -
private void Publish(IdentifiableObject item, PublicationTarget publicationTarget, bool rollBackOnFailure, bool includeComponentLinks)
{
IEnumerable<IdentifiableObject> items = new List<IdentifiableObject>() { item };
IEnumerable<PublicationTarget> targets = new List<PublicationTarget>() { publicationTarget };
PublishInstruction instruction = new PublishInstruction(item.Session)
{
DeployAt = DateTime.Now,
RenderInstruction = new RenderInstruction(item.Session)
{
RenderMode = RenderMode.Publish
},
ResolveInstruction = new ResolveInstruction(item.Session)
{
IncludeComponentLinks = includeComponentLinks
},
RollbackOnFailure = rollBackOnFailure,
StartAt = DateTime.MinValue
};
PublishEngine.Publish(items, instruction, targets);
}
**内容从如何以编程方式发布东西博客复制
于 2012-12-04T15:35:52.447 回答
1
使用PublishEngine.Publish
,从那里跟随 Intellisense。您需要提供渲染和解决说明,以及目标、开始日期/时间等常用详细信息。
文档有示例,各种博客都有示例,Visual Studio 应该可以帮助您找到所需的内容。
于 2012-12-04T14:26:49.333 回答