Index: /WAeUP_SRP/trunk/WAeUPTool.py
===================================================================
--- /WAeUP_SRP/trunk/WAeUPTool.py	(revision 1746)
+++ /WAeUP_SRP/trunk/WAeUPTool.py	(revision 1747)
@@ -28,4 +28,7 @@
 from OFS.SimpleItem import SimpleItem
 
+from Products.CPSSchemas.DataStructure import DataStructure
+from Products.CPSSchemas.DataModel import DataModel
+from Products.CPSSchemas.StorageAdapter import MappingStorageAdapter
 from Products.CMFCore.ActionProviderBase import ActionProviderBase
 from Products.CMFCore.permissions import View
@@ -34,4 +37,5 @@
 from Products.CMFCore.utils import UniqueObject
 from Products.CMFCore.URLTool import URLTool
+from Products.CMFCore.utils import getToolByName
 from Students import makeCertificateCode
 from Globals import package_home,INSTANCE_HOME
@@ -276,69 +280,4 @@
         self.portal_workflow.doActionFor(student_obj,wfaction)
         student_obj.manage_setLocalRoles(sid, ['Owner',])
-##        matric_no = dict.get('matric_no')
-##        email = dict.get('email')
-##        #level = dict.get('level')
-##        jamb_reg_no = dict.get('jamb_reg_no')
-##        study_course = dict.get('study_course')
-##        self.portal_workflow.doActionFor(student_obj,wfaction)
-##        student_obj.manage_setLocalRoles(sid, ['Owner',])
-##        student_obj.invokeFactory('StudentApplication','application')
-##        application = student_obj.application
-##        self.portal_workflow.doActionFor(application,'open',dest_container=application)
-##        da = {'Title': 'Application Data'}
-##        student_obj.invokeFactory('StudentPersonal','personal')
-##        da['entry_mode'] = entry_mode
-##        personal = student_obj.personal
-##        self.portal_workflow.doActionFor(personal,'open',dest_container=personal)
-##        dp = {'Title': 'Personal Data'}
-##        student_obj.invokeFactory('StudentClearance','clearance')
-##        clearance = student_obj.clearance
-##        self.portal_workflow.doActionFor(clearance,'open',dest_container=clearance)
-##        dc = {'Title': 'Clearance/Eligibility Record'}
-##        dc['matric_no'] = matric_no
-##        da['app_email'] = dp['email'] = email
-##        da['jamb_reg_no'] = jamb_reg_no
-##        dp['firstname'] = dict.get('firstname')
-##        dp['middlename'] = dict.get('middlename')
-##        dp['lastname'] = dict.get('lastname')
-##        da['jamb_lastname'] = "%(firstname)s %(middlename)s %(lastname)s" % dict
-##        sex = dict.get('sex')
-##        if sex:
-##            da['jamb_sex'] = 'F'
-##        else:
-##            da['jamb_sex'] = 'M'
-##        dp['sex'] = sex
-##        application.getContent().edit(mapping=da)
-##        self.portal_workflow.doActionFor(application,'close',dest_container=application)
-##        personal.getContent().edit(mapping=dp)
-##        clearance.getContent().edit(mapping=dc)
-##        self.portal_workflow.doActionFor(clearance,'close',dest_container=clearance)
-####        catd = {}
-####        catd['id'] = sid
-####        catd['entry_mode']= entry_mode
-####        catd['email'] = email
-####        catd['jamb_reg_no'] = jamb_reg_no
-####        catd['matric_no'] = matric_no
-####        catd['name'] = "%(firstname)s %(middlename)s %(lastname)s" % dp
-####        catd['sex'] = dp['sex']
-####        catd['level'] = level
-####        certificate_brain = self.getCertificateBrain(study_course)
-####        if certificate_brain:
-####            cpath = certificate_brain.getPath().split('/')
-####            catd['faculty'] = cpath[-4]
-####            catd['department'] = cpath[-3]
-####            catd['course'] = study_course
-####        self.students_catalog.addRecord(**catd)
-##        #
-##        # Study Course
-##        #
-##        student_obj.invokeFactory('StudentStudyCourse','study_course')
-##        sc = student_obj.study_course
-##        self.portal_workflow.doActionFor(sc,'open',dest_container=sc)
-##        dsc = {}
-##        dsc['study_course'] = study_course
-##        #dsc['current_level'] = level
-##        sc.getContent().edit(mapping=dsc)
-##
         return sid,password
     ###)
