3.1 使用策略

Identity Manager Driver for GroupWise 通过一系列策略同步 eDirectory 中的数据和事件。 当文档穿过某一通道时,策略将帮助 Identity Manager 做出决定。 策略可以决定文档在到达目标之前是否需要以某种方式进行转换。 例如,如果创建策略指定用户对象必须有一个 CN 特性值,那么此策略就不允许创建没有 CN 值的用户对象。

公司业务规则可能有多种解决方案,本节提供了一些策略作为示例。 这里的代码段仅显示简单的部分的解决方案,并不包括所有情形和条件。 此外,这些代码段仅处理相关的特性,不处理其它特性。

3.1.1 默认的驱动程序操作

默认情况下,驱动程序执行多种操作:

  • 创建 GroupWise 帐户时,将用户的 eDirectory 常用名 (CN) 用作 GroupWise 邮箱 ID。
  • 驱动程序配置使用单一邮局。 所有帐户都在单一邮局中创建。

3.1.2 修改策略和过滤器中的默认设置

导入驱动程序配置时,已设置了策略和过滤器的默认值。 如果要更改驱动程序的默认行为,建议按以下顺序进行修改:

  1. 修改驱动程序过滤器,将要同步的其它特性包括在内。有关更多信息,请参见修改驱动程序过滤器
  2. 修改纲要映射策略,将要同步的所有特性包括在内。有关更多信息,请参见向纲要映射策略添加项
  3. 修改订购者创建策略。有关更多信息,请参见修改创建策略
  4. 修改订购者布局策略。请参见修改策略

修改驱动程序过滤器

驱动程序过滤器中包含用于发布者通道和订购者通道的 eDirectory 类和特性。 此过滤器的目的是定义如何在系统间共享特性。 由于处理时需要驱动程序过滤器中的所有特性,因此不应从过滤器中去除特性。

但可以向过滤器中添加内容。 如果向过滤器中添加类或特性,应向映射策略中已添加的特性中追加《merge-authority》字符串。

例如:

<filter-attr attr-name="Description" merge-authority="edir" publisher="ignore" subscriber="sync"/>

向纲要映射策略添加项

纲要映射策略包含在驱动程序对象中,适用于订购者通道和发布者通道。 纲要映射策略的目的是在 eDirectory 名称空间和 GroupWise 名称空间之间映射纲要名称(特别是特性名称和类名称)。 不要修改或去除纲要映射策略中的现有项。 但可以向纲要映射策略中添加项。

修改创建策略

修改创建策略可以实施特定的业务规则。 创建策略用于确定是否创建 GroupWise 帐户。 创建策略还能够对 Add 事件进行其它修改,例如,提供特性的默认值。

在驱动程序配置中,创建策略指定两个必需特性: CN 和姓氏。

此策略由将起始口令设置为姓氏和 CN 的的全局配置值 (GCV) 控制。有关全局配置值的更多信息,请参考Section 3.1.3, 理解全局配置值

修改匹配策略

匹配策略定义要认定为相同,两个对象所必须满足的最低准则。 建议不要更改默认的匹配策略。

3.1.3 理解全局配置值

全局配置值 (GCV) 是与驱动程序参数类似的新设置。 可以为驱动程序集和单个驱动程序指定全局配置值。 如果某个驱动程序没有全局配置值,此驱动程序就会继承其驱动程序集的全局配置值。 使用全局配置值可以为 Identity Manager 的新功能(例如口令同步和驱动程序心跳)指定设置,还可以指定 GroupWise 驱动程序的特有设置。 有关更多信息,请参考《Novell Identity Manager 3.0 管理指南》中的《使用全局配置值》。

3.1.4 修改策略

可以修改现有的驱动程序策略,以执行附加功能。

指定 GroupWise 邮局

默认情况下,GroupWise 订购者布局策略将所有的新用户置于同一个邮局中。 布局策略也可以根据特性值或 eDirectory 用户树枝确定邮局。

下面的示例在策略构建器中创建,根据创建用户的 eDirectory 树枝指定邮局。

Figure 3-1 根据 eDirectory 树枝指定邮局的布局策略

下图显示了将 Sales 树枝中的用户置于 PO1 中以及将 Engineering 树枝中的用户置于 PO2 中所需的策略。

Figure 3-2 将用户置于不同树枝中的布局策略

指定分发列表

组织使用分发列表可确保在不同的内部通讯中包括适当的人员。只要有可能,组织都应自动将新员工指派到这些分发列表,这样新员工就可以立即参与到与他们相关的通讯中。

创建 eDirectory 用户后,使用订购者创建策略就可以根据 eDirectory 树枝将 GroupWise 帐户添加到分发列表中。 在 Sales 树枝中创建用户后,该用户将被添加到 Sales 分发列表中。 在 Engineering 树枝中创建用户后,该用户将被添加到 Engineering 分发列表中。

本节中的策略通过使用策略构建器创建,说明如何配置以下操作:

可以利用这些示例,使用策略构建器针对具体的业务规则和环境创建类似的策略和分发列表。

根据用户的 eDirectory 树枝,新建用户作为分发列表的成员

Figure 3-3 创建策略

将用户作为密送或抄送参与者添加到分发列表中

用户作为主收件人、密送成员或抄送成员加入分发列表。 可以使用 XML 特性 gw:participation=“bc” 和 gw:participation=“cc” 设置用户在分发列表中具有的成员资格类型。 如果未指定这些特性,则默认为主收件人。

<modify-attr attr-name="Distribution List DN" xmlns:gw="http://www.novel.com/dirxml/gwdriver" gw:participation="bc"> <add-value> <value type="string">\IDMTREE\Novell\Users\cDL1</value> <value type="string">\IDMTREE\Novell\Users\cG1</value> </add-value> </modify-attr>

