Index: /WAeUP_SRP/trunk/PatchCatalogToolXMLAdapter.py
===================================================================
--- /WAeUP_SRP/trunk/PatchCatalogToolXMLAdapter.py	(revision 1803)
+++ /WAeUP_SRP/trunk/PatchCatalogToolXMLAdapter.py	(revision 1804)
@@ -48,6 +48,6 @@
     if not_found:
         self._logger.info("%s modified." % na[1][1])
-        #self._initProperties(node)
-        #self._initObjects(node)
+        self._initProperties(node)
+        self._initObjects(node)
         if new_indexes and len(self.context()) == 0: #disable creation of new indexes if records in the table
             self._initIndexes(node)
Index: /WAeUP_SRP/trunk/PatchExtendedWidgetsCPSDateTimeWidget.py
===================================================================
--- /WAeUP_SRP/trunk/PatchExtendedWidgetsCPSDateTimeWidget.py	(revision 1804)
+++ /WAeUP_SRP/trunk/PatchExtendedWidgetsCPSDateTimeWidget.py	(revision 1804)
@@ -0,0 +1,62 @@
+#-*- mode: python; mode: fold -*-
+import re
+from DateTime.DateTime import DateTime
+from Products.CPSSchemas.ExtendedWidgets import CPSDateTimeWidget
+
+def validate(self, datastructure, **kw):
+    """Validate datastructure and update datamodel."""
+    datamodel = datastructure.getDataModel()
+    field_id = self.fields[0]
+    widget_id = self.getWidgetId()
+    if datastructure.has_key(widget_id + '_date'):
+        date = datastructure[widget_id + '_date'].strip()
+    else:
+        date = datastructure[widget_id].strip()
+    if datastructure.has_key(widget_id + '_hour'):
+        hour = datastructure[widget_id + '_hour'].strip()
+    else:
+        hour = self.time_hour_default
+    if datastructure.has_key(widget_id + '_minute'):
+        minute = datastructure[widget_id + '_minute'].strip()
+    else:
+        minute = self.time_minutes_default
+
+    if not (date):
+        if self.is_required:
+            datastructure[widget_id] = ''
+            datastructure.setError(widget_id, 'cpsschemas_err_required')
+            return 0
+        else:
+            datamodel[field_id] = None
+            return 1
+
+    if self.view_format.startswith('iso8601'):
+        if re.match(r'^[0-9]+-[0-9]{2}-[0-9]{2}', date) is not None:
+            y, m, d = date.split('-')
+        else:
+            datastructure.setError(widget_id, 'cpsschemas_err_date')
+            return 0
+    else:
+        if re.match(r'^[0-9]?[0-9]/[0-9]?[0-9]/[0-9]{2,4}$', date) is not None:
+            locale = self.translation_service.getSelectedLanguage()
+            if locale in ('en', 'hu'):
+                m, d, y = date.split('/')
+            else:
+                d, m, y = date.split('/')
+        else:
+            datastructure.setError(widget_id, 'cpsschemas_err_date')
+            return 0
+
+    try:
+        v = DateTime(int(y), int(m), int(d), int(hour), int(minute))
+    except (ValueError, TypeError, DateTime.DateTimeError,
+            DateTime.SyntaxError, DateTime.DateError):
+        datastructure.setError(widget_id, 'cpsschemas_err_date')
+        return 0
+    else:
+        datastructure[widget_id] = v
+        datamodel[field_id] = v
+        return 1
+
+CPSDateTimeWidget.validate = validate
+
Index: /WAeUP_SRP/trunk/WAeUPTool.py
===================================================================
--- /WAeUP_SRP/trunk/WAeUPTool.py	(revision 1803)
+++ /WAeUP_SRP/trunk/WAeUPTool.py	(revision 1804)
@@ -698,4 +698,5 @@
                               'nationality',
                               'lga',
+                              'birthday',
                               )
                               },
@@ -893,13 +894,10 @@
                 dm = DataModel(item, adapters,context=self)
                 logger.info('%s starts import from %s.csv' % (member,filename))