@@ -757,9 +696,52 @@
     ###)
 
+    security.declareProtected(ModifyPortalContent,'create_student') ###(
+    def create_student(self,dict):
+        "create a students data"
+        logger = logging.getLogger('WAeUPTool.create_student')
+        students_folder = self.portal_url.getPortalObject().campus.students
+        jamb_reg_no = dict.get('jamb_reg_no',None)
+        if jamb_reg_no:
+            res = self.students_catalog(jamb_reg_no = jamb_reg_no)
+            if res:
+                return '',"jamb_reg_no exists" 
+        matric_no = dict.get('matric_no',None)
+        if matric_no:
+            res = self.students_catalog(matric_no = matric_no)
+            if res:
+                return '',"matric_no exists" 
+        sid = self.waeup_tool.generateStudentId('?')
+        students_folder.invokeFactory('Student', sid)
+        student_obj = getattr(students_folder,sid)
+        #password = self.generatePassword()
+        #self.makeStudentMember(sid,password)
+        f2t = self.student_field2types
+        for pt in f2t.keys():
+            student_obj.invokeFactory(pt,f2t[pt]['id'])
+            sub_obj = getattr(student_obj,f2t[pt]['id'])
+            sub_doc = sub_obj.getContent()
+            self.portal_workflow.doActionFor(sub_obj,'open',dest_container=sub_obj)
+            d = {'Title': f2t[pt]['title']}
+            for field in f2t[pt]['fields']:
+                d[field] = dict.get(field,'') 
+            if pt == 'StudentPersonal':
+                d['sex'] = dict.get('sex') == 'F'
+            sub_doc.edit(mapping = d)
+            self.portal_workflow.doActionFor(sub_obj,'close',dest_container=sub_obj)
+##        entry_session = dict.get('entry_session')
+##        wfaction = 'return'
+##        if entry_session == self.getSessionId():
+##            wfaction = 'admit'
+##        self.portal_workflow.doActionFor(student_obj,wfaction)
+        student_obj.manage_setLocalRoles(sid, ['Owner',])
+        return sid,''
+    ###)
+
     security.declareProtected(ModifyPortalContent,"importData")###(
-    def importData(self,name):
+    def importData(self,filename,name):
         """load data from CSV values"""
         import transaction
         import random
+        logger = logging.getLogger('WAeUPTool.importData')
         current = DateTime.DateTime().strftime("%d-%m-%y_%H_%M_%S")
         students_folder = self.portal_url.getPortalObject().campus.students
@@ -767,24 +749,28 @@
         tr_count = 1
         total = 0
-        from pdb import set_trace;set_trace()
         iname = "import_%s" % name 
-        schema = getattr(self.portal_schemas,iname ,None)
+        stool = getToolByName(self, 'portal_schemas')
+        ltool = getToolByName(self, 'portal_layouts')
+        schema = stool._getOb(iname)
         if schema is None:
-            logger.error('No such schema %s' % iname)
+            logger.error('No such schema import_%s' % iname)
             return
-        layout = getattr(self.portal_layouts,iname,None)
+        layout = ltool._getOb(iname)
         if layout is None:
-            logger.error('No such layout %s' % iname)
+            logger.error('No such layout import_%s' % iname)
             return
         validators = {}
         for widget in layout.keys():
             validators[widget] = layout[widget].validate  
