Example: Mapping Files for an LDIF Interface

6-16 Oracle Fusion Middleware Administrators Guide for Oracle Directory Integration Platform ■ Oracle recommends that Mapping plug-in invocation in different attribute rules follow the same invocation signature. The following example is not recommended and is highly error prone because Myplugin has different invocation signatures: sn: : :person:givenname: :person:PLUGINMypluginsn,Mr cn: : :person:description: :person:PLUGINMyplugincn

6.5.3 Adding Mapping Plug-Ins

To add a mapping plug-in to Oracle Directory Integration Platform: 1. If it is running, stop the WebLogic Managed Server hosting Oracle Directory Integration Platform. 2. Copy the mapping plug-in JAR file to the APP-INFlib directory in the path where the Oracle Directory Integration Platform application was exploded. For example: MW_HOME user_projectsdomainsDOMAIN_NAMEserversMANAGED_SERVER_NAMEtmp _WL_userDIP_VERSION_NUMBERRANDOM_CHARACTERSAPP-INFlib 3. Start the WebLogic Managed Server hosting Oracle Directory Integration Platform.

6.5.4 Applications of Mapping Plug-Ins

This section describes various applications of Mapping plug-ins, including: ■ Support for New Mapping Operations ■ Support for Multiple Literal Values

6.5.4.1 Support for New Mapping Operations

Applications can implement their own mapping operations that are not supported internally by the mapping framework. Support for Conditional Mapping Conditional Attribute Mapping Support You can support attribute mapping based on a condition. For example, the application can support a mapping rule where if the credential attribute is present, then orclpassword must be set to ENABLED, and if not present, the orclpassword must be set to DISABLED. This logic can be supported by implementing a plug-in to assign this value. The mapping rule should be as follows: credential: : :UserType:orclisenabled::orcluserv2:ConditionalAttrBasedOnPresencecredential Conditional DN Mapping Support You can support DN container mapping based on a condition. For example, users must be mapped to container ou=sales,dc=acme,dc=com if department is Sales and mapped to container ou=IT,dc=acme,dc=com if department is IT. To support this mapping: ■ The DomainRules section can have a construction rule like: NONLDAP:dc=acme,dc=com:cn=,ou=,dc=acme,dc=com ■ The AttributeRules section can have a rule with a plug-in operation to map ou as follows: Configuring Directory Synchronization 6-17 department: : :UserType:ou: :orcluserv2:ConditionalOUMappingdepartment

6.5.4.2 Support for Multiple Literal Values

The current mapping framework only supports specifying a single literal value for an attribute. However, there might be a need to specify more than one literal value when an attribute can have multiple default values. For example, in case of Microsoft Exchange, there is a showInAddressBook attribute which can have more than one value. This can also be implemented using plug-ins.

6.5.5 Example Plug-In Usage

This section provides examples of plug-in usage. Example 1: Attribute Mapping Rule cn: : :person:initials: :person:PLUGINPluginSamp1cn Example 1: Corresponding Plug-In Implementation Vector evaluateVector operands { Vector all_cnValues = Vectoroperands.get0; Vector result = new Vector; …. …. All the elements of this result must be strings. return result; } Example 2: Attribute Mapping Rule cn: : :person:givenname: :person:PLUGINMyplugincn,Mr Example 2: Corresponding Plug-In Implementation Vector evaluateVector operands { Vector all_cnValues = Vectoroperands.get0; String strOperand = Stringoperands.get1; Vector result = new Vector; forint i=0; iall_cnValues.size; i++ { String cnValue = String all_cnValues.geti; String givenNameNewValue = strOperand + cnValue; result.addgivenNameNewVlaue; } All the elements of this result must be strings. return result; } Example 3: Attribute Mapping Rule mail: : :inetorgperson:mail: :inetorgperson: PluginMyPluginmail, ‘’