Novell Home

Trimming Long Attributes in eDirectory

Novell Cool Solutions: Feature
By Perry Nuffer

Digg This - Slashdot This

Posted: 14 Feb 2007
 

Problem

Error Message Code (-9010) ... -613 ERR_SYNTAX_VIOLATION occurs when the Lotus Notes driver cannot synchronize the Department field from Lotus Notes into the Identity Vault. The following error is reported in the trace:

Message: Code(-9010) An exception occurred: novell.jclient.JCException: modifyEntry -613 ERR_SYNTAX_VIOLATION.

This error seems to be caused when a long department name in Notes (such as "EXECUTIVE OFFICE OF MANAGEMENT DIRECTORS- BUREAU OF LAND MANAGEMENT- DEPARTMENT OF INTERIOR") is mapped to the Department (OU) attribute in eDirectory. How can the driver work around this limitation?

The Department (OU) attribute in eDirectory has a schema syntax definition that limits the attribute to 64 characters. Any modify command with a synchronized Department (OU) attribute value larger than 64 characters will produce this error. And an add command will also fail due to the same problem and produce an error similar to the following:

Message: Code(-9010) An exception occurred: novell.jclient.JCException: createEntry -613 ERR_SYNTAX_VIOLATION.

Solution

One method of solving the problem is to trim the attribute to conform to the appropriate schema syntax constraints. To trim the attribute, you could include a Publisher Command Transformation Policy with a rule similar to the following:

<rule>
   <description>Department (OU) value size: 1 - 64</description>
   <conditions>
      <and>
         <if-op-attr name="OU" op="available"/>
         <if-xpath op="true">*[@attr-name='OU']//value[string-length() > 64]</if-xpath>
      </and>
   </conditions>
   <actions>
      <do-reformat-op-attr name="OU">
         <arg-value type="string">
            <token-substring length="64">
               <token-local-variable name="current-value"/>
            </token-substring>
         </arg-value>
      </do-reformat-op-attr>
   </actions>
</rule>

Review the sample policy in the example section below to see examples of truncating other eDirectory attributes.

Note: There are several schema mapped attributes within the default Lotus Notes driver configuration that can exhibit this problem, and truncation may not always be the best solution depending on the business needs of the system. The Notes Driver by default does not try to truncate attribute values (i.e., use policies like the one above), as this would demonstrate a loss of data without warning or error.

Below are a few of the attributes that are often utilized within a Notes Driver schema map that can exhibit this problem.

eDirectory AttributeMax Size
CN64
Description1024
Generational Qualifier8
Given Name32
Initials8
L128
OU64
Physical Delivery Office Name128
Postal Code40
Post Office Box40
S128
SA128
Surname64
Title64

Examples

<?xml version="1.0" encoding="UTF-8"?>
<!--                                                         -->
<!-- SAMPLE ATTRIBUTE TRUNCATION POLICY                      -->
<!-- ======================================================= -->
<!--                                                         -->
<!-- The eDirectory schema has syntax limitations which      -->
<!-- limit the length of certain attribute values. As such,  -->
<!-- when IDM drivers synchronize data into the Identity     -->
<!-- Vault (eDir), values that do not conform to the proper  -->
<!-- size, will cause an eDirectory -613 ERR_SYNTAX_VIOLATION-->
<!-- error to occur. The following policy demonstrates one   -->
<!-- way of truncating attribute values so that the driver   -->
<!-- does not cause syntax violation errors for attributes   -->
<!-- that are too large. This policy works well in the       -->
<!-- Publisher Command Transformation policy set.            -->
<!--                                                         -->


<policy>
<rule>
<description>Description value size: 1 - 1024</description>
<conditions>
<and>
<if-op-attr name="Description" op="available"/>
<if-xpath op="true">*[@attr-name='Description']//value[string-length() > 1024]</if-xpath>
</and>
</conditions>
<actions>
<do-reformat-op-attr name="Description">
<arg-value type="string">
<token-substring length="1024">
<token-local-variable name="current-value"/>
</token-substring>
</arg-value>
</do-reformat-op-attr>
</actions>
</rule>

<rule>
<description>Title value size: 1 - 64</description>
<conditions>
<and>
<if-op-attr name="Title" op="available"/>
<if-xpath op="true">*[@attr-name='Title']//value[string-length() > 64]</if-xpath>
</and>
</conditions>
<actions>
<do-reformat-op-attr name="Title">
<arg-value type="string">
<token-substring length="64">
<token-local-variable name="current-value"/>
</token-substring>
</arg-value>
</do-reformat-op-attr>
</actions>
</rule>

<rule>
<description>Given Name value size: 1 - 32</description>
<conditions>
<and>
<if-op-attr name="Given Name" op="available"/>
<if-xpath op="true">*[@attr-name='Given Name']//value[string-length() > 32]</if-xpath>
</and>
</conditions>
<actions>
<do-reformat-op-attr name="Given Name">
<arg-value type="string">
<token-substring length="32">
<token-local-variable name="current-value"/>
</token-substring>
</arg-value>
</do-reformat-op-attr>
</actions>
</rule>

<rule>
<description>Surname value size: 1 - 64</description>
<conditions>
<and>
<if-op-attr name="Surname" op="available"/>
<if-xpath op="true">*[@attr-name='Surname']//value[string-length() > 64]</if-xpath>
</and>
</conditions>
<actions>
<do-reformat-op-attr name="Surname">
<arg-value type="string">
<token-substring length="64">
<token-local-variable name="current-value"/>
</token-substring>
</arg-value>
</do-reformat-op-attr>
</actions>
</rule>

