Tuesday, July 24, 2007

LDAP SCHEMA DESIGN

COLLEGE LDAP Schema - CASE STUDY

Description

This document describes about design of ldap schema for a college administration department. College will have various departments like mechanical, chemical, Electronics, civil etc.. Each department will of various branches. For example electronics department can have Electronics & Communication Engineering, Electronics & Electrical Engineering, Electronics & Instrumentation Engineering, Computer Science Engineering, Computer Science & Information Technology, Electronics & Computer Science etc.. Each branch will have in charge, number of students, teaching and non teaching staff. Each student will be attending set of subjects for an academic year. Each teaching staff & non teaching staff will have salary details. Framing the requirements into hierarchical structure, following LDAP tree depicts the tree structure.

Note: the oids used in this article are selected randomly and they are for temporary use and please don't use oid's mentioned in this article. Use your own oids. The oids in this article will be changed in the next release

Schema design

From the above description, the objectclasses identified are COLLEGE, DEPARTMENT, BRANCH, ACADEMIC, STUDENT, SUBJECTS, STAFF and SALARY and each object class consists of following attributes.

COLLEGE DEPARTMENT BRANCH ACADEMIC STUDENT
collegeName deptName branchName academicYear studentName
collegePrincipal deptHead BranchHead studentNumber
collegePresident branchNumberOfStudents studentAddress
collegeSecretary studentAcademicYear
collegeBoardMember studemtCourse
studentStatus
studentYear

SUBJECTS STAFF SALARY
subjectName staffName salaryBASIC
subjectMarks staffID salaryDA
subjectCode staffAddress salaryHRA
staffQualification salaryAllowance
staffDesignation salaryTotal
staffBranch
staffType

The top node is college with unique DN as o=college. College will have different departments like Civil, Electronics, Mechanical etc.. The number of child nodes depends on the number of departments in the college. Let us take, college has two departments Civil and Electronics. Then the o=college parent node will have two child nodes deptName=Civil and deptName=Electronics. Each node can be identified as deptName=Civil,o=college and deptName=Electronics,o=college. If searched with DN deptName=Electronics,o=college, attributes at this entry will be retrieved. The subtree is

o=college | --------------------------------- | | deptName=Civil deptName=Electronics

Consider the department Electronics has three branches ECE, EEE & CSE. The DN for each branch will be branchName=ECE,deptName=Electronics,o=college, branchName=EEE,,deptName=Electronics,o=college and branchName=CSE,,deptName=Electronics,o=college.

Now take the branch ECE, each branch will have students and staff. Each student belongs to a particular year and each staff belongs to either teaching or non-teaching staff. So consider the sub tree under the dn branchName=ECE,deptName=Electronics,o=college is branchName=ECE | ----------------------------------------------------- | | ou=student ou=staff | | ------------------------------  p; --------------------------- | | | academicYear=1999-2000 academicaYear=2000-2001 ou=teaching ou=nonteaching

Each academicYear consists of students and each student will be studying the subjects, each staff will have salary details and subjects he/she is handling. The subtrees for academicYear, teaching and nonteaching are

ademicYear=1999-2000 ou=teaching ou=nonteaching | | | ---------------------------- & ----------------- ; ----------------- | | | | | | studentNumber=100 studentNumber=101 staffID=200 staffID201 staffID=300 staffID=301 | | | ---------------------- & ----------------- ou=Salary Details | | | | subjectCode=001 subjectCode=002 ou=Salary Details subjectCode=001

COLLEGE LDAP Tree

o=college | --------------------------------- | | deptName=Civil deptName=Electronics | ------------------------------------------ | | | branchName=EEE branchName=ECE branchName=CSE | ----------------------------------------------------- | | ou=student ou=staff | | ------------------------------  p; --------------------------- | | | academicYear=1999-2000 academicaYear=2000-2001 ou=teaching ou=nonteaching | | | ---------------------------- & ----------------- ; ----------------- | | | | | | studentNumber=100 studentNumber=101 staffID=200 staffID201 staffID=300 staffID=301 | | | ---------------------- & ----------------- ou=Salary Details | | | | subjectCode=001 subjectCode=002 ou=Salary Details subjectCode=001

Attributes

This section contains attribute file for College LDAP tree