-        no_import = []
+        creator = getattr(self, 'create_%s' % name,None)
+        if creator is None:
+            logger.error('No creator function create_%s' % name)
+            return
+        not_imported = []
         imported = []
-        logger = logging.getLogger('WAeUPTool.importData')
         try:
-            items = csv.DictReader(open("%s/import/%s.csv" % (i_home,name),"rb"))
+            items = csv.DictReader(open("%s/import/%s.csv" % (i_home,filename),"rb"))
         except:
-            logger.error('Error reading %s.csv' % name)
+            logger.error('Error reading %s.csv' % filename)
             return
         for item in items:
@@ -792,4 +778,6 @@
             if start:
                 start = False
+                adapters = [MappingStorageAdapter(schema, item)]
+                dm = DataModel(item, adapters,context=self)
                 logger.info('Start importing from %s.csv' % name)
                 import_keys = item.keys()
@@ -802,17 +790,32 @@
                     logger.error('%s not in layout.' % diff_set)
                     return
-                s = ','.join(['"%s"' % fn for fn in import_keys])
+                s = '"id",'+','.join(['"%s"' % fn for fn in import_keys])
                 imported.append(s)
-                no_import.append('%s,"Error"' % s)
+                not_imported.append('%s,"Error"' % s)
                 format = ','.join(['"%%(%s)s"' % fn for fn in import_keys])
                 format_error = format + ',"%(Error)s"'
+            ds = DataStructure(data=item,datamodel=dm)
+            error_string = ""
             for k in import_keys:
-                if validators[k](item):
-                    pass
+                if not validators[k](ds):
+                    error_string += " %s : %s" % (k,ds.getError(k))
+            if not error_string:
+                item['id'],error = creator(dm)
+                if error:
+                    error_string += error
+            if error_string:
+                item['Error'] = error_string
+                not_imported.append(format_error % item)
+            else:
+                imported.append(format % dm)
             if tr_count > 1000:
-                if len(no_import) > 0:
-                    open("%s/import/%s_not_imported%s.csv" % (i_home,name,current),"a").write(
-                             '\n'.join(no_import) + '\n')
-                    no_import = []
+                if len(not_imported) > 0:
+                    open("%s/import/%s_not_imported%s.csv" % (i_home,filename,current),"a").write(
+                             '\n'.join(not_imported) + '\n')
+                    not_imported = []
+                if len(imported) > 0:
+                    open("%s/import/%s_imported%s.csv" % (i_home,filename,current),"a").write(
+                             '\n'.join(not_imported) + '\n')
+                    imported = []
                 em = '%d transactions committed\n' % (tr_count)
                 transaction.commit()
@@ -821,6 +824,10 @@
                 total += tr_count
                 tr_count = 0
-        open("%s/import/%s_not_imported%s.csv" % (i_home,name,current),"a").write(
-                                                '\n'.join(no_import))
+        if len(imported) > 1:
+            open("%s/import/%s_imported%s.csv" % (i_home,filename,current),"a").write(
+                                                '\n'.join(imported))
+        if len(not_imported) > 1:
+            open("%s/import/%s_not_imported%s.csv" % (i_home,filename,current),"a").write(
+                                                '\n'.join(not_imported))
         return self.REQUEST.RESPONSE.redirect("%s" % self.REQUEST.get('URL1'))
     ###)
Index: /WAeUP_SRP/trunk/Widgets.py
===================================================================
--- /WAeUP_SRP/trunk/Widgets.py	(revision 1746)
+++ /WAeUP_SRP/trunk/Widgets.py	(revision 1747)
@@ -14,4 +14,5 @@
 from AccessControl import getSecurityManager
 from Products.WAeUP_SRP.Students import getStudentByRegNo
+from Products.WAeUP_SRP.Academics import makeCertificateCode
 from re import compile
 import logging
@@ -255,23 +256,22 @@
         #from Products.zdb import set_trace
         #set_trace()