<rule>
<description>Full Name value size: 1 - 127</description>
<conditions>
<and>
<if-op-attr name="Full Name" op="available"/>
<if-xpath op="true">*[@attr-name='Full Name']//value[string-length() > 127]</if-xpath>
</and>
</conditions>
<actions>
<do-reformat-op-attr name="Full Name">
<arg-value type="string">
<token-substring length="127">
<token-local-variable name="current-value"/>
</token-substring>
</arg-value>
</do-reformat-op-attr>
</actions>
</rule>

<rule>
<description>Initials value size: 1 - 8</description>
<conditions>
<and>
<if-op-attr name="Initials" op="available"/>
<if-xpath op="true">*[@attr-name='Initials']//value[string-length() > 8]</if-xpath>
</and>
</conditions>
<actions>
<do-reformat-op-attr name="Initials">
<arg-value type="string">
<token-substring length="8">
<token-local-variable name="current-value"/>
</token-substring>
</arg-value>
</do-reformat-op-attr>
</actions>
</rule>

<rule>
<description>Generational Qualifier value size: 1 - 8</description>
<conditions>
<and>
<if-op-attr name="Generational Qualifier" op="available"/>
<if-xpath op="true">*[@attr-name='Generational Qualifier']//value[string-length() > 8]</if-xpath>
</and>
</conditions>
<actions>
<do-reformat-op-attr name="Generational Qualifier">
<arg-value type="string">
<token-substring length="8">
<token-local-variable name="current-value"/>
</token-substring>
</arg-value>
</do-reformat-op-attr>
</actions>
</rule>

<rule>
<description>Department (OU) value size: 1 - 64</description>
<conditions>
<and>
<if-op-attr name="OU" op="available"/>
<if-xpath op="true">*[@attr-name='OU']//value[string-length() > 64]</if-xpath>
</and>
</conditions>
<actions>
<do-reformat-op-attr name="OU">
<arg-value type="string">
<token-substring length="64">
<token-local-variable name="current-value"/>
</token-substring>
</arg-value>
</do-reformat-op-attr>
</actions>
</rule>

<rule>
<description>Locality (L) value size: 1 - 128</description>
<conditions>
<and>
<if-op-attr name="L" op="available"/>
<if-xpath op="true">*[@attr-name='L']//value[string-length() > 128]</if-xpath>
</and>
</conditions>
<actions>
<do-reformat-op-attr name="L">
<arg-value type="string">
<token-substring length="128">
<token-local-variable name="current-value"/>
</token-substring>
</arg-value>
</do-reformat-op-attr>
</actions>
</rule>

<rule>
<description>State (S) value size: 1 - 128</description>
<conditions>
<and>
<if-op-attr name="S" op="available"/>
<if-xpath op="true">*[@attr-name='S']//value[string-length() > 128]</if-xpath>
</and>
</conditions>
<actions>
<do-reformat-op-attr name="S">
<arg-value type="string">
<token-substring length="128">
<token-local-variable name="current-value"/>
</token-substring>
</arg-value>
</do-reformat-op-attr>
</actions>
</rule>

<rule>
<description>Street Address (SA) value size: 1 - 128</description>
<conditions>
<and>
<if-op-attr name="SA" op="available"/>
<if-xpath op="true">*[@attr-name='SA']//value[string-length() > 128]</if-xpath>
</and>
</conditions>
<actions>
<do-reformat-op-attr name="SA">
<arg-value type="string">
<token-substring length="128">
<token-local-variable name="current-value"/>
</token-substring>
</arg-value>
</do-reformat-op-attr>
</actions>
</rule>

<rule>
<description>Physical Delivery Office Name value size: 1 - 128</description>
<conditions>
<and>
<if-op-attr name="Physical Delivery Office Name" op="available"/>
<if-xpath op="true">*[@attr-name='Physical Delivery Office Name']//value[string-length() > 128]</if-xpath>
</and>
</conditions>
<actions>
<do-reformat-op-attr name="Physical Delivery Office Name">
<arg-value type="string">
<token-substring length="128">
<token-local-variable name="current-value"/>
</token-substring>
</arg-value>
</do-reformat-op-attr>
</actions>
</rule>

<rule>
<description>Postal Code value size: 1 - 40</description>
<conditions>
<and>
<if-op-attr name="Postal Code" op="available"/>
<if-xpath op="true">*[@attr-name='Postal Code']//value[string-length() > 40]</if-xpath>
</and>
</conditions>
<actions>
<do-reformat-op-attr name="Postal Code">
<arg-value type="string">
<token-substring length="40">
<token-local-variable name="current-value"/>
</token-substring>
</arg-value>
</do-reformat-op-attr>
</actions>
</rule>

<rule>
<description>Post Office Box value size: 1 - 40</description>
<conditions>
<and>
<if-op-attr name="Post Office Box" op="available"/>
<if-xpath op="true">*[@attr-name='Post Office Box']//value[string-length() > 40]</if-xpath>
</and>
</conditions>
<actions>
<do-reformat-op-attr name="Post Office Box">
<arg-value type="string">
<token-substring length="40">
<token-local-variable name="current-value"/>
</token-substring>
</arg-value>
</do-reformat-op-attr>
</actions>
</rule>

</policy>


Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

© 2014 Novell