或者

<add-attr attr-name="Distribution List DN xmlns:gw="http://www.novell.com/dirxml/gwdriver" gw:participation="bc"> <value type="string">\IDMTREE\Novell\Users\cDL1</value> <value type="string">\IDMTREE\Novell\Users\cG1</value> </add -attr>

要将用户作为抄送成员添加,请将 gw:participation=”bc” 特性替换为 gw:participation=“cc”。

用户成为经理后,将其添加到分发列表中

Figure 3-4 将用户添加到分发列表中

用户不再是经理时,将其从分发列表中去除

Figure 3-5 将用户从分发列表中去除

将用户从所有分发列表中去除

Figure 3-6 将用户从所有分发列表中去除

从分发列表中去除用户后,驱动程序会清理关联的组对象的 Member(成员)特性。

设置 GroupWise 特性的默认值

使用创建策略可以在 GroupWise 帐户中设置其它特性。 某些特性必须在 eDirectory 和 GroupWise 中均进行设置。 如果 eDirectory 用户对象包含相应的特性,也必须对其进行设置。 在 eDirectory 和 GroupWise 中均设置特性值是非常重要的。 如果仅在 GroupWise 中设置特性,它可能会被 eDirectory 中的值覆盖。 必须自定义驱动程序以更新 eDirectory 中的值;默认情况下,驱动程序不会执行该操作。

下例说明如何在 eDirectory 和 GroupWise 中设置 Description(说明)特性(另一个常用特性是 Visibility(可见性))。 特性 write-back = “true” 使该特性也会被写入 eDirectory。

<?xml version="1.0" encoding="UTF-8"?> <create-rules> <create-rule class-name="User" description="GroupWise Account Required Attributes"> <!-- Description attribute is given a default value in both eDirectory and in GroupWise --> <required-attr attr-name="Description" write-back="true"> <value type="String"><![CDATA[eDirectory User synchronized by GroupWise Driver]]></value> </required-attr> </create-rule> </create-rules>

配置 GroupWise 用户 ID

eDirectory 中的 CN 特性用于命名 GroupWise 帐户。 必须将此特性作为必需特性包括在创建策略中。 在订购者创建策略中可以忽略 eDirectory 的 CN 值,并可生成基于其它特性的 CN。 创建策略中的示例代码段如下所示。 如果对此策略进行修改,也需要修改来自引擎的修改事件。

用于构造 CN 的特性被修改后,会通过这些策略生成 GroupWise Rename 事件。 用户 ID 在邮局中必须是唯一的。 如果使用用户 ID 生成因特网电子邮件地址,则它在整个 GroupWise 系统中必须是唯一的。 用户 ID 可包含 1 到 256 个字符,但不能包含以下字符: ( ) @ . : , { } * "。用户 ID 在它的名称空间中必须是唯一的(用户 ID 与绰号、资源和分发列表共享相同的名称空间)。 不要对此值使用《mapi》(保留 ID)。

输出转换策略或事件转换策略可以监视用于构建 CN 的特性。 如果更改了其中某个特性,也应该生成 Rename 事件。 此处使用的任何特性都需要添加到所需特性列表中。 在这种情况下,Rename 事件仍应被转发至驱动程序,但 <newname> 要素为空。有关更多信息,请参见重命名用户

<!--CN is used to set the GroupWise UserID. Construct a new CN from Given Name. --><xsl:template match="add-attr[@attr-name = ’CN’]"> <!-- ignore the current CN and create a new one --> <add-attr attr-name="CN"> <value type="string"> <xsl:value-of select="../add-attr[@attr-name=’Given Name’]/value"/> </value> </add-attr> </xsl:template>

创建附加特性的映射

可以将在 eDirectory 中能够表示为字符串的任意特性与二十个 GroupWise 通用特性(不包括八位组字节字符串和结构特性)中的某一特性同步。 在过滤器中指定希望要映射的 eDirectory 特性。 此外,还必须在纲要映射策略中连接 eDirectory 特性名称和 GroupWise 特性名称。

以下纲要映射规则代码段连接 eDirectory 特性 Location(位置)和 GroupWise 特性 55003。

<attr-name class-name="User"> <nds-name>Location</nds-name> <app-name>55003</app-name> </attr-name>

二十个 GroupWise 特性名称是从 50106 到 50115 以及从 55002 到 55011。通过 GroupWise 咬接模块可以给这些 GroupWise 特性指派通讯录标签。 GroupWise 中的映射配置应与驱动程序映射中的配置相同。

通过查询获取记录计数

以下发送给驱动程序的查询将返回 dom1.po1 中的用户数。

<nds dtdversion="1.1" ndsversion="8.6"> <input> <query event-id="query-groupwise" scope="subtree"> <search-class class-name="User"/>

                 		<!-- Referenced Domain Name --> <search-attr attr-name="50035"> <value>dom1</value> </search-attr>

                 		<!-- Referenced Post Office Name --> <search-attr attr-name="50062"> <value>po1</value> <search-attr>

                 		<!-- return Record Count--> <read-attr attr-name="Record Count"/> </query> </input> </nds>

如果去除邮局搜索特性,则返回 dom1 中的用户数。 如果去除域搜索特性,则返回系统中的用户数。 可以改变此搜索以应用其它搜索准则。

删除 GroupWise 用户而不删除 eDirectory 用户

在 GroupWise 中删除用户后,驱动程序将清理 eDirectory 中的 GroupWise 特性。 其结果与使用 GroupWise 咬接模块删除用户和在 GroupWise 中仅选择《删除》的结果相同。

需要更改匹配准则以符合特定环境的要求。