-        valid = CPSStringWidget.validate(self, datastructure, **kw)
+##        valid = CPSStringWidget.validate(self, datastructure, **kw)
+##        if not valid:
+##            return 0
+        widget_id = self.getWidgetId()
+        value = makeCertificateCode(datastructure[widget_id]).upper()
         id_pat_str = r"\S"
         inv_id_pat = compile(r"^%s$" % id_pat_str)
-        if not valid:
-            return 0
-        else:
-            widget_id = self.getWidgetId()
-            value = datastructure[widget_id].upper()
-            err = 0
-            if len(value.split()) > 1:
-                err = 'Invalid Id, Id contains space(s).'
-            elif not self.portal_catalog(portal_type='Certificate',id=value):
-                err = 'No such certificate'
-            if err:
-                datastructure.setError(widget_id, err)
-            else:
-                datamodel = datastructure.getDataModel()
-                datamodel[self.fields[0]] = value
-            return not err
+        err = 0
+        if len(value.split()) > 1:
+            err = 'Invalid Id, Id contains space(s).'
+        elif not self.portal_catalog(portal_type='Certificate',id=value):
+            err = 'No such certificate'
+        if err:
+            datastructure.setError(widget_id, err)
+        else:
+            datamodel = datastructure.getDataModel()
+            datamodel[self.fields[0]] = value
+        return not err
 
 InitializeClass(StudyCourseWidget)
@@ -342,4 +342,5 @@
          )
     reference = "student"
+    matric_no_catalog = 'returning_import'
     check_fields = ("Firstname", "Middlename","Lastname")
     def validate(self, datastructure, **kw):
@@ -347,9 +348,9 @@
         logger = logging.getLogger('Widgets.SecretWidget.validate')
         valid = CPSStringWidget.validate(self, datastructure, **kw)
-        #import pdb;pdb.set_trace()
         widget_id = self.getWidgetId()
         value = datastructure[widget_id].upper()
         err = 0
         record = datastructure.get(self.reference,None)
+        #import pdb;pdb.set_trace()
         if not valid or len(value) < 2:
             err = 'Invalid String'
@@ -363,7 +364,8 @@
                 if len(cv.split()) > 1:
                     for splited in cv.split():
-                        cvs.append(splited)
+                        cvs.append(splited.strip())
                 else:
                     cvs.append(cv)
+            for cv in cvs:
                 if cv  == value.upper():
                     found = True
@@ -391,11 +393,21 @@
     """ MatricNo Widget"""
     meta_type = "MatricNo Widget"
+
+    _properties = CPSStringWidget._properties + (
+        {'id': 'matric_no_catalog', 'type': 'string', 'mode': 'w',
+         'label': 'Catalog to search for MatricNo'},
+        { 'id': 'results_catalog', 'type': 'string', 'mode': 'w',
+         'label': 'Results Catalog'},
+         )
+    matric_no_catalog = "" #the catalog to search for matric_no
+    results_import = "results_import" #results catalog
+
     def validate(self, datastructure, **kw):
         """Validate datastructure and update datamodel."""
+        #import pdb;pdb.set_trace()
         valid = CPSStringWidget.validate(self, datastructure, **kw)
         logger = logging.getLogger('Widgets.MatricNoWidget.validate')
-        #import pdb;pdb.set_trace()
-        returning = self.returning_import
-        results = self.results_import
+        returning = getattr(self,self.matric_no_catalog)
+        results = getattr(self,self.results_catalog,None)
         err = 0
         widget_id = self.getWidgetId()
@@ -412,11 +424,12 @@
                     logger.info('matric_no %s not found' % value)
                     err = 'No student with matric_no %s.' % (value)
-                    continue
+                    break
                 datastructure['student'] = res[0]
-                res = results(matric_no = value)
-                if len(res) < 1:
-                    err = 'No results with matric_no %s.' % (value)
-                    continue
-                datastructure['results'] = res
+                if results is not None:
+                    res = results(matric_no = value)
+                    if len(res) < 1:
+                        err = 'No results with matric_no %s.' % (value)
+                        continue
+                    datastructure['results'] = res
                 break
         if err:
Index: /WAeUP_SRP/trunk/profiles/default/layouts.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/layouts.xml	(revision 1746)
+++ /WAeUP_SRP/trunk/profiles/default/layouts.xml	(revision 1747)
@@ -29,4 +29,5 @@
   <object name="student_course_result" meta_type="CPS Layout"/>
   <object name="student_create" meta_type="CPS Layout"/>
+  <object name="student_created_login" meta_type="CPS Layout"/>
   <object name="student_personal" meta_type="CPS Layout"/>
   <object name="student_personal_fe" meta_type="CPS Layout"/>
Index: /WAeUP_SRP/trunk/profiles/default/layouts/import_student.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/layouts/import_student.xml	(revision 1746)
+++ /WAeUP_SRP/trunk/profiles/default/layouts/import_student.xml	(revision 1747)
@@ -32,8 +32,8 @@
   <property name="display_width">15</property>
  </widget> 
- <widget name="address" meta_type="String Widget">
+ <widget name="perm_address" meta_type="String Widget">
   <property name="title">Address</property>
   <property name="fields">
-   <element value="address"/>
+   <element value="perm_address"/>
   </property>
   <property name="label">Address</property>
@@ -122,4 +122,6 @@
   <property name="label">Current Session</property>
   <property name="label_edit">Current Session</property>
+  <property name="description">The currently paid session</property>
+  <property name="help">The last session the student has paid his schoolfee</property>
   <property name="readonly_layout_modes"/>
   <property name="hidden_layout_modes"/>
@@ -134,4 +136,6 @@
   <property name="label">Current Level</property>
   <property name="label_edit">Current Level</property>
+  <property name="description">The level of the last paid session</property>
+  <property name="help">The last level the student has paid his schoolfee</property>
   <property name="readonly_layout_modes"/>
   <property name="hidden_layout_modes"/>
@@ -146,4 +150,6 @@
   <property name="label">Current Verdict</property>
   <property name="label_edit">Current Verdict</property>
+  <property name="description">The verdict of the current level</property>
+  <property name="help">The verdict of the level the student has paid his schoolfee</property>
   <property name="readonly_layout_modes"/>
   <property name="hidden_layout_modes"/>
Index: /WAeUP_SRP/trunk/profiles/default/layouts/student_created_login.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/layouts/student_created_login.xml	(revision 1747)
+++ /WAeUP_SRP/trunk/profiles/default/layouts/student_created_login.xml	(revision 1747)
@@ -0,0 +1,147 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="layout.xsl"?>
+<object name="student_created_login" meta_type="CPS Layout">
+ <property name="layout_create_method"></property>
+ <property name="layout_edit_method"></property>
+ <property name="layout_view_method"></property>
+ <property name="style_prefix">layout_search_session_</property>
+ <property name="flexible_widgets"/>
+ <property name="validate_values_expr"></property>
+ <widget name="email" meta_type="Email Widget">
+  <property name="title">Email</property>
+  <property name="fields">
+   <element value="email"/>
+  </property>
+  <property name="is_required">True</property>
+  <property name="label">Email</property>
+  <property name="label_edit">Email</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes">
+   <element value="create"/>
+  </property>
+  <property name="hidden_readonly_layout_modes"/>
+ </widget>
+ <widget name="jamb_reg_no" meta_type="JambRegNo Widget">
+  <property name="title">JAMB Registration Number</property>
+  <property name="fields">
+   <element value="jamb_reg_no"/>
+  </property>
+  <property name="label">JAMB Registration Number</property>
+  <property name="label_edit">JAMB Registration Number</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes">
+   <element value="edit"/>
+  </property>
+  <property name="hidden_readonly_layout_modes"/>
+  <property name="display_width">10</property>
+  <property name="size_max">10</property>
+  <property name="catalog">returning_import</property>
+  <property name="reference">student</property>
+ </widget>
+ <widget name="matric_no" meta_type="MatricNo Widget">
+  <property name="title">Matriculation Number</property>
+  <property name="fields">
+   <element value="matric_no"/>
+  </property>
+  <property name="label">Matriculation Number</property>
+  <property name="label_edit">Matriculation Number</property>
+  <property name="readonly_layout_modes">
+   <element value="edit"/>
+  </property>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
+  <property name="display_width">10</property>
+  <property name="size_max">10</property>
+  <property name="matric_no_catalog">students_catalog</property>
+  <property name="results_catalog"></property>
+ </widget>
+ <widget name="password" meta_type="Password Widget">
+  <property name="title">Password</property>
+  <property name="fields">
+   <element value="password"/>
+  </property>
+  <property name="is_required">True</property>
+  <property name="label">Choose a Password</property>
+  <property name="label_edit">Choose a Password</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes">
+   <element value="create"/>
+  </property>
+  <property name="hidden_readonly_layout_modes"/>
+  <property name="display_width">15</property>
+  <property name="size_max">15</property>
+  <property name="check_digit">True</property>
+ </widget>
+ <widget name="phone_nr" meta_type="String Widget">
+  <property name="title">Phone Number</property>
+  <property name="fields">
+   <element value="phone_nr"/>
+  </property>
+  <property name="label">Phone Number</property>
+  <property name="label_edit">Phone Number</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes">
+   <element value="create"/>
+  </property>
+  <property name="hidden_readonly_layout_modes"/>
+  <property name="display_width">15</property>
+  <property name="size_max">15</property>
+ </widget>
+ <widget name="repeat_password" meta_type="Password Widget">
+  <property name="title">Password</property>
+  <property name="fields">
+   <element value="repeat_password"/>
+  </property>
+  <property name="label">Verify the Password</property>
+  <property name="label_edit">Verify the Password</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes">
+   <element value="create"/>
+  </property>
+  <property name="hidden_readonly_layout_modes"/>
+  <property name="display_width">15</property>
+  <property name="size_max">15</property>
+  <property name="password_widget">password</property>
+  <property name="size_min">0</property>
+ </widget>
+ <widget name="secret" meta_type="Secret Widget">
+  <property name="title">Secret Widget</property>
+  <property name="fields">
+   <element value="secret"/>
+  </property>
+  <property name="check_fields">
+   <element value="name"/>
+  </property>
+  <property name="label">Firstname, Middlename or Lastname</property>
+  <property
+     name="label_edit">Enter either your  Firstname, Middlename or Lastname</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes">
+   <element value="edit"/>
+  </property>
+  <property name="hidden_readonly_layout_modes"/>
+  <property name="display_width">20</property>
+  <property name="size_max">40</property>
+ </widget>
+ <table>
+  <row>
+   <cell name="matric_no"/>
+  </row>
+  <row>
+   <cell name="secret"/>
+  </row>
+  <row>
+   <cell name="email"/>
+  </row>
+  <row>
+   <cell name="phone_nr"/>
+  </row>
+  <row>
+   <cell name="password"/>
+  </row>
+  <row>
+   <cell name="repeat_password"/>
+  </row>
+ </table>
+</object>
+
Index: /WAeUP_SRP/trunk/profiles/default/layouts/student_session_results_search.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/layouts/student_session_results_search.xml	(revision 1746)
+++ /WAeUP_SRP/trunk/profiles/default/layouts/student_session_results_search.xml	(revision 1747)
@@ -51,4 +51,6 @@
   <property name="hidden_layout_modes"/>
   <property name="hidden_readonly_layout_modes"/>
+  <property name="matric_no_catalog">returning_import</property>
+  <property name="results_catalog">results_import</property>
   <property name="display_width">10</property>
   <property name="size_max">10</property>
@@ -105,6 +107,8 @@
  <widget name="secret" meta_type="Secret Widget">
   <property name="title">Secret Widget</property>