attributetype ( 1.3.6.1.4.1.15490.1.1 NAME 'collegeName' DESC 'college name' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.15490.1.2 NAME 'collegePrincipal' DESC 'college principal name' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.15490.1.3 NAME 'collegePresident' DESC 'college president' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.15490.1.4 NAME 'collegeSecretary' DESC 'college secretary name' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.15490.1.5 NAME 'collegeBoardMember' DESC 'board member name' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 ) attributetype ( 1.3.6.1.4.1.15490.1.6 NAME 'deptName' DESC 'description' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.15490.1.7 NAME 'deptHead' DESC 'description' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.15490.1.8 NAME 'branchName' DESC 'board member name' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE) attributetype ( 1.3.6.1.4.1.15490.1.9 NAME 'branchHead' DESC 'description' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.15490.1.10 NAME 'branchNumberOfStudents' DESC 'description' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.15490.1.11 NAME 'studentName' DESC 'description' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.15490.1.12 NAME 'studentNumber' DESC 'description' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15) attributetype ( 1.3.6.1.4.1.15490.1.13 NAME 'studentAddress' DESC 'description' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.15490.1.14 NAME 'studentAcademicYear' DESC 'description' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.15490.1.15 NAME 'studentCourse' DESC 'description' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE) attributetype ( 1.3.6.1.4.1.15490.1.16 NAME 'studentStatus' DESC 'description' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.15490.1.17 NAME 'studentYear' DESC 'description' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.15490.1.18 NAME 'subjectName' DESC 'description' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.15490.1.19 NAME 'subjectMarks' DESC 'description' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.15490.1.20 NAME 'subjectCode' DESC 'description' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.15490.1.21 NAME 'staffName' DESC 'description' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.15490.1.22 NAME 'staffID' DESC 'description' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.15490.1.23 NAME 'staffAddress' DESC 'description' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.15490.1.24 NAME 'staffQualification' DESC 'description' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.15490.1.25 NAME 'staffDesignation' DESC 'description' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.15490.1.26 NAME 'staffDepartment' DESC 'description' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.15490.1.27 NAME 'staffBranch' DESC 'description' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.15490.1.28 NAME 'staffType' DESC 'description' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.15490.1.29 NAME 'salaryBasic' DESC 'description' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.15490.1.30 NAME 'salaryDA' DESC 'description' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.15490.1.31 NAME 'salaryHRA' DESC 'description' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.15490.1.32 NAME 'salaryAllowance' DESC 'description' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.15490.1.33 NAME 'salaryTotal' DESC 'description' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.15490.1.34 NAME 'academicYear' DESC 'description' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )

Object class

This section gives objectclass details for College LDAP tree. objectclass ( 1.3.6.1.4.1.15490.2.1 NAME 'objCollege' SUP top STRUCTURAL DESC 'object class' MUST (collegeName $ collegePrincipal $ collegePresident $ collegeSecretary ) MAY (collegeBoardMember ) ) objectclass ( 1.3.6.1.4.1.15490.2.2 NAME 'objDepartment' SUP top STRUCTURAL DESC 'object class' MUST (deptName $ deptHead ) ) objectclass ( 1.3.6.1.4.1.15490.2.3 NAME 'objBranch' SUP top STRUCTURAL DESC 'object class' MUST (branchHead $ branchName $ branchNumberOfStudents ) ) objectclass ( 1.3.6.1.4.1.15490.2.4 NAME 'objStudent' DESC 'object class' SUP top STRUCTURAL MUST ( studentName $ studentNumber $ studentAddress $ studentAcademicYear $ studentCourse $ studentStatus $ studentYear ) ) objectclass ( 1.3.6.1.4.1.15490.2.5 NAME 'objSubject' DESC 'object class' SUP top STRUCTURAL MUST ( subjectCode $subjectName $ subjectMarks ) ) objectclass ( 1.3.6.1.4.1.15490.2.6 NAME 'objStaff' DESC 'object class' SUP top STRUCTURAL MUST ( staffName $ staffID $ staffAddress $ staffQualification $ staffDepartment $ staffBranch $ staffType) ) objectclass ( 1.3.6.1.4.1.15490.2.7 NAME 'objSalary' SUP top STRUCTURAL DESC 'object class' MUST ( salaryBASIC $ salaryDA $ salaryHRA $ salaryAllowance $ salaryTotal) ) objectclass ( 1.3.6.1.4.1.15490.2.8 NAME 'objAcademic' DESC 'object class' SUP top STRUCTURAL MUST ( academicYear ) )

Sample LDIF File

This section gives sample ldif file for creating LDAP tree,

dn: o=college o: college objectclass: organization objectclass: objCollege objectclass: top Description: top object class collegeName: ABC Engineering college collegePrincipal: John Peter collegePresident: Samual A collegeSecretary: Benson K collegeBoardMember: Jennifer King collegeBoardMember: George K Danial

dn: deptName=Civil,o=college deptName: Civil objectclass: objDepartment objectclass: top deptHead: abc

