【问题标题】:Tridion : How can I find out if a page has been published to a particular publication target using the business connector?Tridion:如何使用业务连接器确定页面是否已发布到特定发布目标?
【发布时间】:2012-03-12 18:08:30
【问题描述】:

我正在使用 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,我得到的唯一信息是页面是否已发布,而不是发布到哪些目标。

我已尝试查询发布目标本身,但这没有提供关于它发布了哪些页面的信息。

有什么想法吗?

【问题讨论】:

    标签: c# tridion


    【解决方案1】:

    这里是我要做的快速检查。

    1. 将 CMS 设置为调试模式。
    2. 打开相关页面
    3. 一定要显示在 GUI 中使用的位置。
    4. 切换到“发布到”选项卡 5) 在第 4 步之后不要点击任何东西,而是点击调试窗口图标。获取您在此处看到的 BC XML 请求并更新页面 ID 等参数,然后使用 BC 为您的页面发出请求。

    上面应该可以工作。

    【讨论】:

    • 如何“将 CMS 设置为调试模式”?
    【解决方案2】:

    您应该设置 XMLReadPublishInfoXMLReadPublishInfoDetails 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>
    

    【讨论】:

    • 这就是我需要的答案。谢谢!
    • 我目前遇到 Tridion 的另一个问题,这使我无法提供完整的代码示例。待我修好后会发布。
    猜你喜欢
    • 2012-04-04
    • 2012-02-09
    • 1970-01-01
    • 2012-08-17
    • 2012-06-11
    • 2012-09-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多