-  <property name="fields">
-   <element value="secret"/>
+  <property name="check_fields">
+   <element value="Firstname"/>
+   <element value="Middlename"/>
+   <element value="Lastname"/>
   </property>
   <property name="label">Firstname, Middlename or Lastname</property>
Index: /WAeUP_SRP/trunk/skins/waeup_default/sessions_voc.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_default/sessions_voc.py	(revision 1746)
+++ /WAeUP_SRP/trunk/skins/waeup_default/sessions_voc.py	(revision 1747)
@@ -6,5 +6,5 @@
 """
 if key is None:
-    l = [('unknown','unknown')]
+    l = [('xx','unknown')]
     for y in range(1998,2008):
         l.append( ('%s' % str(y)[-2:],'%4d/%4d' % (y,y+1)))
@@ -12,9 +12,9 @@
 
 if len(key) != 2:
-    return "invalid Session %s" % key
+    return 'unknown'
 try:
     y = int(key)
 except:
-    return "invalid Session %s" % key
+    return 'unknown'
 if y < 90:
     cent = 2000
Index: /WAeUP_SRP/trunk/skins/waeup_student/created_student_login.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/created_student_login.py	(revision 1747)
+++ /WAeUP_SRP/trunk/skins/waeup_student/created_student_login.py	(revision 1747)
@@ -0,0 +1,49 @@
+##parameters=REQUEST
+# $Id$
+"""
+process the Application Form
+return html renderer + psm
+"""
+import DateTime
+from urllib import urlencode
+current = DateTime.DateTime()
+pr = context.portal_registration
+
+validate = REQUEST.has_key("cpsdocument_create_button")
+
+lt = context.portal_layouts
+#pr = context.portal_registration
+
+res,psm,ds = lt.renderLayout(layout_id= 'student_created_login',
+                      schema_id= 'student_returning',
+                      context=context,
+                      mapping=validate and REQUEST,
+                      ob={},
+                      layout_mode='create',
+                      formaction = "created_student_login",
+                      button = "Search",
+                      commit=False,
+                      )
+if psm == 'invalid':
+    return context.created_student_login_form(rendered = res,
+                                 psm = "Please correct your input!",
+                                 #psm = "%s, %s" % (psm,ds),
+                                 firstlayout = True,
+                                 lastlayout = True,
+                                 ds = ds,
+                                 )
+elif psm == '':
+    return context.created_student_login_form(rendered = res,
+                                 psm = None,
+                                 firstlayout = True,
+                                 lastlayout = True,
+                                 ds = ds,
+                                 )
+elif psm == 'valid':
+    pass
+action = "/set_access_data"
+args = {}
+args['matric_no'] = ds.get('matric_no')
+args['name'] = ds.get('student').name
+url = context.absolute_url() + action + '?' + urlencode(args)
+REQUEST.RESPONSE.redirect(url)
Index: /WAeUP_SRP/trunk/skins/waeup_student/created_student_login_form.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/created_student_login_form.pt	(revision 1747)
+++ /WAeUP_SRP/trunk/skins/waeup_student/created_student_login_form.pt	(revision 1747)
@@ -0,0 +1,23 @@
+<tal:block define="rendered_main options/rendered;
+           portal_status_message options/psm;
+           data_storage options/ds;
+           edition python:1;"
+           >
+  <metal:block define-macro="edit_form">
+    <metal:block use-macro="here/content_lib_master/macros/master">
+      <metal:block fill-slot="header"
+                   tal:define="creation creation|nothing;
+                   edition edition|nothing;
+                   metadata metadata|nothing"
+                   >
+      </metal:block>
+      <metal:block fill-slot="main">
+        <h3>Firsttime login ! </h3>
+        <br />
+        <div tal:replace="structure rendered_main" />
+      </metal:block>
+      <metal:block fill-slot="sub">
+      </metal:block>
+    </metal:block>
+  </metal:block>
+</tal:block>