dn: deptName=Electronics,o=college deptName: Civil objectclass: objDepartment objectclass: top deptHead=defg

dn: branchName=ECE,deptName=Electronics,o=college branchName: ECE objectclass: top objectclass: objBranch branchHead: kkk branchNumberOfStudents: 50

dn: ou=student,branchName=ECE, deptName=Electronics,o=college ou: student objectclass: top objectclass: organizationalUnit

dn: ou=staff,branchName=ECE, deptName=Electronics,o=college ou: staff objectclass: top objectclass: organizationalUnit

dn: academicYear=1999-2000,ou=student,branchName=ECE, deptName=Electronics,o=college academicYear: 1999-2000 objectclass: top objectclass: objAcademic

dn: academicYear=2000-2001,ou=student,branchName=ECE, deptName=Electronics,o=college academicYear: 2000-2001 objectclass: top objectclass: objAcademic

dn: studentNumber=100,academicYear=1999-2000,ou=student,branchName=ECE, deptName=Electronics,o=college studentNumber: 100 objectclass: top objectclass: objStudent studentName: abc studentAddress: abc studentAcademicYear: 1999-2000 studentCourse: BS studentStatus: Active studentYear: 1999

dn: studentNumber=101,academicYear=1999-2000,ou=student,branchName=ECE, deptName=Electronics,o=college studentNumber: 101 objectclass: top objectclass: objStudent studentName: def studentAddress: def studentAcademicYear: 1999-2000 studentCourse: BS studentStatus: Active studentYear: 1999

dn: subjectCode=001,studentNumber=101,academicYear=1999-2000,ou=student,branchName=ECE, deptName=Electronics,o=college subjectCode: 001 objectclass: top objectclass: objSubject subjectName: Mathematics-1 subjectMarks: 90

dn: subjectCode=002,studentNumber=101,academicYear=1999-2000,ou=student,branchName=ECE, deptName=Electronics,o=college subjectCode: 002 objectclass: top objectclass: objSubject subjectName: Electrical Technology subjectMarks: 85

dn: ou=teaching,ou=staff,branchName=ECE, deptName=Electronics,o=college ou: teaching objectclass: top objectclass: organizationalUnit

dn: ou=nonteaching,ou=staff,branchName=ECE, deptName=Electronics,o=college ou: nonteaching objectclass: top objectclass: organizationalUnit

dn: staffID=001,ou=teaching,ou=staff,branchName=ECE, deptName=Electronics,o=college staffID: 001 objectclass: top objectclass: objStaff staffName: abc

staffAddress: sdflasjflasd staffQualification: MS, Phd staffDepartment: Electronics staffBranch: ECE staffType: teaching

dn: staffID=002,ou=teaching,ou=staff,branchName=ECE, deptName=Electronics,o=college staffID: 002 objectclass: top objectclass: objStaff staffName: def staffAddress: saas staffQualification: MS, Phd staffDepartment: Electronics staffBranch: ECE staffType: teaching

dn: staffID=101,ou=nonteaching,ou=staff,branchName=ECE, deptName=Electronics,o=college staffID: 101 objectclass: top objectclass: objStaff staffName: abc staffAddress: sdflasjflasd staffQualification: BS staffDepartment: Electronics staffBranch: ECE staffType: nonteaching

dn: staffID=102,ou=nonteaching,ou=staff,branchName=ECE, deptName=Electronics,o=college staffID: 102 objectclass: top objectclass: objStaff staffName: def staffAddress: saas staffQualification: B.Com staffDepartment: Electronics staffBranch: ECE staffType: nonteaching

dn: ou=Salary Details,staffID=002,ou=teaching,ou=staff,branchName=ECE, deptName=Electronics,o=college ou: Salary Details objectclass: top objectclass: objSalary objectclass: organizationalUnit salaryBasic: 10000 salaryDA: 20000 salaryHRA: 4000 salaryAllowance: 6000 salaryTotal: 40000

dn: subjectCode=001,staffID=002,ou=teaching,ou=staff,branchName=ECE, deptName=Electronics,o=college subjectCode: 001 objectclass: top objectclass: objSubject subjectName: Electrinics-1 subjectMarks: 100

dn: ou=Salary Details,staffID=102,ou=nonteaching,ou=staff,branchName=ECE, deptName=Electronics,o=college ou: Salary Details objectclass: top objectclass: objSalary objectclass: organizatinalUnit salaryBasic: 1000 salaryDA: 2000 salaryHRA: 400 salaryAllowance: 600 salaryTotal: 4000

0 Comments: