Sun Identity Manager 8.1 Resources Reference

AttrParse Element

The AttrParse element defines the AttrParse object.

Attributes

Attribute

Description

name

Uniquely defines the AttrParse object. This value will be specified on the Resource Parameters page for the adapter. 

Data

One or more tokens that parse user listings. The following tokens supported by the AttrParse object

Example

The following example reads the first 19 characters of a line, trims extraneous white space, and assigns the string as the value to the USERID resource attribute. It then skips forward five spaces and extracts the NAME resource attribute. This attribute has a maximum of 21 characters, and white space is trimmed. The sample checks for the string “Phone number: “. A telephone number will be parsed out and assigned to the PHONE resource attribute. The phone number begins after the space in “Phone number: “ and ends at the next space encountered. The trailing space is trimmed.

<AttrParse name=’Example AttrParse’>
   <str name=’USERID’ trim=’true’ len=’19’/>
   <skip len=’5’/>
   <str name=’NAME’ trim=’true’ len=’21’/>
   <t offset=’-1’>Phone number: </t>
   <str name=’PHONE’ trim=’true’ term=’ ’/>
</AttrParse>

The following strings satisfy the Example AttrParse grammar. (The· symbols represent spaces.)

gwashington123·····ABCD·George·Washington····Phone·number:·123-1234·
alincoln···········XYZ··Abraham·Lincoln······Phone·number:·321-4321·

In the first case after parsing, the user attribute map would contain:

USERID=“gwashington123”, NAME=“George Washington”, PHONE=“123-1234”

Similarly, the second user attribute map would contain:

USERID=”alincoln”, NAME=”Abraham Lincoln”, PHONE=“321-4321”

The rest of the text is ignored.