[英]Tridion 2009 TBB: How do I determine if a Page is published to particular publication target?
[英]Tridion : How can I find out if a page has been published to a particular publication target using the business connector?
我正在使用Tridion 5.3版。
使用業務連接器我想知道頁面是否已發布到特定的發布目標。
使用TOM API我可以做到
// using types from Tridion.ContentManager.Interop.TDS
// and Tridion.ContentManager.Interop.TDSDefines
TDSE tdse = new TDSE();
Page page = (Page)tdse.GetObject(itemUri, EnumOpenMode.OpenModeView,
"tcm:0-0-0", XMLReadFilter.XMLReadAll);
page.IsPublishedTo(tcm);
如果我使用業務連接器查詢Tridion,我得到的唯一信息是頁面是否已發布,而不是哪些目標。
我已經嘗試查詢發布目標本身,但是這不會提供有關它已發布的頁面的信息。
有任何想法嗎?
您應該設置XMLReadPublishInfo和XMLReadPublishInfoDetails ItemFilters:
<tcmapi:Message xmlns:tcmapi="http://www.tridion.com/ContentManager/5.0/TCMAPI"
version="5.0" from="[MDVC.js][CmdsExecute]" failOnError="false">
<tcmapi:Request ID="tcm:1010-8314-64" preserve="true">
<tcmapi:GetItem itemURI="tcm:1010-8314-64" openMode="OpenModeView">
<tcmapi:ItemFilter type="XMLReadPublishInfo" />
<tcmapi:ItemFilter type="XMLReadPublishInfoDetails" />
</tcmapi:GetItem>
</tcmapi:Request>
這將返回所有發布信息,從那里你必須自己過濾它。 這是回復示例:
<tcmapi:Message xmlns:tcmapi="http://www.tridion.com/ContentManager/5.0/TCMAPI"
version="5.0" from="[MDVC.js][CmdsExecute]" failOnError="false">
<tcmapi:Response ID="tcm:1010-8314-64" success="true" actionWF="false">
<tcmapi:Request ID="tcm:1010-8314-64" preserve="true">
<tcmapi:GetItem itemURI="tcm:1010-8314-64" openMode="OpenModeView">
<tcmapi:ItemFilter type="XMLReadPublishInfo" />
<tcmapi:ItemFilter type="XMLReadPublishInfoDetails" />
</tcmapi:GetItem>
</tcmapi:Request>
<tcmapi:Result>
<tcm:Page ID="tcm:1010-8314-64" IsEditable="false"
xmlns:tcm="http://www.tridion.com/ContentManager/5.0"
xmlns:xlink="http://www.w3.org/1999/xlink">
<tcm:Info>
<tcm:PublishInfo>
<tcm:IsPublished>true</tcm:IsPublished>
<tcm:PublishState>
<tcm:Publication xlink:type="simple" xlink:title="Web: "
xlink:href="tcm:0-1010-1" />
<tcm:PublicationTarget xlink:type="simple" xlink:title="A"
xlink:href="tcm:0-143-65537" />
<tcm:Date>2006-01-30T11:22:58</tcm:Date>
<tcm:Publisher xlink:type="simple" xlink:title="NA\A085159"
xlink:href="tcm:0-220-65552" />
</tcm:PublishState>
</tcm:PublishInfo>
</tcm:Info>
</tcm:Page>
</tcmapi:Result>
</tcmapi:Response>
快速檢查這里是我會做的。
以上應該工作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.