-                import_keys = item.keys()
-                diff_set = set(import_keys).difference(set(schema.keys()))
-                if diff_set:
-                    logger.error('%s not in schema.' % diff_set)
-                    return
-                diff_set = set(import_keys).difference(set(layout.keys()))
-                if diff_set:
-                    logger.error('%s not in layout.' % diff_set)
-                    return
+                import_keys = [k for k in item.keys() if not k.startswith('ignore')]
+                diff2schema = set(import_keys).difference(set(schema.keys()))
+                diff2layout = set(import_keys).difference(set(layout.keys()))
+                if diff2schema:
+                    em = "not ignorable key(s) %s found in heading" % diff2schema
+                    return em
                 s = ','.join(['"%s"' % fn for fn in import_keys])
                 open("%s/import/%s_not_imported%s.csv" % (i_home,filename,current),"a").write(s + ',"Error"'+ '\n')
@@ -912,4 +910,6 @@
             error_string = ""
             for k in import_keys:
+                # if k == "birthday":
+                #     from pdb import set_trace; set_trace()
                 if not validators[k](ds):
                     error_string += " %s : %s" % (k,ds.getError(k))
Index: /WAeUP_SRP/trunk/Widgets.py
===================================================================
--- /WAeUP_SRP/trunk/Widgets.py	(revision 1803)
+++ /WAeUP_SRP/trunk/Widgets.py	(revision 1804)
@@ -175,4 +175,220 @@
 ###)
 
