The attribute schema used by the sample acme.com site is based upon LDAP attributes. The canonical LDIF attributes are:
Canonical LDIF | |
---|---|
attribute | Description |
DN | Distinguished name: the attribute uniquely identifying this directory entry |
cn | Common name: the person's name |
sn | Surname: the person's family (last) name |
uid | User identifier/account name |
E-mail address | |
description | A comment field; it may contain important information for cc:Mail |
cc:Mail native attribute | Cook | Canonical LDIF attribute |
---|---|---|
function of name plus ou=cc,o=Acme,c=NZ | --> | DN |
function of name | --> | cn |
function of name | --> | sn |
cmts | --> | description |
function of addr plus acme.com | --> |
Canonical LDIF attribute | Serve | cc:Mail native attribute |
---|---|---|
function of cn | --> | name |
function of mail | --> | addr |
description | --> | cmts |
Lotus Notes native attribute | Cook | Canonical LDIF attribute |
---|---|---|
function of FullName plus o=acme,c=nz | --> | DN |
substring of FullName | --> | cn |
LastName | --> | sn |
shortname | --> | uid |
substring of FullName plus @acme.com | --> | |
description | --> | description |
Canonical LDIF | Serve | Lotus Notes native |
---|---|---|
attribute | attribute | |
function of DN (effectively CN='cn'/O='ou') | --> | FullName |
cn | --> | LastName |
--> | Form always set to Person | |
--> | Type always set to Person | |
description | --> | description |
--> | MailAddress | |
--> | MailDomain always set to PMDF |
When thinking about recipe files, for concreteness it can be helpful to see samples of actual LDIF files; see Section 36.9.2.4 below.
Sample recipe files for cooking and serving cc:Mail are shown in Example 36-38 and Example 36-39 .
Example 36-38
Samplecook_cc.rcp
file
cn1 = name[1]; #inputs are always lists comma = find(",", cn1); if (comma) { lastname = cn1[1, comma]; # up to but not incl. comma cdn = cn1[comma+1, -1] + " " + lastname; fcn = cdn; # from just after comma to end } else { cdn = cn1; space = find(" ", cn1); if (space) lastname = cn1[space+1, -1]; else lastname = cn1; } dncomp = {"cn", cdn, "ou", "cc", "o", "Acme", "c", "NZ"}' dn = makeDN(dncomp); mail1 = addr[1]; at = find("@", mail1); if (at) user = mail1[1, at]; else user = mail1; if (user[1] == "\"") user = user[2, -2]; space = find(" ", user); if (space) { user = user[1,space] + "." + user[space+1, -1]; space = find(" ", user); if (space) { user = user[1,space] + "." + user[space+1, -1]; space = find(" ", user); if (space) user = user[1,space] + "." + user[space+1, -1]; } } percent = find("%", user); if (percent) { host = user[percent+1, -1]; if (host == "pmdf") domain = "@acme.com"; else { domain = host + "@acme.com"; authoritative = 1; } } else { domain = "@acme.com"; authoritative = 1; } mail1 = user + "@" + domain; template DN: 'dn' cn: 'cdn' sn: 'lastname' mail: 'mail1' description: 'cmts' authoritative: 'authoritative' endtemplate
Example 36-39
Sampleserve_cc.rcp
file
# # cn is first last -- name should be last, first # name = cn[1]; tag = gettag(cn); tag = tag[2]; space = find(" ", name); if (space) name = name[space+1, -1] + ", " + name[1, space]; settag(name, tag); # # don't accidentally generate attributes on a delete entry # if (tag == "!") template name: 'name' endtemplate else { # # mail is user@acme.com. (all mods are non cc users) # addr should be user%pmdf # addr = mail[1]; at = find("@", addr); if (at) addr = addr[1, at]; addr = addr + "%pmdf"; template name: 'name' addr: 'addr' cmts: 'description' endtemplate }
Sample recipe files for cooking and serving IDDS are shown in Example 36-40 and Example 36-41 .
Example 36-40
Samplecook_idds.rcp
file
dn_parts = explodedDN; if ((dn_parts[4] != "Notes") && (dn_parts[4] != "cc")) authoritative = 1; template DN: 'dn' cn: 'cn' sn: 'sn' uid: 'uid' mail: 'mail' description: 'description' authoritative: 'authoritative' endtemplate
Example 36-41
Sampleserve_idds.rcp
file
tag = gettag(DN); if (tag[2]=="!") { template DN: 'DN' endif } else { template DN: 'DN' objectClass: top objectClass: person objectClass: organizationalPerson objectClass: pilotObject objectClass: newPilotPerson objectClass: pmdfPerson objectClass: quipuObject cn: 'cn' sn: 'sn' telephoneNumber: 'telephoneNumber' facsimileTelephoneNumber: 'facsimileTelephoneNumber' seeAlso: 'seeAlso' userPassword: 'userPassword' uid: 'uid' mail: 'mail' description: 'description' userClass: X.500 endtemplate }
Sample recipe files for cooking and serving Lotus Notes are shown in Example 36-42 and Example 36-43 .
Example 36-42
Samplecook_ln.rcp
file
cn = FullName[1]; slash = find("/", cn); if (slash) { ou = cn[slash+1, -1]; cn = cn[1, slash]; } else ou = "acme"; if (cn[3] == "CN=") cn = cn[4, -1]; if (ou[2] == "O=") ou = ou[3, -1]; if (maildomain != "PMDF") { mail = cn; space = find(" ", mail); if (space) { mail = mail[1, space] + "." + mail[space+1, -1]; space = find(" ", mail); if (space) { mail = mail[1, space] + "." + mail[space+1, -1]; space = find(" ", mail); if (space) mail = mail[1, space] + "." + mail[space+1, -1]; } } mail = mail + "@acme.com"; authoritative = 1 } else mail = mailaddress; dnlist = {"cn", cn, "ou", ou, "o", "acme", "c", "nz"}; dn = makedn(dnlist); template DN: 'dn' cn: 'cn' sn: 'LastName' uid: 'shortname' mail: 'mail' description: 'description' authoritative: 'authoritative' endtemplate
Example 36-43
Sampleserve_ln.rcp
file
tag = gettag(DN); tag = tag[2]; fullname = "CN=" + explodedDN[2] + "/O=" + explodedDN[4]; settag(fullname, tag); if (tag == "!") { template FullName: 'fullname' endtemplate } else { template FullName: 'fullname' LastName: 'cn' Form: Person Type: Person description: 'description' MailAddress: 'mailaddress' MailDomain: PMDF endtemplate }