Index: /WAeUP_SRP/trunk/Students.py
===================================================================
--- /WAeUP_SRP/trunk/Students.py	(revision 421)
+++ /WAeUP_SRP/trunk/Students.py	(revision 422)
@@ -20,4 +20,11 @@
 i_home = Globals.INSTANCE_HOME
 MAX_TRANS = 1000
+
+def generateStudentId():
+    import random
+    r = random.random()
+    return "%c%d" % (r.choice('ABCDEFGIJHKLMNOPQRSTUVWXYZ'),r.randint(99999,1000000))
+    
+    
 
 class StudentsFolder(CPSDocument): ###(
@@ -48,11 +55,10 @@
             logger.error('Error reading %s.csv' % name)
             return
-        l = self.portal_catalog({'meta_type': "Student"})
-        studs = {}
+        l = self.portal_catalog({'meta_type': "StudentClearance",})
+        matrics = []
         for s in l:
-            studs[s.id] = s.getObject()
+            matrics.append(s.getObject().getContent().matric_no)
         l = self.portal_catalog({'meta_type': "Certificate"})
         certs = {}
-        students_added = []
         for c in l:
             certs[c.id] = c.getObject()
@@ -67,11 +73,4 @@
                 continue
             certcode = makeCertificateCode(student.get('CourseMajor'))
-##            if sid in students_added:
-##                em = 'Student with ID %(MatricNo)s %(fullname)s already exists in this import\n' % student
-##                logger.info(em)
-##                no_import.write(em)
-##                no_import.write('"%(MatricNo)s","%(EntryRegNo)s","%(CurrentSession)s","%(StudentLevel)s","%(fullname)s","%(FirstName)s","%(MiddleName)s","%(Lastname)s","%(FormerSurname)s","%(Sex)s","%(Nationality)s","%(State)s","%(LGA)s","%(PermanentAddress)s","%(PermanentAddressCity)s","%(CampusAddress)s","%(PhoneNumber)s","%(Emailaddress)s","%(Mode)s","%(CourseMajor)s","%(Faculty)s","%(Dept)s"\n' % student)
-##                continue
-            s = studs.get(sid,None)
             if certcode not in certs.keys():
                 em = 'Certificate with ID %s %s not found\n' % (certcode, student.get('CourseMajor'))
@@ -89,17 +88,23 @@
                 no_import.write('"%(MatricNo)s","%(EntryRegNo)s","%(CurrentSession)s","%(StudentLevel)s","%(fullname)s","%(FirstName)s","%(MiddleName)s","%(Lastname)s","%(FormerSurname)s","%(Sex)s","%(Nationality)s","%(State)s","%(LGA)s","%(PermanentAddress)s","%(PermanentAddressCity)s","%(CampusAddress)s","%(PhoneNumber)s","%(Emailaddress)s","%(Mode)s","%(CourseMajor)s","%(Faculty)s","%(Dept)s"\n' % student)
                 continue
-            if s is None:
+            matric_no = student.get('MatricNo')
+            if matric_no not in matrics:
+                matrics.append(matric_no)
+                sid = generateStudentId()
                 #self.log('Creating Faculty %(id)s = %(Title)s' % faculty)
-                logger.info('Creating Student with ID %(MatricNo)s %(fullname)s' % student)
+                logger.info('Creating Student with ID %(sid)s Matric_no %(matric_no)s ' % vars())
                 students_folder.invokeFactory('Student', sid)
                 s = getattr(self,sid)
-                students_added.append(sid)
-                studs[sid] = s
                 s.invokeFactory('StudentPersonal','personal')
                 sp = s.personal
                 d = {'Title': 'Personal Data'}
-                d['matricel_no'] = student.get('MatricNo')
-                d['entry_reg_no'] = student.get('EntryRegNo')
-                d['fullname'] = student.get('fullname')
+                s.invokeFactory('StudentClearance','clearance')
+                sc = s.personal
+                dc = {'Title': 'Clearance Data'}
+                dc['matric_no'] = matric_no
+                dc['jamb_reg_no'] = student.get('EntryRegNo')
+                dc['lga'] = student.get('LGA')
+                dc['nationality'] = student.get('Nationality')
+                dc['email'] = student.get('Emailaddress')
                 d['firstname'] = student.get('FirstName')
                 d['middlename'] = student.get('MiddleName')
@@ -107,13 +112,12 @@
                 d['former_surname'] = student.get('FormerSurname')
                 d['sex'] = student.get('Sex') == 'F'