+class WAeUPSessionWidget(CPSSelectWidget): ###(
+    """WAeUP Session widget."""
+    meta_type = 'WAeUP Session Widget'
+
+    def _getSessions(self):
+        current_year = DateTime().year()
+        d = {'xx': 'unknown'}
+        for y in range(current_year - 9,current_year + 1):
+            d['%s' % str(y)[-2:]] = '%4d/%4d' % (y,y+1)
+        return d
+
+    def validate(self, datastructure, **kw):
+        """Validate datastructure and update datamodel."""
+        widget_id = self.getWidgetId()
+        value = datastructure[widget_id]
+        try:
+            v = str(value)
+        except ValueError:
+            datastructure.setError(widget_id, "'%s' not a valid session key" % value)
+            return 0
+        
+        if len(v) == 1:
+            v = value = '0%c' % v
+        elif not value:
+            v = value = self.getSessionId()[-2:]
+        #import pdb;pdb.set_trace()
+        sessions = self._getSessions()
+        if not sessions.has_key(value):
+            datastructure.setError(widget_id, "'%s' not a valid session key" % v)
+            return 0
+        if self.is_required and not len(v):
+            datastructure.setError(widget_id, "session key required")
+            return 0
+
+        datamodel = datastructure.getDataModel()
+        datamodel[self.fields[0]] = v
+        return 1
+
+    def render(self, mode, datastructure, **kw):
+        """Render in mode from datastructure."""
+        value = datastructure[self.getWidgetId()]
+        sessions = self._getSessions()
+        if mode == 'view':
+            return escape(sessions.get(value, value))
+        elif mode == 'edit':
+            html_widget_id = self.getHtmlWidgetId()
+            res = renderHtmlTag('select', name=html_widget_id, id=html_widget_id)
+            in_selection = 0
+            vocabulary_items = sessions.items()
+            if self.sorted:
+                vocabulary_items.sort(key=operator.itemgetter(1))
+            for k, v in vocabulary_items:
+                kw = {'value': k, 'contents': v}
+                if value == k:
+                    kw['selected'] = 'selected'
+                    in_selection = 1
+                res += renderHtmlTag('option', **kw)
+            if value and not in_selection:
+                kw = {'value': value, 'contents': 'invalid: '+ str(value),
+                      'selected': 'selected'}
+                res += renderHtmlTag('option', **kw)
+            res += '</select>'
+            return res
+        raise RuntimeError('unknown mode %s' % mode)
+
+InitializeClass(WAeUPSessionWidget)
+
+widgetRegistry.register(WAeUPSessionWidget)
+
+###)
+
+class WAeUPLevelWidget(CPSSelectWidget): ###(
+    """WAeUP Level Widget."""
+    meta_type = 'WAeUP Level Widget'
+
+    def _getLevels(self):
+        d = {'999':'unknown'}
+        for y in range(100,800,100):
+            d['%s' % str(y)] = 'Year %1d (%3d Level)' % (y/100,y)
+        return d
+
+    def validate(self, datastructure, **kw):
+        """Validate datastructure and update datamodel."""
+        widget_id = self.getWidgetId()
+        value = datastructure[widget_id]
+        try:
+            v = str(value)
+        except ValueError:
+            datastructure.setError(widget_id, "'%s' not a valid level key" % value)
+            return 0
+        
+        if not value: 
+            v = value = '100'
+        #import pdb;pdb.set_trace()
+        levels = self._getLevels()
+        if not levels.has_key(value):
+            datastructure.setError(widget_id, "'%s' not a valid level" % v)
+            return 0
+        if self.is_required and not len(v):
+            datastructure.setError(widget_id, "level key required")
+            return 0
+
+        datamodel = datastructure.getDataModel()
+        datamodel[self.fields[0]] = v
+        return 1
+
+    def render(self, mode, datastructure, **kw):
+        """Render in mode from datastructure."""
+        value = datastructure[self.getWidgetId()]
+        levels = self._getLevels()
+        if mode == 'view':
+            return escape(levels.get(value, value))
+        elif mode == 'edit':
+            html_widget_id = self.getHtmlWidgetId()
+            res = renderHtmlTag('select', name=html_widget_id, id=html_widget_id)
+            in_selection = 0
+            vocabulary_items = levels.items()
+            if self.sorted:
+                vocabulary_items.sort(key=operator.itemgetter(1))
+            for k, v in vocabulary_items:
+                kw = {'value': k, 'contents': v}
+                if value == k:
+                    kw['selected'] = 'selected'
+                    in_selection = 1
+                res += renderHtmlTag('option', **kw)
+            if value and not in_selection:
+                kw = {'value': value, 'contents': 'invalid: '+ str(value),
+                      'selected': 'selected'}
+                res += renderHtmlTag('option', **kw)
+            res += '</select>'
+            return res
+        raise RuntimeError('unknown mode %s' % mode)
+
+InitializeClass(WAeUPLevelWidget)
+
+widgetRegistry.register(WAeUPLevelWidget)
+
+###)
+
+class WAeUPVerdictWidget(CPSSelectWidget): ###(
+    """WAeUP Verdict widget."""
+    meta_type = 'WAeUP Verdict Widget'
+
+    # XXX make a menu for the vocabulary.
+    vocabulary = 'verdicts'
+    translated = False
+    sorted = False
+
+    # Associating the widget label with an input area to improve the widget
+    # accessibility.
+    has_input_area = True
+
+    def _getVerdicts(self,datastructure):
+        voc = getattr(self.portal_vocabularies,self.vocabulary)
+        d = {}
+        for k,v in voc.items():
+            d[k] = v
+        return d
+
+    def validate(self, datastructure, **kw):
+        """Validate datastructure and update datamodel."""
+        widget_id = self.getWidgetId()
+        value = datastructure[widget_id]
+        try:
+            v = str(value)
+        except ValueError:
+            datastructure.setError(widget_id, "'%s' not a valid verdict key" % value)
+            return 0
+        #import pdb;pdb.set_trace()
+        verdicts = self._getVerdicts(datastructure)
+        if not value:
+            v = value = verdicts['N/A']
+        if not verdicts.has_key(value):
+            datastructure.setError(widget_id, "'%s' not a valid verdict key" % v)
+            return 0
+        if self.is_required and not len(v):
+            datastructure.setError(widget_id, "verdict required")
+            return 0
+
+        datamodel = datastructure.getDataModel()
+        datamodel[self.fields[0]] = v
+        return 1
+
+    def render(self, mode, datastructure, **kw):
+        """Render in mode from datastructure."""
+        value = datastructure[self.getWidgetId()]
+        verdicts = self._getVerdicts(datastructure)
+        if mode == 'view':
+            return escape(verdicts.get(value, value))
+        elif mode == 'edit':
+            html_widget_id = self.getHtmlWidgetId()
+            res = renderHtmlTag('select', name=html_widget_id, id=html_widget_id)
+            in_selection = 0
+            vocabulary_items = verdicts.items()
+            if self.sorted:
+                vocabulary_items.sort(key=operator.itemgetter(1))
+            for k, v in vocabulary_items:
+                kw = {'value': k, 'contents': v}
+                if value == k:
+                    kw['selected'] = 'selected'
+                    in_selection = 1
+                res += renderHtmlTag('option', **kw)
+            if value and not in_selection:
+                kw = {'value': value, 'contents': 'invalid: '+ str(value),
+                      'selected': 'selected'}
+                res += renderHtmlTag('option', **kw)
+            res += '</select>'
+            return res
+        raise RuntimeError('unknown mode %s' % mode)
+
+InitializeClass(WAeUPVerdictWidget)
+
+widgetRegistry.register(WAeUPVerdictWidget)
+
+###)
+
 class WAeUPReservedRoomsWidget(CPSStringWidget): ###(
     """ WAeUPReservedRooms Widget"""