<!-- delete the GroupWise user and clean up eDirectory when the eDirectory user has not been deleted --> <xsl:template match="modify[@class-name=’User’ and modify-attr[@attr-name=’50000’]]"> <delete xmlns:gw="http://www.novell.com/dirxml/gwdriver" gw:original-event="modify"> <!-- copy event attributes and association --> <xsl:apply-templates select="@*|association"/> </delete> </xsl:template>

创建 GroupWise 绰号

重命名 eDirectory 用户或移动 GroupWise 帐户时,可以自动创建 GroupWise 绰号。 这是通过驱动程序中的 iManager 的《全局配置值》页进行控制的。 若将此选项设置为 True,重命名 eDirectory 或移动 GroupWise 帐户时,将自动创建 GroupWise 绰号。 若将此选项设置为 False,则不会创建绰号。 创建绰号需要运行 GroupWise 6.5 SP1 或更高版本的代理。可以向输出转换策略中添加代码来覆盖此选项,以指定是否应该创建绰号。

<!--Override the "Create Nicknames" Driver Option--> <xsl:template match="rename"> <xsl:copy> <!-- Create a GroupWise nickname. --> <xsl:attribute xmlns:gw="http://www.novell.com/dirxml/gwdriver" name="gw:create-nickname">true</xsl:attribute> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template>

创建 GroupWise 绰号记录

以下示例说明了创建绰号记录的两种方式。 第一个示例在 <dest-dn> 特性(此特性指代域)中指定创建绰号的邮局。 第二个示例使用 <add-attr> 节点指定域和邮局。

绰号可包含 1 到 256 个字符,但不能包含以下字符: ()@.:,{}*"。绰号在它的名称空间中必须是唯一的(绰号与用户 ID、资源和分发列表共享相同的名称空间)。

                                <add class-name="GroupWise Nickname" dest-dn="Novell\dirxml\groupwise\xmlPO" event-id="0" > <!-- Domain of user this nickname refers to --> <add-attr attr-name="50068" > <value type="string">xmlDom</value> </add-attr> <!-- Post Office of user this nickname refers to  --> <add-attr attr-name="50069" > <value type="string">xmlPO</value> </add-attr> <!--  user this nickname refers to  --> <add-attr attr-name="50070" > <value type="string">Usern1</value> </add-attr>

      	<!-- name of nickname record --> <add-attr attr-name="50073" > <value type="string">nn1</value> </add-attr> </add>

OR

<add class-name="GroupWise Nickname" event-id="0" > <!-- Domain of user this nickname refers to --> <add-attr attr-name="50068" > <value type="string">xmlDom</value> </add-attr> <!-- Post Office of user this nickname refers to --> <add-attr attr-name="50069" > <value type="string">xmlPO</value> </add-attr> <!-- user this nickname refers to --> <add-attr attr-name="50070" > <value type="string">Usern1</value> </add-attr>

       	<!-- Domain of nickname record --> <add-attr attr-name="50035" > <value type="string">xmlDom</value> </add-attr> <!-- Post Office of nickname record --> <add-attr attr-name="50062" > <value type="string">xmlPO</value> </add-attr> <!-- name of nickname record --> <add-attr attr-name="50073" > <value type="string">nn1</value> </add-attr> </add>

删除资源拥有者时指定新的拥有者

如果删除资源(如会议室)的拥有者,驱动程序会自动将该资源指派给另一拥有者。 必须为所有资源的指派指定一个默认用户。 指派资源时,如果驱动程序没有检测到默认用户帐户,它将创建默认用户帐户并将资源指派给该用户。

可以通过策略指定覆盖拥有者。 使用输出转换策略,会选择删除 eDirectory 用户。 专用特性 gw:resource-owner-dn 用于向 Shim 通知覆盖资源的拥有者。 此专用特性通过 <delete> 要素指定。 删除用户时,资源将被重指派。 新拥有者必须已存在于 GroupWise 中,并与被删除的用户位于同一邮局中。 如果使用覆盖拥有者时发生故障,这些资源将被自动指派给驱动程序选项中指定的默认用户。 XSLT 代码段如下:

<!-- User Delete Reassigns GroupWise Resource On an eDirectory User delete specify the GroupWise Account to reassign the GW resources to. --> <xsl:template match="delete[@class-name=’User’]"> <!-- copy the delete through --> <xsl:copy> <!-- Specify the override resource owner on the <delete> --> <xsl:attribute xmlns:gw="http://www.novell.com/dirxml/gwdriver" name="gw:resource-owner-dn">\GWDRIVERTREE\novell\users\sales\ResourceOwner</xsl:attribute> <!-- copy the rest of the stuff through --> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template>

资源拥有者被禁用或失效时指定新的拥有者

如果资源(如会议室)的拥有者被禁用或失效,可以使用全局配置值将驱动程序配置为自动将该资源指派给另一用户(使用全局配置值)。 在此过程中,可以为所有资源的指派指定一个默认用户。 重指派资源时,如果驱动程序没有检测到默认用户帐户,它将创建默认用户帐户并将其指派为资源拥有者,条件是重指派资源所有权驱动程序全局配置值设置为 True

设置 eDirectory User Login Disabled(用户登录禁用)特性时,可以将禁用或失效帐户的 GroupWise 资源指派给另一 GroupWise 帐户。 通常情况下,新拥有者是默认资源拥有者用户 ID 参数中指定的默认用户。 可以通过样式表指定覆盖拥有者。 使用输出转换样式表,选择禁用 eDirectory 用户登录。 专用特性 gw:resource-owner-dn 用于向 Shim 通知覆盖资源的拥有者。 此专用特性通过 <modify-attr> 要素指定。

即使重指派资源所有权全局配置值设置为 False,这些资源也会被指派给覆盖拥有者。 新拥有者必须已存于 GroupWise 中,并与已失效的用户位于同一邮局中。 如果使用覆盖拥有者时发生故障,这些资源将自动指派给驱动程序选项中指定的默认用户。 禁用及使失效的 XSLT 代码段如下:

<!-- When a GroupWise Account is Disabled also specify the GroupWise Account to reassign the GW resources to.--> <xsl:template match="modify-attr[@attr-name=’50058’]"> <!-- When Login Disabled is true, reassign the resource --> <xsl:if test="add-value//value[.=’true’]"> <!-- copy the modify through --> <xsl:copy> <!-- Specify the override resource owner on the <modify-attr> --> <xsl:attribute xmlns:gw=http://www.novell.com/dirxml/gwdriver name="gw:resource-owner-dn">\GWDRIVERTREE\novell\users\sales\ResourceOwner</xsl:attribute> <!-- copy the rest of the stuff through --> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:if> </xsl:template>

<!-- User Expire to GroupWise Expire and Reassign GroupWise Resources When the eDirectory User Login Expiration Time attribute is modified, change the GroupWise Mailbox Expiration Time and specify the GroupWise Account to reassign the GroupWise resources to. --> <xsl:template match="modify-attr[@attr-name=’Login Expiration Time’]"> <!-- copy the modify through --> <xsl:copy> <!-- copy all attributes through except for the attr-name --> <!-- we’ll construct the GroupWise attr-name below --> <xsl:apply-templates select="@*[name(.) != ’attr-name’]"/> <!-- now create the attr-name attribute with the GroupWise name --> <xsl:attribute name="attr-name">50138</xsl:attribute> <!-- Specify the override resource owner on the <modify-attr> --> <xsl:attribute name="gw:resource-owner-dn" xmlns:gw="http://www.novell.com/dirxml gwdriver">\GWDRIVERTREE\novell\users\sales\ResourceOwner</xsl:attribute> <!-- copy the rest of the stuff through, except for what we have already copied--> <xsl:apply-templates select="* | comment() | processing-instruction() | text()"/> </xsl:copy> </xsl:template>

控制 GroupWise 帐户的创建

可能会存在这样的情况:你已经创建了 eDirectory 用户,但不希望创建相应的 GroupWise 帐户。 此外,并非所有 eDirectory 用户最初都拥有 GroupWise 帐户。 可以使用驱动程序控制 GroupWise 帐户的创建。

控制帐户创建的推荐方式是定义是否要创建 GroupWise 帐户;例如,可使用 createGroupWiseAccount 特性进行定义。

必须扩展 eDirectory 纲要以包括 createGroupWiseAccount 特性。 如果 createGroupWiseAccount 特性设置为 True,将创建 GroupWise 帐户。 如果 createGroupWiseAccount 特性设置为 False,则不会创建 GroupWise 帐户。 将值由 False 更改为 True,将创建 GroupWise 帐户。

createGroupWiseAccount 特性须作为必需特性添加到创建策略中,还需要添加到订购者过滤器中。

<!-- createGroupWiseAccount is used to control creation of the GroupWise Account --> <match-attr attr-name="createGroupWiseAccount"> <value><![CDATA[true]]></value> </match-attr>

将用户从一个邮局移至另一个邮局

如果未将样式表配置为移动 GroupWise 帐户,建议使用 GroupWise 7 咬接模块(或更高版本)来移动用户。

如果已将输出转换样式表配置为移动 GroupWise 帐户,建议在 eDirectory 中移动用户并由驱动程序将对象指派给 GroupWise 中的新邮局。 输出转换策略的 XSLT 代码段如下所示。 父要素的 dest-dn 特性用于指定新邮局。

<!--On an eDirectory User Move add the GroupWise Post Office DN based on the User’s new container--> <xsl:template match="move[@class-name=’User’]"> <!-- copy the Move through --> <xsl:copy> <!-- copy the attributes from the <move> element --> <xsl:apply-templates select="@*"/> <association> <xsl:value-of select="association"/>          </association> <parent> <xsl:attribute name="src-dn"> <xsl:value-of select="parent/@src-dn"/> </xsl:attribute> <!-- Specify the post office DN based on the container --> <xsl:choose> <xsl:when test="parent/@src-dn = ’\GWDRIVERTREE\Novell\Users\Sales’"> <xsl:attribute name="dest-dn"> \GWDRIVERTREE\Novell\GroupWise\Post Offices\Sales PO</xsl:attribute> </xsl:when> <xsl:when test="parent/@src-dn = ’\GWDRIVERTREE\Novell\Users\Engineering’"> <xsl:attribute name="dest-dn"> \GWDRIVERTREE\Novell\GroupWise\Post Offices\Engineering PO</xsl:attribute> </xsl:when> </xsl:choose> </parent> </xsl:copy> </xsl:template

添加要同步的附加特性

可以将多达二十个用户 eDirectory 特性映射到 GroupWise 通用特性,并将它们显示在通讯录中。 对于这些特性,应使用范围 50106-50115 和 55002-55011。必须先将这些 eDirectory 特性添加到过滤器中。 必须在 GroupWise 咬接模块中配置这些特性,才能让它们显示在 GroupWise 通讯录中。

重命名用户

建议通过如下方法重命名用户:在 eDirectory 中更改命名特性,然后由驱动程序来重命名 GroupWise 帐户。 如果 CN 是命名特性(默认设置),则重命名过程不需要任何特殊的样式表编码。 但是,GroupWise 邮箱 ID 则可以使用 CN 之外的特性构建。 修改其中一个特性后,也应该重命名 GroupWise 帐户。 XSLT 代码段如下所示。 在此例中,eDirectory 特性 Given Name(名)用于命名 GroupWise 帐户。 修改 Given Name 后,将生成 GroupWise 重命名。 在以下第二个模板中,<xsl:template match=”rename[@class-name=’User’]”> 用于处理 eDirectory 用户对象重命名的情况。 在这种情况下,<rename> 命令被传递给驱动程序,空的 <new-name/> 要素将阻止驱动程序重命名 GroupWise 帐户。 即便未重命名 GroupWise 帐户,Rename 事件也必须传递给驱动程序。

不建议使用 GroupWise 咬接模块进行重命名。 但是,如果使用 GroupWise 咬接模块重命名用户,则必须使用 GroupWise 6.5 SP1 或更高版本完成。 如果使用较低版本的 GroupWise 咬接模块,会导致驱动程序生成错误。

示例 1
<!-- When the attribute used to set CN changes, in this case Given Name, create   an element <new-name> to rename the GroupWise Account --> <xsl:template match="modify[@class-name=’User’]"> <!-- Given Name is used the for GroupWise CN, when it changes do a rename --> <xsl:if test="modify-attr[@attr-name=’50091’]"> <!-- Copy the <modify> through so all changes get made --> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> <!-- generate a <rename> --> <rename class-name="User"> <!-- copy the attributes from the <modify-attr> element to the <rename> element --> <xsl:apply-templates select="@*"/> <!-- The object was not renamed in eDir so use src-dn for src-dn and old-src-dn --> <xsl:attribute name="old-src-dn"> <xsl:value-of select="@src-dn"/> </xsl:attribute> <!-- copy the children from the <modify> element to the <rename> element --> <xsl:apply-templates select="node()"/> <new-name> <xsl:value-of select="modify-attr[@attr-name=’50091’]/add-value/value"/> </new-name> </rename> </xsl:if> </xsl:template>
示例 2
<!-- When the User object is renamed in eDirectory, the GroupWise account is not renamed since it is named by the Given Name attribute --> <xsl:template match="rename[@class-name=’User’]"> <!-- Copy the rename through except new-name --> <xsl:copy> <xsl:apply-templates select="@*|node()[name() != ’new-name’]"/> <!-- <new-name> does not change since the GW account is named by the Given Name attribute --> <new-name/> </xsl:copy> </xsl:template>

创建网关别名

以下 XSLT 代码段说明如何在输出转换策略中创建网关别名。 使用这些代码可生成特性 50140 和 50077 的值。

<xsl:template match="add[@class-name=’User’]"> <xsl:copy> <xsl:apply-templates select="@*"/> <add-attr attr-name="Gateway Alias"> <value type="structured"> <component name="50140"><![CDATA[SMTP]]></component> <component name="50077"><![CDATA[UserOne@novell.com]]> </component> </value> </add-attr> <xsl:apply-templates select="* | comment() | processing-instruction() | text()"/> </xsl:copy> </xsl:template>

查询绰号

以下输出转换策略说明如何查询 GroupWise 绰号。此样式表中的搜索特性均为可选项。 它们用于确定搜索范围。 指定邮局名称 (50069) 时,还必须指定域名 (50068)。 可以返回多个绰号。

例如,将 User2a 重命名为 User2b,然后再重命名为 User2c。 将出现两个绰号记录(User2a 和 User2b),它们都参照 User2c。 下面的代码样本可查询当前事件用户的绰号。 应使用不同的匹配准则。

<xsl:template match="modify[@class-name=’User’]"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> <xsl:variable name="query"> <nds dtdversion="1.0" ndsversion="8.5"> <input> <query class-name="{@class-name}" event-id="query-groupwise" cope="entry"> <association> <xsl:value-of select="association"/> </association> <!-- User Domain Name --> <read-attr attr-name="50035"/> <!-- User Post Office Name --> <read-attr attr-name="50062"/> <!-- User Object Name --> <read-attr attr-name="50073"/> </query> </input> </nds> </xsl:variable> <xsl:variable name="gw-data" select="query:query($destQueryProcessor, $query)//instance"/> <xsl:variable name="query2"> <nds dtdversion="1.0" ndsversion="8.5"> <input> <query event-id="query-groupwise" scope="subtree"> <search-class class-name="GroupWise Nickname"/> <!-- Referenced Domain Name --> <search-attr attr-name="50068"> <value> <xsl:value-of select="$gw-data//attr[@attr-name=’50035’]/value"/> </value> </search-attr> <!-- Referenced Post Office Name --> <search-attr attr-name="50069"> <value> <xsl:value-of select="$gw-data//attr[@attr-name=’50062’]/value"/> </value> </search-attr> <!-- Referenced Object Name --> <search-attr attr-name="50070"> <value> <xsl:value-of select="$gw-data//attr[@attr-name=’50073’]/value"/> </value> </search-attr> <!-- Domain Name of Nickname Record --> <read-attr attr-name="50035"/> <!-- Post Office Name of Nickname Record --> <read-attr attr-name="50062"/> <!-- Object Name of Nickname Record --> <read-attr attr-name="50073"/> </query> </input> </nds> </xsl:variable> <xsl:variable name="gw-nickname" select="query:query($destQueryProcessor, $query2)//instance"/> </xsl:template>
结果
<nds dtdversion="1.1" ndsversion="8.6"> <source> <product build="20020409_1220" instance="GroupWise ZDS Driver" version="1.0a Beta">DirXML Driver for GroupWise</product> <contact>Novell, Inc.</contact> </source> <output> <instance class-name="GroupWise Nickname" event-id="0"> <attr attr-name="50035"> <value type="string">TaoDom</value> </attr> <attr attr-name="50062"> <value type="string">TaoPO</value> </attr> <attr attr-name="50073"> <value type="string">User2b</value> </attr> </instance> <instance class-name="GroupWise Nickname" event-id="0"> <attr attr-name="50035"> <value type="string">TaoDom</value> </attr> <attr attr-name="50062"> <value type="string">TaoPO</value> </attr> <attr attr-name="50073"> <value type="string">User2a</value> </attr> </instance> <status level="success"/> </output> </nds>

查询网关别名

以下 XSLT 代码段说明如何在输出转换策略中查询网关别名。

<xsl:template match="modify[@class-name=’User’]"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> <xsl:variable name="query"> <nds dtdversion="1.0" ndsversion="8.5"> <input> <query class-name="{@class-name}" event-id="query-groupwise" scope="entry"> <association> <xsl:value-of select="association"/> </association> <read-attr attr-name="Gateway Alias"/> </query> </input> </nds> </xsl:variable> <xsl:variable name="gw-aliases" select="query:query($destQueryProcessor, $query)//instance"/> </xsl:template> </xsl:template>
结果
<nds dtdversion="1.0" ndsversion="8.5"> <source> <product version="1.0 SP1 Beta, 20020307_1205">GroupWise ZDS Driver</product> <contact>Novell, Inc.</contact> </source> <output> <instance class-name="User" event-id="0" src-dn="TaoDom.TaoPO.User1{106}DFD036A0-0776-0000-A246-4100F0001300"> <association>TaoDom.TaoPO.User1{106}DFD036A0-0776-0000-A246-4100F0001300<association> <attr attr-name="Gateway Alias"> <value type="structured"> <component name="50140">SMTP</component> <component name="50077">UserOne@novell.com</component> </value> </attr> </instance> <status level="success"/> </output> </nds>

查询因特网电子邮件地址

以下 XSLT 代码段说明如何在输出转换策略中查询由 GroupWise 生成的因特网电子邮件地址。

<xsl:template match="modify[@class-name=’User’]"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> <xsl:variable name="query"> <nds dtdversion="1.0" ndsversion="8.5"> <input> <query class-name="{@class-name}" event-id="query-groupwise" scope="entry"> <association> <xsl:value-of select="association"/> </association> <read-attr attr-name="Internet EMail Address"/> </query> </input> </nds> </xsl:variable> <xsl:variable name="inet-address" select="query:query($destQueryProcessor, $query)//instance"/> </xsl:template>
结果
<nds dtdversion="1.1" ndsversion="8.6"> <source> <product build="20020502_1251" instance="GroupWise Driver" version="1.0a Beta">DirXML Driver for GroupWise</product> <contact>Novell, Inc.</contact> </source> <output> <instance class-name="User" event-id="0" src-dn="TaoDom.TaoPO.User2{106}5B8C40F0-0E79-0000-9ADA-350037009300">			         <association>TaoDom.TaoPO.User2{106}5B8C40F0-0E79-0000-9ADA-350037009300</association> <attr attr-name="Internet EMail Address"> <value type="string">User2@domain.com</value> </attr> </instance> <status level="success"/> </output> </nds>

同步 GroupWise 外部用户

在您的公司中,可能会使用几个不同的电子邮件应用程序。 虽然并非所有员工都将拥有 GroupWise 电子邮件帐户,但还是希望 GroupWise 通讯录中能包含所有员工的信息。 驱动程序具有创建 GroupWise 外部用户的功能,因而它可以从其它电子邮件系统获取数据(通过 Identity Vault)并将这些数据显示在 GroupWise 通讯录中。 可以将 Identity Vault 中的用户指派给 GroupWise 外部邮局。

如果使用多种电子邮件系统(GroupWise 和 NetMail®/Notes/Exchange),则可以创建外部用户和外部邮局,将非 GroupWise 系统中的用户添加到 GroupWise 通讯录中。

要在外部电子邮件系统和 GroupWise 之间同步数据,实施过程必须满足以下条件:

  • 必须将外部用户指派给外部邮局,或在外部邮局中创建外部用户。 这些用户没有 GroupWise 邮箱。
  • 外部邮局必须属于非 GroupWise 域。

默认驱动程序配置不包括此自定义。 要实现此功能,应根据业务流程对过滤器、策略和样式表进行相应的更改。

HINT:在软件的 \nt\dirxml\drivers\groupwise\extensions 目录中,可以找到如何实施该解决方案的示例。 这些仅为示例,不供实际使用;实际使用时需要进行自定义。 如果用户所在的树不同于 GroupWise 用户所在的树,请使用简单示例。 如果 GroupWise 用户和非 GroupWise 用户位于同一树中,请使用合并示例。

创建外部用户

创建外部用户时,可用两种方式指定布局:

在 eDirectory 中为非 GroupWise 用户创建帐户时,请确保 Add 事件中包括 gw:classification=”external”特性。 此特性可用于用户对象和邮局对象。

可以修改纲要映射策略或输出转换策略,使其根据某些标准(如父树枝名称)来修改用户的类名。 外部用户以前是一个单独的类。 最好是添加特性而不是添加新类。 这两种方法只能任选其一。

新的 GroupWise 外部用户添加到 GroupWise 中后,驱动程序便在 Identity Vault 中的用户对象上创建关联。 如果非 GroupWise 用户的信息在 Identity Vault 中发生更改,驱动程序会将这些更改同步到 GroupWise 中。 如果关联键被更改或删除,连接便会断开,驱动程序也就不会将 Identity Vault 中对用户对象所做的任何更改同步到 GroupWise 中。

在 Add 事件中指定外部邮局

如果不使用驱动程序创建外部邮局,则需要在 XML Add 事件中生成以下信息。 必须将外部邮局名称和非 GroupWise 域值替换为特定于此系统的名称。

<!-- 	The external post office name to which the user belongs. --> <add-attr attr-name="50062"> <value type="string"><![CDATA[External post office name]]></value> </add-attr>

<!-- The non-GroupWise domain name to which the external post office belongs. --> <add-attr attr-name="50035"> <value type="string"><![CDATA[Non-GroupWise domain name]></value> </add-attr>

NOTE:如果 Add 事件中包括附加 XML,则会覆盖布局策略中的值。

创建外部邮局

可通过两种方式创建外部邮局:

  • 用驱动程序创建 GroupWise 外部邮局并将其与 eDirectory 对象相关联,如组织单元(推荐)。
  • 通过 ConsoleOne® 创建外部邮局。

如果希望驱动程序创建外部邮局,则应修改纲要映射策略以映射“GroupWise Post Office”的类名,并修改输出转换策略以添加 XML 特性 gw:classoication=“external”。

NOTE:创建外部邮局之前,必须先在 ConsoleOne 中创建一个非 GroupWise 域。

创建外部邮局时,可通过两种方式指定布局:

  • 在布局策略中,可指定要在其中创建外部邮局的非 GroupWise 域的名称。
  • 生成 XML 代码,以指定并标识非 GroupWise 域。有关附加信息,请参考在 Add 事件中指定非 GroupWise 域
在 Add 事件中指定非 GroupWise 域

可以在 XML Add 事件中生成以下信息。 必须将非 GroupWise 域值替换为特定于系统的名称。

<!-- 	The non-GroupWise domain name to which the external post office belongs. --> <add-attr attr-name="50035"> <value type="string"><![CDATA[Non-GroupWise domain name]></value> </add-attr>

NOTE:如果 Add 事件中包括附加 XML,则会覆盖布局策略中的值。

如果将外部邮局与组织单元关联,还必须将 OU 特性映射到 Organizational Unit(组织单元)类的 CN 特性,驱动程序会将此特性值作为邮局名称。

NOTE:纲要映射策略具有对 User(用户)类中 OU 特性的映射。 请勿更改 User(用户)类映射。

创建外部用户时,应在布局策略中使用组织单元的 DN。 添加外部邮局后,应指定外部邮局所属的 GroupWise 域:

使用驱动程序创建外部邮局时,GroupWise 将使用非 GroupWise 域中的默认时区设置。 如果要更改邮局的时区设置,需在 Add 事件中生成以下 XML。 插入适当的时区值来替代 EST。

     	<add-attr attr-name="50088" > <value type="string">EST</value> </add-attr>

验证电子邮件地址或网关别名是否唯一

GroupWise 驱动程序有一个专用查询,用于验证建议的因特网电子邮件地址或网关别名是否唯一。 如果地址唯一,则返回无实例节点的成功状态。 如果地址不唯一,则返回包含冲突地址的记录。

以下是带有硬编码值 helloworld@mydomain.com 的查询实例。 请将每个实例中的硬编码值替换为所需的值。

<query event-id="query-groupwise" scope="subtree"> <search-class class-name="User"/> <search-attr attr-name="Internet EMail Address"> <value>helloword@mydomain.com</value> </search-attr> <!-- Domain Name of Object --> <read-attr attr-name="50035"/> <!-- Post Office Name of Object --> <read-attr attr-name="50062"/> <!-- Object Name of Object --> <read-attr attr-name="50073"/> </query>

如果某一网关别名已使用此值,您将会收到以下代码: <instance class-name="GroupWise GateWay Alias" event-id="0"> <attr attr-name="50035"> <value type="string">gwdom</value> </attr> <attr attr-name="50062"> <value type="string">gwpo</value> </attr> <attr attr-name="50073"> <value type="string">User3</value> </attr> </instance>

<attr attr-name> 要素的值给出网关所属的用户的名称。

如果已有用户拥有此因特网电子邮件地址,您将会收到以下代码: <instance class-name="User" event-id="0" src-dn="gwdom.gwpo.User3"> <association>gwdom.gwpo.User3{106}7F7B2F70-0434-000-A0DE-DB0019009700</association> <attr attr-name="50035"> <value type="string">gwdom</value> </attr> <attr attr-name="50062"> <value type="string">gwpo</value> </attr> <attr attr-name="50073"> <value type="string"User3</value> </attr> </instance>

即使存在多个冲突,也仅返回一个实例。

用驱动程序设置 GroupWise 客户程序选项

可以使用驱动程序设置 GroupWise 客户程序的某些环境选项和发送选项。 这些内容是使用策略进行设置的。 客户程序选项有很多字段,这些字段又分成多个特性。

所有特性的结构都相同。 可通过策略创建特性、标识正确字段、设置字段值并且还可以锁定字段。

<attr attr-name=""> <value type="structured"> <component name="lock-level"></component> <component name="value"></component> <component name="field"></component> </value> </attr>

必须有值和字段部分。 锁定级别是可选的。 指定锁定级别后,还必须为它指定值。 如果没有锁定级别,就相当于将锁定级别设置为 0。

锁定级别会锁定修改字段的功能。 通常通过 ConsoleOne 咬接模块设置锁定级别。 可在用户、邮局或域级别锁定字段。 如果字段锁定在邮局级别,用户就不能修改此字段。 有多个不同锁定级别:

  • 0: 未锁定。默认
  • 2: 设置在用户级别,但未锁定。
  • 3: 设置在邮局级别,但未锁定。
  • 4: 设置在域级别,但未锁定。
  • 5: 锁定在用户级别。
  • 6: 锁定在邮局级别。
  • 7: 锁定在域级别。

锁定级别可由一组字段共享。 如果要锁定某个字段,则必须锁定全部字段。 即使锁定时所需的是默认值,也必须设置该值。

档案目录

在 ConsoleOne 中,可通过 GroupWise 客户程序选项(位于《环境》>《文件位置》>《档案目录》下)找到档案目录。 《档案目录》设置用于存档项目的目录。 每个用户都必须拥有档案目录,此目录可以是本地目录(例如,c:\novell\groupwise),也可以是网络服务器中的个人用户目录。如果在本地驱动器中设置,请确保用户已创建了这些目录。如果选择网络驱动器,请确保用户有访问这些目录的必要权限。

<attr attr-name="LocationsSettings"> <value type="structured"> <component name="lock-level">0</component> <component name="value">c:\grpwise</component> <component name="field">archiveLocation</component> </value> <value type="structured"> <component name="lock-level">0</component> <component name="value"></component> <component name="field">archiveLocationLinux</component> </value> </attr>

《archiveLocation》字段是个人目录的 UNC 路径或本地路径,此目录中的存档讯息为 Windows 客户机而保存。 《archiveLocationLinux》字段是本地或个人目录的 Linux 路径,此目录中的存档讯息为跨平台客户机而保存。 不需要同时包括这两个字段。

磁盘空间管理

在 GroupWise 客户程序中的《发送》>《磁盘空间管理》下可找到档案目录。 《磁盘空间管理》对邮局中的用户实施磁盘空间限制。 可使用多种设置自定义如何限制用户的磁盘空间。

<attr attr-name="DiscardSettings"> <value type="structured"> <component name="lock-level">0</component> <component name="value">1</component> <component name="field">userLimitSet</component> </value> <value type="structured"> <component name=="value">10485760</component> <component name="field">boxSizeLimit</component> </value> </value> <value type="structured"> <component name="value">75</component> <component name="field">boxThresholdLimit</component> </value> <value type="structured"> <component name="value">0</component> <component name="field">messageSendLimit</component> </value> <value type="structured"> <component name="lock-level">0</component> <component name="value">1</component> <component name="field">boxLimitAppliesToCache</components> </value> <value type="structured"> <component name="lock-level">0</component> <component name="value">1</component> <component name="field">enableBoxThresholdNotification</component> </value> <value type="structured"> <component name="lock-level">0</component> <component name="value">1</componenet> <component name="field"enableBoxSizeNotification</component> </value> </attr>

  • 用户限制: 禁用或启用其它《磁盘空间管理》设置。默认情况下,禁用此选项。 《userLimitSet》字段有两个值;0 表示禁用,1 表示启用。

    如果启用此选项,则可修改以下选项,否则将忽略这些选项。 如果要对这些选项启用锁定级别,必须同时对此字段组中的所有选项启用此锁定级别。

    • 邮箱大小限制: 控制用户储存讯息和附件文件可用的最大逻辑磁盘空间。由于附件由同一邮局中的所有收件人用户共享,因此该设置使用逻辑磁盘空间。共享文件夹中的讯息仅计入共享文件夹拥有者的磁盘空间。

      以字节为单位设置《boxSizeLimit》字段。 如果将值设置为 0,则对邮箱大小没有限制。 如果要将大小限制设置为 10 MB,则输入 10485760。最大值为 4 GB (64,294,967,295)。

    • 警告用户的阈值: 设置用户邮箱大小(已在《邮箱大小限制》中指定)的百分比值。达到该值时,GroupWise 会触发一个警告,警告用户其邮箱大小将达到限定值。如果用户继续发送讯息,达到了邮箱大小限制,则无法再发送讯息,除非用户将项目删除或进行存档。

      以百分比设置《boxThresholdLimit》字段。如果不希望 GroupWise 发送警告,请将该值设置为 0 或 100。

    • 最大发送讯息大小: 指定用户使用 GroupWise 客户程序可发送的单条讯息的最大大小。如果用户发送的项目超过此大小,将出现一条讯息,通知用户项目太大无法发送。

      以字节为单位设置《messageSendLimit》字段。 如果将值设置为 0,则对讯息大小没有限制。 如果要将限制设置为 10 KB,则输入 10240。最大值为 4 GB (64,294,967,295)。

  • 将限制应用于超速缓存: 用户本地工作站中的超速缓存邮箱的磁盘空间限制需与这些用户邮局中的联机邮箱的磁盘空间限制相同。 如果对已有超速缓存邮箱的用户强用此限制,他们的超速缓存邮箱可能会减小,以符合新磁盘空间限制。 应提前警告此类用户,以便他们在超速缓存邮箱空间减少之前进行备份。 否则,用户可能会丢失希望保留的讯息。

    《boxLimitAppliesToCache》字段可设置为 0 或 1。0 表示《否》,1 表示《是》。 要使此字段发挥作用,必须将《userLimitSet》字段设置为 1。

  • 超过阈值限制时通知管理员: 选择此选项后,如果用户的邮箱超过《警告用户的阈值》中设定的大小,将会通知用户和管理员。 必须在 ConsoleOne 的域对象的《标识》页中定义接收此通知的管理员。 不能通过驱动程序来设置此管理员。

    《enableBoxThresholdNotification》字段可设置为 0 或 1。0 表示《否》,1 表示《是》。 要使此字段发挥作用,必须将《userLimitSet》字段设置为 1。

  • 超过大小限制时通知管理员: 选择此选项后,如果用户的邮箱超过《邮箱大小限制》中设定的大小,将会通知管理员。 接收此通知的管理员必须在 ConsoleOne 的域对象的《标识》页中定义。 不能通过驱动程序来定义此管理员。

    《enableBoxSizeNotification》字段可设置为 0 或 1。0 表示《否》,1 表示《是》。 要使此字段发挥作用,必须将《userLimitSet》字段设置为 1。