Sitecore 如何为克隆提供电子邮件通知/工作流

Sitecore 如何为克隆提供电子邮件通知/工作流,sitecore,sitecore6,Sitecore,Sitecore6,我们希望建立一个系统,克隆管理员在更新克隆源项目时收到电子邮件通知。从该项目将创建多个克隆,理想情况下,我们希望按语言过滤通知(因此英语克隆的管理员在更新法语版本时不会收到通知) 有没有一种简单的方法可以在工作流中实现这些功能?如果是这样,我甚至应该尝试将工作流操作挂接到哪一个 我是否需要扩展或覆盖管道来执行此操作 交叉发送到SDN 编辑:更多信息: 如果克隆未覆盖原始项目中的字段,则在编辑原始项目字段时,客户端中没有通知。更改被直接复制-至少在主数据库中。但是-克隆仍需要发布到web数据库,

我们希望建立一个系统,克隆管理员在更新克隆源项目时收到电子邮件通知。从该项目将创建多个克隆,理想情况下,我们希望按语言过滤通知(因此英语克隆的管理员在更新法语版本时不会收到通知)

有没有一种简单的方法可以在工作流中实现这些功能?如果是这样,我甚至应该尝试将工作流操作挂接到哪一个

我是否需要扩展或覆盖管道来执行此操作

交叉发送到SDN

编辑:更多信息:

如果克隆未覆盖原始项目中的字段,则在编辑原始项目字段时,客户端中没有通知。更改被直接复制-至少在主数据库中。但是-克隆仍需要发布到web数据库,此更改才能在线生效。所以我有点卡住了-我的用户需要执行一个操作(发布克隆),但不知道


我真的希望能够以某种方式连接到通知事件。

回答我自己的问题 这里的代码由SDN上的各种海报提供:

如果有人想发布一个答案,那么我会很高兴地在应该的地方给予表扬和推荐

首先: John West指出,有两种有趣的方法,尽管是私有的:

private static IEnumerable<Item> GetClonesOfVersion(Item source)
{
    Assert.ArgumentNotNull(source, "source");
    return (from clone in GetAllClones(source)
        where clone.SourceUri == source.Uri
        select clone);
}

private static IEnumerable<Item> GetAllClones(Item source)
{
    Assert.ArgumentNotNull(source, "source");
    return (from link in Globals.LinkDatabase.GetReferrers(source)
        select link.GetSourceItem() into clone
        where ((clone != null) && (clone.Source != null)) && (clone.Source.ID == source.ID)
        select clone);
}
下面是一些关于自定义工作流和调用操作的一般性阅读:


感谢所有提供的输入

问得好,詹姆斯!我想有关克隆的文档可以通过以下章节的提问来增强!:)谢谢,我当然希望如此!工作流参考被标记为6.0-6.4,但根本没有提到克隆!我还在琢磨如何处理克隆部分的内部链接。。。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sitecore.Data;
using Sitecore.Data.Items;
using Sitecore.Data.Clones;
using Sitecore.Diagnostics;
using Sitecore.SecurityModel;
using Sitecore;
using Sitecore.Links;

namespace WorkFlowCustom
{
public class ForceCloneAccept
{
public void Process(Sitecore.Workflows.Simple.WorkflowPipelineArgs args)
{
Item workFlowItem = args.DataItem;
List itemList = GetItemClones(workFlowItem, true);

foreach (Item cloneItem in itemList)
{
List list = new List(workFlowItem.Database.NotificationProvider.GetNotifications(cloneItem));
foreach (Notification n in list)
{
if ((n != null) && (workFlowItem != null))
{
n.Accept(cloneItem);
}
}
}
}

protected virtual List GetItemClones(Item item, bool processChildren)
{
Assert.ArgumentNotNull(item, "item");
List list = new List();

using (new SecurityDisabler())
{
foreach (ItemLink link in Globals.LinkDatabase.GetReferrers(item))

{
if (!(link.SourceFieldID != FieldIDs.Source))
{
Item sourceItem = link.GetSourceItem();
if (sourceItem != null)
{
list.Add(sourceItem);
}
}
}
}
if (processChildren)
{
foreach (Item item4 in item.Children)
{
list.AddRange(this.GetItemClones(item4, true));
}

}
return list;
}

}
}