Article

dgersic's picture
article
Reads:

2471

Score:
0
0
 
Comments:

0

Using the IDM Delimited Text Driver

(View Disclaimer)

Problem

A Forum reader recently asked:

"I am running into a dead end concerning the delimited text driver. I am trying to build a quite simple unidirectional solution (delimited text => Identity Vault). The Default Driver is working as expected, but I want the additional features of Unique ID and Login Expiration Time."

And here's the response from David Gersic ...

Solution

Unique ID is just a copy of the CN of the object when it's created. However you're creating your object CN, just use the clone attribute feature in policy builder to copy it to the Unique ID attribute.

Expiration time works fine here. My CSV input file has the date in YYYYMMDD format, or it could be blank (the default is then 1-year-from-today), and this is applied to it. For LogExpTime, I'm doing it in the Create Rule here. If you put it in the Publisher Input Transform, you're doing it before the Schema Mapping. You might be better off with it on the Publisher Event Transform.

Here's an example:

<?xml version="1.0" encoding="UTF-8"?><policy
xmlns:jdate="http://www.novell.com/nxsl/java/java.util.Date"
xmlns:jdateformat="http://www.novell.com/nxsl/java/java.text.SimpleDateFormat">
 <rule>
  <description>Expire Accounts - Specified Date</description>
  <conditions>
   <and>
    <if-op-attr name="Login Expiration Time" op="available"/>
   </and>
  </conditions>
  <actions>
   <do-set-local-variable name="ExpireDate">
    <arg-string>
     <token-substring length="2" start="4">
      <token-op-attr name="Login Expiration Time"/>
     </token-substring>
     <token-text xml:space="preserve">/</token-text>
     <token-substring length="2" start="6">
      <token-op-attr name="Login Expiration Time"/>
     </token-substring>
     <token-text xml:space="preserve">/</token-text>
     <token-substring length="4" start="0">
      <token-op-attr name="Login Expiration Time"/>
     </token-substring>
    </arg-string>
   </do-set-local-variable>
   <do-reformat-op-attr name="Login Expiration Time">
    <arg-value type="time">
     <token-xpath expression="round(jdate:parse($ExpireDate)div 1000)"/>
    </arg-value>
   </do-reformat-op-attr>
   <do-break/>
  </actions>
 </rule>
 <rule>
  <description>Expire Accounts - Default 1 Year</description>
  <conditions>
   <and>
    <if-op-attr name="Login Expiration Time" op="not-available"/>
   </and>
  </conditions>
  <actions>
   <do-set-dest-attr-value name="Login Expiration Time">
    <arg-value type="string">
     <token-xpath expression="round(jdate:getTime(jdate:new()) div
1000)+31536000"/>
    </arg-value>
   </do-set-dest-attr-value>
   <do-break/>
  </actions>
 </rule>
</policy>


Disclaimer: As with everything else at Cool Solutions, this content is definitely not supported by Novell (so don't even think of calling Support if you try something and it blows up).

It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.




User Comments

© 2012 Novell