Cisco Unified MeetingPlace, Release 6.x -- Cisco Unified MeetingPlace Directory Services Plug-In Functions
From DocWiki
Cisco Unified MeetingPlace, Release 6.x > Cisco Unified MeetingPlace Directory Services
Contents |
Plug-In Uses
Use plug-in functions to manipulate the value of an attribute when you import the attribute into Cisco Unified MeetingPlace. Plug-in functions allow you to do the following tasks:
- Extract, append, or replace attributes
- Concatenate attributes
- Assign random attribute values
- Filter attribute values
Plug-In Guidelines
The standard syntax for using a plug-in function is &fn(att), where fn refers to the function name and att refers to the attribute.
Guidelines for using plug-in functions are as follows:
- The ASCII code for \ is \5C.
- Each plug-in function has a predefined set of optional and required parameters.
- A percent sign (%) preceding an attribute means that it must have a value.
- The asterisk (*) character represents the all-values qualifier, which, when prefixing an attribute name, means that all of the values of the attribute should be used, excluding blank values. This qualifier has no effect on a single-valued source attribute and is illegal for a single-valued destination attribute.
Functions must be declared in the [Conversion Functions] section of the MetaLink configuration file to be usable. For more information, see the Synchronizing a Single-Server Cisco Unified MeetingPlace Directory Services System with a Corporate Directory Server.
Available Plug-In Functions for Cisco Unified MeetingPlace Directory Services
Table: Available Plug-in Functions for Cisco Unified MeetingPlace Directory Services lists alphabetically by name the plug-in functions that are available in Directory Services.
Table: Table A-1 Available Plug-in Functions for Cisco Unified MeetingPlace Directory Services
| Function Name | Declaration | Description | Example |
|---|---|---|---|
|
AND |
AND = dcmlkcnv.dll,mlkAMapAND |
Takes any number of attributes as parameters and returns the value "TRUE" if all attributes specified contain a value. If any of the attributes specified do not contain a value, then no value is returned. |
destSecManAttr=&AND(srcManagerAttr,srcSecretaryAttr) |
|
attrHasValue |
attrHasValue = dcmlkcnv.dll,mlkAMapAttrHasValue |
Takes an attribute as the first parameter and a string literal as the second parameter. If the attribute has a value that matches the string, then this value is returned; if not, no value is returned. |
Abs_Person = &attrHasValue(*objectClass, person) |
|
BitMask |
BitMask = MPPlugin.dll,mlkBitMask |
Tests the attribute given as the first parameter against the bitmask in the second parameter. If the attribute value matches the bitmask value, the function returns "1"; if not, it returns "0." |
To only allow active Active Directory users into the directory: [LDAPfilters]Abs_Person=&attrHasValue(&BitMask (userAccountcontrol, “2”), “0”) The value of the second bit of the userAccountcontrol attribute represents the user active or inactive status in the Active Directory. The bitmask function masks the rest of the bit values and only extracts the second bit of the Active Directory attribute. |
|
CaseAllLower |
CaseAllLower= dcmlkcnv.dll,mlkAMapCase,AllLower |
Takes a single attribute as a parameter and applies case transformation according to the value of the optional parameter in the registration, returning the transformed values.
|
destLowerCaseNameAttr=*&CaseAllLower(*srcNameAttr) |
|
CaseAllUpper |
CaseAllUpper = dcmlkcnv.dll,mlkAMapCase,AllUpper |
Takes a single attribute as a parameter and applies case transformation according to the value of the optional parameter in the registration, returning the transformed values.
|
destUpperCaseNameAttr=*&CaseAllUpper(*srcNameAttr) |
|
CaseFirstNormal |
CaseFirstNormal = dcmlkcnv.dll,mlkAMapCase,FirstNormal |
Takes a single attribute as a parameter and applies case transformation according to the value of the optional parameter in the registration, returning the transformed values.
|
destFirstNormalNameAttr=*&CaseFirstNormal(*srcNameAttr) |
|
CaseFirstUpper |
CaseFirstUpper = dcmlkcnv.dll,mlkAMapCase,FirstUpper |
Takes a single attribute as a parameter and applies case transformation according to the value of the optional parameter in the registration, returning the transformed values.
|
destFirstUpperNameAttr=*&CaseFirstUpper(*srcNameAttr) |
|
CaseWordLower |
CaseWordLower =dcmlkcnv.dll,mlkAMapCase,WordLower |
Takes a single attribute as a parameter and applies case transformation according to the value of the optional parameter in the registration, returning the transformed values.
|
destLowerCaseNameAttr=*&CaseWordLower(*srcNameAttr) |
|
CaseWordNormal |
CaseWordNormal =dcmlkcnv.dll,mlkAMapCase,WordNormal |
Takes a single attribute as a parameter and applies case transformation according to the value of the optional parameter in the registration, returning the transformed values.
|
destWordNormalNameAttr=*&CaseWordNormal(*srcNameAttr) |
|
CaseWordUpper |
CaseWordUpper = dcmlkcnv.dll,mlkAMapCase,WordUpper |
Takes a single attribute as a parameter and applies case transformation according to the value of the optional parameter in the registration, returning the transformed values.
|
destWordUpperNameAttr=*&CaseWordUpper(*srcNameAttr) |
|
CreateDate |
Createdate = mpplugin.dll,mlkCreateDate |
Creates a time-date stamp for any attribute that calls the function. |
&creationdate("0") - mmddyy
|
|
FilterAND |
FilterAnd = MPPlugIn.dll,mlkFilterAND |
Adds two or more expressions. |
Abs_Person = &FilterAnd("4", &attrHasValue(*objectClass, "person"), sn, GivenName, SAMAccountName) |
|
FilterBuiltin |
FilterBuiltin = MPPlugIn.dll,mlkFilterBuiltin |
Filters out any entries with an attribute equal to a given value. |
%Vuname=&Filterbuiltin(telephonenumber, "1234") |
|
FilterNOT |
FilterNOT = MPPlugIn.dll,mlkFilterNOT |
Inverts an expression. |
- |
|
GenNum |
GenNum = MPPlugIn.dll,mlkGenNum |
Generates an increment number by given length (first argument) and increment value (second argument). Note: This plug-in uses the registry to keep track of the latest number. The value can be found: HKEY_LOCAL_MACHINE > SOFTWARE > Cisco Systems > Cisco MeetingPlace > Plugin > LastNum |
%VUName=&GenNum("5", "1") |
|
GetMailboxAddress |
GetMailBoxAddress = dcmlkcnv.dll,mlkAMapGetMailboxAddress,SMTP |
Used for synchronizing an e-mail address from an Exchange server. It extracts a specific type of e-mail address from those stored in an Exchange mailbox. |
destSingleMailboxAttr=&GetMailBoxAddress(*srcMultiMailboxAttr) |
|
HexString |
HexString = MPPlugIn.dll,mlkHexString |
Converts each character in a string to its 2-digit hexadecimal equivalent. Can be used in a correlation rule to convert the Active Directory objectGUID value to a unique hex string. |
EmailAdd = &HexString(objectGUID) |
|
LDAPtoDN |
LDAPtoDN = dcmlkcnv.dll,mlkAMapConvertLDAPDN,LDAP |
Takes a single attribute as a parameter, converting DNs between DC-Directory and LDAP form according to the optional parameter, returning the converted values. |
destDCDNAttr=*&LDAPtoDN(srcLDAPDNAttr) |
|
ManyToOne |
ManyToOne = dcmlkcnv.dll, mlkAMapManyToOne |
Takes multiple attributes as parameters, returning a single list that contains all of the values of all of the attributes. It can take a maximum of ten attributes. |
destCombinationAttr=*&ManyToOne(*srcFirstAttr, *srcSecondAttr) |
|
MapString |
MapString = MPPlugIn.dll,mlkStringMap |
Maps a string according to a file-based table. The table is passed via a filename. |
Groupname=&mapString(employeetype, "E:\Cisco Systems\Cisco Unified MeetingPlace Directory Services\DSG Admin\group.txt") Timezone = &mapString(&Caseall(&Trim(city)), "C:\temp\timezone.txt", "269") where “269” is the default value if there is no match in the map file. Or Timezone = &mapString(&Caseall(&Trim(city)), "C:\temp\timezone.txt") | “269” where “|” represents the Or function.
|
|
MidString |
MidString = MPPlugIn.dll,mlkStringMid |
Returns a substring from a given starting index, containing given n characters. Note: If the strlen(string) < (start + n), MidString returns an error that is logged to the suspense file. Use StringMidNoEnd if necessary to avoid string length errors. |
FaxNum=&midString(Telephone-Fax, "3", "5") |
|
MultiValToSingle |
MultiValToSingle = dcmlkcnv.dll,mlkAMapMultiValToSingle |
Takes a single attribute as a parameter and maps all of the values of that attribute to a single value by concatenating the values, by using the optional parameter as a delimiter. Any occurrences of the delimiter string within the values are escaped with a backslash. Backslashes are also escaped with backslashes. |
destSingleValAttr=&MultiValToSingle(*srcMultiValAttr) |
|
NormalizeInitials |
NormalizeInitials = dcmlkcnv.dll, mlkAMapInitials |
Takes a single attribute as a parameter; each letter is converted to uppercase and followed by a dot (.), returning the normalized values. This is used to normalize initial attributes. |
destInitAttr=*&NormalizeInitials(*srcInitAttr) |
|
NOT |
NOT = dcmlkcnv.dll,mlkAMapNOT |
Takes one attribute as a parameter, returning the value "TRUE" if the attribute specified does not contain any values. If the attribute specified does contain a value, then no value is returned. |
destNotManagerAttr=&NOT(srcManagerAttr) |
|
Random |
Random = MPPlugIn.dll,mlkRnd |
Returns a random value from 0 to n. |
GroupName = &mapString(&Random("6"), "C:\Program Files\Cisco Systems\MeetingPlace Directory Services\DSG Admin\map.txt") |
|
RandomPickUnique |
RandomPickUnique = MPPlugIn.dll,mlkRandNumberUnique |
Returns a random and unique Cisco Unified MeetingPlace profile number (VUName) that is compared to existing VUNames on the Cisco Unified MeetingPlace Audio Server. The first parameter is the number of digits (max. 32) for the generated value. The second parameter is the flag option and can be either: (1) to create a new value with writing into the registry or (0) to read from the registry the previously generated value in this manner. Notes:
|
%VUName="8"+&Randompickunique("8", "1")
|
|
RemoveRDN |
RemoveRDN= dcmlkcnv.dll, mlkAMapRemoveRDN |
Removes a number of RDNs from the end of a given DN string. The first parameter is the DN, and the second parameter is the number of RDNs to remove from the end of the DN. If the number of RDNs to remove is greater than the number of RDNs present, then a null string is returned. |
manager=&RemoveRDN(fulldistname,1) |
|
ReparentDN |
ReparentDN = dcmlkcnv.dll,mlkAMapReparentDN |
Used to map a DN in one subtree to an equivalent position in a different subtree. The first parameter is an attribute parameter; the next two parameters are string literals. The second parameter is the initial parent DN; the third parameter is the new parent DN. The DNs must be in DC-Directory rather than in LDAP form. |
destNewDNAttr=*&ReparentDN(*srcOldDNAttr, "/c=US/o=MyCorp", "/dc=com/dc=mycorp") |
|
ReplaceSubstring |
ReplaceSubstring = dcmlkcnv.dll,mlkAMapReplaceSubstring |
Used to perform a substring replacement on all values of the attribute, replacing all instances of a specified string with an alternative value. The first parameter is an attribute parameter; the second two parameters are string literals. The second parameter is the string to search for; the third parameter is the replacement string. |
destProperAttr=*&ReplaceSubstring(*srcShortHandAttr, "Init:", "Initials:") |
|
SingleSpace |
SingleSpace = dcmlkcnv.dll, mlkAMapSingleSpace |
Takes a single attribute as a parameter and in each value replaces any occurrence of multiple consecutive space characters with a single space character, returning the modified values. |
destStringAttr=*&SingleSpace(*srcStringAttr) |
|
SingleValToMulti |
SingleValToMulti = dcmlkcnv.dll,mlkAMapSingleValToMulti |
Takes a single attribute as a parameter and maps a single value to a list of values. |
destMultiValAttr=*&SingleValToMulti(srcSingleValAttr) |
|
SpaceNormRDNValue |
SpaceNormRDNValue= dcmlkcnv.dll, mlkAMapSpaceNormDCDRDN |
This function takes a single RDN value as a parameter and normalizes it by removing any spaces from the beginning or end of the value and replacing any instances of repeated spaces by a single space. This normalized value is then returned. This function should be used to normalize RDNs returned from DC-Directory through Remote DCD Sync and LDAP Sync to DC-Directory MetaLink agreements. |
fullDistName = "/c=US/o=MyOrg/cn=" + &SpaceNormRDNValue(givenname) |
|
String2Number |
String2Number = MPPlugIn.dll,mlkString2Number |
Converts a string to a number based on the standard telephone pad. |
VUname=&String2number(uid) |
|
StringExtASCII |
StringExtASCII = MPPlugIn.dll,mlkStringUTF2ASCII |
Converts a string with extended ASCII to ASCII. |
destStringExtASCIIAttr=&StringExtASCII(srcNameAttr) |
|
StringLeft |
StringLeft = MPPlugIn.dll,mlkStringLeft |
Returns everything to the left of the first occurrence of a given character. |
fullDirectoryName= "/o=yourcompany.com/ou=people/nm="+&StringLeft(Assoc-NT-Account, "\5C") |
|
StringMidNoEnd |
StringMidNoEnd = MPPlugIn.dll,mlkStringMidNoEnd |
Returns a substring from a given starting index and containing given n characters. Note: Unlike MidString, StringMidNoEnd does not produce an error if the strlen(string) < (start + n). |
FaxNum=&StringMidNoEnd(Telephone-Fax, "3", "5") |
|
StringMidNoStartNoEnd |
StringMidNoStartNoEnd =MPPlugin.dll, mlkStringMidNoStartNoEnd |
Returns a substring from a given starting index and containing given n characters. Note: Unlike MidString, StringMidNoEnd will not produce an error if the strlen(string) < (start + n),or if strlen(string) < (end - n). |
FaxNum=&StringMidNoStartNoEnd(Telephone-Fax, "3", "5") |
|
StringRemoveNonDigit |
StringRemoveNonDigit = MPPlugIn.dll,mlkStringRemoveNonDigit |
Removes all nondigit characters in a given string. This function is useful for mapping a phone number to vuname. |
%VUName=&StringRightN(&StringRemoveNonDigit(telephonenumber), "7") |
|
StringRight |
StringRight = MPPlugIn.dll,mlkStringRight |
Returns everything to the right of the first occurrence of a given character, starting from the right. |
fullDirectoryName= "/o=yourcompany.com/ou=people/nm"+&StringRight(Assoc-NT-Account, "\5C") |
|
StringRightN |
StringRightN = MPPlugIn.dll,mlkStringRightN |
Returns a substring of n characters, starting at the right end of a given string. |
%VUName=Telephone-Office2 | &StringRightN(Telephone-Office1, "4") |
|
TelephoneValidate |
TelephoneValidate = dcmlkcnv.dll, mlkAMapTelValidate |
Takes a single attribute as a parameter and normalizes it by removing all characters other than those allowed in the standard international representation of a phone number (that is, the digits 0 to 9, space, and the + symbol), returning the normalized number. |
destTelephoneNumberAttr=*&TelephoneValidate(*srcTelephoneNumberAttr) |
|
TrimWhiteSpace |
TrimWhiteSpace = dcmlkcnv.dll,mlkAMapTrim |
Removes blank spaces from start to end of each value. |
destTrimmedAttr=*&TrimWhiteSpace(*srcUntrimmedAttr) |
|
Truncate |
Truncate= dcmlkcnv.dll, mlkAMapTruncate |
Truncates a string value. The first parameter is a string value to be truncated, and the optional parameter on registration is an integer specifying the length to which the string is truncated. |
destInitials=&Truncate(initials) |
|
UnixDate |
UnixDate = MPPlugIn.dll,mlkUnixDate |
Converts a standard date (mmddyyyy) to Unix time format or vice versa. |
To convert standard date (for example, 12/31/2003) to Unix time:
|