-                d['nationality'] = student.get('Nationality')
-                d['state'] = student.get('State')
-                d['lga'] = student.get('LGA')
-                d['street'] = student.get('PermanentAddress')
-                d['city'] = student.get('PermanentAddressCity')
+                d['for_state'] = student.get('State')
+                d['for_lga'] = student.get('LGA')
+                d['perm_address'] = student.get('PermanentAddress')
+                d['perm_city'] = student.get('PermanentAddressCity')
                 d['campus_address'] = student.get('CampusAddress')
                 d['phone'] = student.get('PhoneNumber')
-                d['email'] = student.get('Emailaddress')
                 sp.getContent().edit(mapping=d)
+                sc.getContent().edit(mapping=dc)
                 #
                 # Study Course
@@ -122,8 +126,8 @@
                 sc = s.study_course
                 d = {}
-                d['matricel_no'] = student.get('MatricNo')
-                d['entry_reg_no'] = student.get('EntryRegNo')
-                d['faculty'] = student.get('Faculty')
-                d['department'] = student.get('Dept')
+                #d['matricel_no'] = student.get('MatricNo')
+                #d['entry_reg_no'] = student.get('EntryRegNo')
+                #d['faculty'] = student.get('Faculty')
+                #d['department'] = student.get('Dept')
                 d['course_major'] = certcode
                 css = student.get('CurrentSession') or '2004-2005'
@@ -158,6 +162,6 @@
                 no_import.write('"%(MatricNo)s","%(EntryRegNo)s","%(CurrentSession)s","%(StudentLevel)s","%(fullname)s","%(FirstName)s","%(MiddleName)s","%(Lastname)s","%(FormerSurname)s","%(Sex)s","%(Nationality)s","%(State)s","%(LGA)s","%(PermanentAddress)s","%(PermanentAddressCity)s","%(CampusAddress)s","%(PhoneNumber)s","%(Emailaddress)s","%(Mode)s","%(CourseMajor)s","%(Faculty)s","%(Dept)s"\n' % student)
             if tr_count > MAX_TRANS:
-                #transaction.commit()
-                #em = '>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>Transaction commited\n' % student
+                transaction.commit()
+                em = 'Transaction commited\n' % student
                 logger.info(em)
                 tr_count = 0
Index: /WAeUP_SRP/trunk/Widgets.py
===================================================================
--- /WAeUP_SRP/trunk/Widgets.py	(revision 421)
+++ /WAeUP_SRP/trunk/Widgets.py	(revision 422)
@@ -151,4 +151,6 @@
         
         valid = CPSStringWidget.validate(self, datastructure, **kw)
+        id_pat_str = r"\S"
+        inv_id_pat = compile(r"^%s$" % id_pat_str)
         if not valid:
             return 0
@@ -157,5 +159,7 @@
             value = datastructure[widget_id].upper()
             err = 0
-            if hasattr(self.aq_parent,value):
+            if value.split() > 1:
+                err = 'Invalid Id (Id contains space(s)' 
+            elif hasattr(self.aq_parent,value):
                 err = 'An object with the Id %s already exists in this context' % (value) 
             if err:
Index: /WAeUP_SRP/trunk/profiles/default/layouts/department.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/layouts/department.xml	(revision 421)
+++ /WAeUP_SRP/trunk/profiles/default/layouts/department.xml	(revision 422)
@@ -33,4 +33,5 @@
    <element value="code"/>
   </property>
+  <property name="is_required">True</property>
   <property name="label">Object ID</property>
   <property name="label_edit">Object ID</property>
Index: /WAeUP_SRP/trunk/profiles/default/workflows.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/workflows.xml	(revision 421)
+++ /WAeUP_SRP/trunk/profiles/default/workflows.xml	(revision 422)
@@ -57,13 +57,4 @@
    <bound-workflow workflow_id="section_folder_wf"/>
   </type>
-  <type type_id="Jamb">
-   <bound-workflow workflow_id="waeup_base_wf"/>
-  </type>
-  <type type_id="Members Workspace">
-   <bound-workflow workflow_id="workspace_folder_wf"/>
-  </type>
-  <type type_id="Section">
-   <bound-workflow workflow_id="section_folder_wf"/>
-  </type>
   <type type_id="Semester">
    <bound-workflow workflow_id="section_folder_wf"/>
@@ -75,9 +66,9 @@
    <bound-workflow workflow_id="waeup_base_wf"/>
   </type>
-  <type type_id="StudentElegibility">
-   <bound-workflow workflow_id="waeup_base_wf"/>
+  <type type_id="StudentClearance">
+   <bound-workflow workflow_id="section_folder_wf"/>
   </type>
-  <type type_id="StudentEligibility">
-   <bound-workflow workflow_id="waeup_base_wf"/>
+  <type type_id="StudentAdmission">
+   <bound-workflow workflow_id="section_folder_wf"/>
   </type>
   <type type_id="StudentPersonal">
