B.8 設定並修改 Lotus Notes 欄位旗標

Notes Driver v2.2.1 和更新版本可以在同步化的 Lotus Notes 資料庫 (.nsf) 中,設定 (新增) 或修改文件 (記錄) 上的 Lotus Notes 欄位旗標 (僅限「訂閱者」通道)。 驅動程式可適當設定的 Lotus Notes 欄位旗標為:read-accessread/write-accessnamesprotectedsummary。 也可以啟用或停用 sealsign 旗標,但沒有預期的支援功能。

每一個 Notes 欄位旗標都可以使用對應的 XML 標籤進行啟用或停用。 下表顯示此映射。

Table B-1 驅動程式屬性標籤及其對應的 Notes 欄位旗標

驅動程式屬性旗標

Notes 欄位旗標

authors-flag

READ/WRITE-ACCESS

encrypted-flag

SEAL

names-flag

NAMES

protected-flag

PROTECTED

readers-flag

READ-ACCESS

signed-flag

SIGN

summary-flag

SUMMARY

您可以將這些 XML 標籤 (驅動程式屬性旗標) 插入「訂閱者」通道的 XDS 文件,做為 <add-attr> 或 <modify-attr> 元素的屬性 (attr-name 屬性的同級)。 必須根據 Lotus Notes 資料庫綱要和設計規則,以適當的方式使用欄位旗標。 如果欄位上存在不適當的旗標 (或旗標組合),可能會導致此文件 (記錄) 產生非預期的結果。

例如,當欄位上的某些屬性旗標 (readers-flag、authors-flag) 未適當設定,而導致欄位無法處理旗標時,可能會從「Notes 通訊錄」的檢視窗中移除未經認證的使用者 (將其轉換為無法存取)。

您可以設定欄位的 encrypted-flag,縱使驅動程式並不會採取必要的步驟,以在適當的證書內呼叫加密方法。 因此,可以將某個欄位設為 SEAL,但其他程式碼需要呼叫在文件中加密此欄位的適當方法,否則將無法真正密封 (加密) 此欄位。

B.8.1 範例建立規則

以下的範例在建立規則中使用欄位旗標:

<rule> <description>Add Shoe Size</description> <conditions> <and> <if-operation op="equal">add</if-operation> </and> </conditions> <actions> <do-add-dest-attr-value class-name="User" name="ShoeSize"> <arg-value type="string"> <token-text xml:space="preserve">9.5</token-text> </arg-value> </do-add-dest-attr-value> </actions> </rule> <rule> <description>Apply ShoeSize Field Flags</description> <conditions> <and> <if-operation op="equal">add</if-operation> <if-class-name mode="nocase" op="equal">User</if-class-name> </and> </conditions> <actions> <do-set-xml-attr expression="../add[@class-name='User']/add-attr[@attr-name='ShoeSize']" name="authors-flag"> <arg-string> <token-text>false</token-text> </arg-string> </do-set-xml-attr> <do-set-xml-attr expression="../add[@class-name='User']/add-attr[@attr-name='ShoeSize']" name="readers-flag"> <arg-string> <token-text>false</token-text> </arg-string> </do-set-xml-attr> <do-set-xml-attr expression="../add[@class-name='User']/add-attr[@attr-name='ShoeSize']" name="names-flag"> <arg-string> <token-text>false</token-text> </arg-string> </do-set-xml-attr> <do-set-xml-attr expression="../add[@class-name='User']/add-attr[@attr-name='ShoeSize']" name="protected-flag"> <arg-string> <token-text>true</token-text> </arg-string> </do-set-xml-attr> <do-set-xml-attr expression="../add[@class-name='User']/add-attr[@attr-name='ShoeSize']" name="summary-flag"> <arg-string> <token-text>true</token-text> </arg-string> </do-set-xml-attr> <do-set-xml-attr expression="../add[@class-name='User']/add-attr[@attr-name='ShoeSize']" name="signed-flag"> <arg-string> <token-text>false</token-text> </arg-string> </do-set-xml-attr> <do-set-xml-attr expression="../add[@class-name='User']/add-attr[@attr-name='ShoeSize']" name="encrypted-flag"> <arg-string> <token-text>false</token-text> </arg-string> </do-set-xml-attr> </actions> </rule>

B.8.2 範例修改規則

下一個是指令轉換中的「修改」規則範例:

<rule> <description>Apply User Telephone Number Field Flags</description> <conditions> <and> <if-class-name mode="nocase" op="equal">User</if-class-name> <if-operation op="equal">modify</if-operation> <if-op-attr name="Telephone Number" op="available"/> </and> </conditions> <actions> <do-set-xml-attr expression="../modify[@class-name='User']/modify-attr[@attr-name='Telephone Number']" name="authors-flag"> <arg-string> <token-text>false</token-text> </arg-string> </do-set-xml-attr> <do-set-xml-attr expression="../modify[@class-name='User']/modify-attr[@attr-name='Telephone Number']" name="readers-flag"> <arg-string> <token-text>false</token-text> </arg-string> </do-set-xml-attr> <do-set-xml-attr expression="../modify[@class-name='User']/modify-attr[@attr-name='Telephone Number']" name="names-flag"> <arg-string> <token-text>false</token-text> </arg-string> </do-set-xml-attr> <do-set-xml-attr expression="../modify[@class-name='User']/modify-attr[@attr-name='Telephone Number']" name="protected-flag"> <arg-string> <token-text>true</token-text> </arg-string> </do-set-xml-attr> <do-set-xml-attr expression="../modify[@class-name='User']/modify-attr[@attr-name='Telephone Number']" name="summary-flag"> <arg-string> <token-text>true</token-text> </arg-string> </do-set-xml-attr> <do-set-xml-attr expression="../modify[@class-name='User']/modify-attr[@attr-name='Telephone Number']" name="signed-flag"> <arg-string> <token-text>false</token-text> </arg-string> </do-set-xml-attr> <do-set-xml-attr expression="../modify[@class-name='User']/modify-attr[@attr-name='Telephone Number']" name="encrypted-flag"> <arg-string> <token-text>false</token-text> </arg-string> </do-set-xml-attr> </actions> </rule>

B.8.3 範例新增 XDS 文件

以下是在提交至 Notes 驅動程式 Shim 之前「新增 XDS 文件」的範例:

<nds dtdversion="2.0" ndsversion="8.x"> <source> <product version="2.0.5.51 ">Identity Manager</product> <contact>Novell, Inc.</contact> </source> <input> <add certify-user="true" class-name="Person" create-mail="true" dest-dn="CN=ErnieEngineer/OU=eng/O=novell" drv-param-cert-id="eng-cert-id-file" drv-param-cert-pwd="eng-cert-id-password" event-id="BLACKCAP-NDS#20040915163542#1#1" expire-term="22" internet-password-force-change="false" mail-acl-manager-name="CN=Notes Driver/O=novell" mail-file-inherit-flag="true" no-id-file="false" notes-password-change-interval="0" notes-password-check-setting="PWD_CHK_CHECKPASSWORD" notes-password-grace-period="0" qualified-src-dn="O=DirXML\OU=Notes\OU=Users\OU=eng\CN=ErnieEngineer" roaming-cleanup-period="90" roaming-cleanup-setting="REG_ROAMING_CLEANUP_EVERY_NDAYS" roaming-server="CN=blackcap/O=novell" roaming-subdir="Roaming\ErnieEngineer" roaming-user="false" src-dn="\raspberry\DirXML\Notes\Users\eng\ErnieEngineer" src-entry-id="39853" store-useridfile-in-ab="true" sync-internet-password="true"> <add-attr attr-name="FullName"> <value naming="true" timestamp="1095266118#20" type="string">ErnieEngineer</value> </add-attr> <add-attr attr-name="LastName"> <value timestamp="1095266118#3" type="string">Engineer</value> </add-attr> <add-attr attr-name="FirstName"> <value timestamp="1095266142#1" type="string">Ernie</value> </add-attr> <add-attr attr-name="InternetAddress"> <value>ErnieEngineer@novell.com</value> </add-attr> <add-attr attr-name="ShoeSize" authors-flag="false" encrypted-flag="false" names-flag="false" protected-flag="true" readers-flag="false" signed-flag="false" summary-flag="true"> <value type="string">9.5</value> </add-attr> </add> </input> </nds>

B.8.4 範例修改 XDS 文件

以下是在提交至 Notes 驅動程式 Shim 之前「修改 XDS 文件」的範例:

<nds dtdversion="2.0" ndsversion="8.x"> <source> <product version="2.0.5.51 ">Identity Manager</product> <contact>Novell, Inc.</contact> </source> <input> <modify class-name="Person" event-id="BLACKCAP-NDS#20040915164613#1#1" qualified-src-dn="O=DirXML\OU=Notes\OU=Users\OU=eng\CN=ErnieEngineer" src-dn="\raspberry\DirXML\Notes\Users\eng\ErnieEngineer" src-entry-id="39853" tell-adminp-process="tell adminp process all" timestamp="1095267005#2"> <association state="associated">A4C23EE8273577AF87256F10005B2BF9</association> <modify-attr attr-name="OfficePhoneNumber" authors-flag="false" encrypted-flag="false" names-flag="false" protected-flag="true" readers-flag="false" signed-flag="false" summary-flag="true"> <remove-value> <value timestamp="1095266773#1" type="teleNumber">222-2222</value> </remove-value> <add-value> <value timestamp="1095267005#2" type="teleNumber">222-2221</value> </add-value> </modify-attr> </modify> </input> </nds>