@@ -298,5 +514,4 @@
         """Validate datastructure and update datamodel."""
         valid = CPSStringWidget.validate(self, datastructure, **kw)
-        #import pdb;pdb.set_trace()
         jamb_nr_catalog = getattr(self,self.catalog)
         widget_id = self.getWidgetId()
@@ -390,5 +605,5 @@
 ###)
 
-class WAeUPSexWidget(CPSBooleanWidget):
+class WAeUPSexWidget(CPSBooleanWidget): ###(
     """WAeUP sex widget."""
     meta_type = 'WAeUP Sex Widget'
@@ -418,4 +633,6 @@
 
 widgetRegistry.register(WAeUPSexWidget)
+
+###)
 
 class MatricNoWidget(CPSStringWidget): ###(
@@ -915,11 +1132,8 @@
         return meth(mode=mode, datastructure=datastructure, **img_info)
 
-###)
-
-
-
 InitializeClass(WAeUPImageWidget)
 
 widgetRegistry.register(WAeUPImageWidget)
+###)
 
 
Index: /WAeUP_SRP/trunk/__init__.py
===================================================================
--- /WAeUP_SRP/trunk/__init__.py	(revision 1803)
+++ /WAeUP_SRP/trunk/__init__.py	(revision 1804)
@@ -20,4 +20,5 @@
 import PatchCPSStackingDirectoryStorageAdapter
 import PatchBasicWidgetsCPSStringWidget
+import PatchExtendedWidgetsCPSDateTimeWidget
 import PatchBasicWidgetsUnprepare
 # Only for CPS 3.4.1. In 3.4.2 and later this should be fixed.
Index: /WAeUP_SRP/trunk/profiles/default/layouts/import_student.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/layouts/import_student.xml	(revision 1803)
+++ /WAeUP_SRP/trunk/profiles/default/layouts/import_student.xml	(revision 1804)
@@ -114,5 +114,19 @@
   <property name="hidden_readonly_layout_modes"/>
  </widget>
- <widget name="entry_mode" meta_type="Select Widget">
+<widget name="birthday" meta_type="DateTime Widget">
+ <property name="title">Birthday</property>
+ <property name="fields">
+  <element value="birthday"/>
+ </property>
+ <property name="label">Birthday</property>
+ <property name="label_edit">Birthday</property>
+ <property name="readonly_layout_modes"/>
+ <property name="hidden_layout_modes"/>
+ <property name="hidden_readonly_layout_modes"/>
+ <property name="view_format">iso8601</property>
+ <property name="time_setting">False</property>
+ <property name="time_hour_default">00</property>
+</widget>
+  <widget name="entry_mode" meta_type="Select Widget">
   <property name="title">Entry Mode</property>
   <property name="fields">
@@ -138,5 +152,5 @@
   <property name="vocabulary">entry_modes</property>
  </widget>
- <widget name="current_session" meta_type="Select Widget">
+ <widget name="current_session" meta_type="WAeUP Session Widget">
   <property name="title">Current Session</property>
   <property name="fields">
@@ -152,5 +166,5 @@
   <property name="vocabulary">sessions</property>
  </widget>
- <widget name="current_level" meta_type="Select Widget">
+ <widget name="current_level" meta_type="WAeUP Level Widget">
   <property name="title">Current Level</property>
   <property name="fields">
@@ -166,5 +180,5 @@
   <property name="vocabulary">courselevel</property>
  </widget>
- <widget name="current_verdict" meta_type="Select Widget">
+ <widget name="current_verdict" meta_type="WAeUP Verdict Widget">
   <property name="title">Current Verdict</property>
   <property name="fields">
Index: /WAeUP_SRP/trunk/profiles/default/schemas/import_student.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/schemas/import_student.xml	(revision 1803)
+++ /WAeUP_SRP/trunk/profiles/default/schemas/import_student.xml	(revision 1804)
@@ -6,4 +6,5 @@
  <field name="lastname" meta_type="CPS String Field"/>
  <field name="sex" meta_type="CPS String Field"/>
+ <field name="birthday" meta_type="CPS String Field"/>
  <field name="matric_no" meta_type="CPS String Field"/>
  <field name="jamb_reg_no" meta_type="CPS String Field"/>
