Provider Registry -- Adding an e-mail field

From IHRIS Wiki
Revision as of 09:37, 4 September 2012 by Litlfred (talk | contribs) (Created page with "In this article, we explain how to add the e-mail field to the provider registry. This article was written based on revision 73 of the RHEA Provider Registry [http://bazaar.lau...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

In this article, we explain how to add the e-mail field to the provider registry.

This article was written based on revision 73 of the RHEA Provider Registry source code

Before going through this tutorial, it is suggested that you are already familiar with the following material:


Overview

The provider registry is storing provider data in an LDAP server, openLDAP -- this is our "data store".

In addition to modifying the data store, we will need to modify the user interface. The user interface is based on the I2CE Framework and the iHRIS platform. 

The I2CE form data model that we will be modifying is represented here:

Pr forms.gif
Pr forms.gif

LDAP

For LDAP we have a schema that describes how the data that is stored on the LDAP server. The provider registry has two main things defined in the schema, the providerPerson and providerPost.

In the above data model, the providerPerson is the "person" form and the providerPost is the "post"

As we want to add an e-mail address, we need to decide where we want to add the e-mail address in the data model.  As the e-mail address does not change depening on the posting, it makes sense to add it to the providerPerson


providerPerson schema

You should recall from the Provider Registry on-line course that the providerPerson objectclass has the following schema:

objectclass ( 2.25.128424792425578037463837247958458780699.1  
    NAME 'providerPerson'  
    DESC 'providerPerson'  
    SUP inetOrgPerson  
    STRUCTURAL  
    MUST  ( nid  )
    MAY  ( dateOfBirth $ mutuelle $ csr $ passport $ countryName   $ locationCode )   ) 

The line with "MUST" tells us that the providerPerson has a required field of national id (nid). The line with "MAY" some optional data fields (attributes in LDAP terminology). The line with "SUP" tells us that the providerPost inherits the definition of the "inetOrgPerson" objectclass.

Let us look at the inetOrgPerson (internet organizational person) object class:

objectclass     ( 2.16.840.1.113730.3.2.2
    NAME 'inetOrgPerson'
        DESC 'RFC2798: Internet Organizational Person'
    SUP organizationalPerson
    STRUCTURAL
        MAY (
                audio $ businessCategory $ carLicense $ departmentNumber $
                displayName $ employeeNumber $ employeeType $ givenName $
                homePhone $ homePostalAddress $ initials $ jpegPhoto $
                labeledURI $ mail $ manager $ mobile $ o $ pager $
                photo $ roomNumber $ secretary $ uid $ userCertificate $
                x500uniqueIdentifier $ preferredLanguage $
                userSMIMECertificate $ userPKCS12 )
        )

Looking through the optional fields for the inetOrgPerson, we see a an attribute "mail" that we may be able to use. So let's investigate this.

A good website for looking up LDAP documentation is www.zytrax.com. Here we can find the inetOrgPerson schema. If you click on the "mail" attribute on this page, you will be take to the definition of the mail attribute:

attributetype ( 0.9.2342.19200300.100.1.3
   NAME ( 'mail' 'rfc822Mailbox' )
   DESC 'RFC1274: RFC822 Mailbox'
   EQUALITY caseIgnoreIA5Match
   SUBSTR caseIgnoreIA5SubstringsMatch
   SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{256} )

We see here that the mail attribute is the same as a RFC 822 Mailbox, which is the standard for email addresses.

So we are in luck! There is an e-mail address attribute already in our LDAP providerPerson

Schema Locations

If you want to look in more detail at the LDAP schema files on your file system, then (on an Ubuntu system) the inetOrgPerson object class is defined in the file /etc/ldap/schema/inetorgperson.schema.

The providerPerson object class is defined in the prrovider registry source code here. Note, that with the installation instructions for the provider registry we have copied this file over to the /etc/ldap/schema directory.