Index: waeup_product/trunk/Academics.py
===================================================================
--- waeup_product/trunk/Academics.py	(revision 238)
+++ waeup_product/trunk/Academics.py	(revision 238)
@@ -0,0 +1,151 @@
+#-*- mode: python; mode: fold -*-
+from Globals import InitializeClass
+from AccessControl import ClassSecurityInfo
+
+from Products.CMFCore.utils import UniqueObject, getToolByName
+from Products.CMFCore.permissions import View
+from Products.CMFCore.permissions import ModifyPortalContent
+from Products.CPSCore.CPSBase import CPSBase_adder, CPSBaseFolder 
+#from Products.CPSCore.CPSBase import CPSBaseDocument as BaseDocument 
+from Products.CPSDocument.CPSDocument import CPSDocument 
+#from Products.CPSCore.CPSBase import CPSBaseBTreeFolder as BaseBTreeFolder 
+#from Products.CPSCore.CPSBase import CPSBaseBTreeDocument as BaseBTreeDocument 
+#from Products.CMFCore.DirectoryView import registerDirectory
+
+#registerDirectory('skins', globals())
+#registerDirectory('skins/waeup_default', globals())
+#registerDirectory('skins/waeup_faculty', globals())
+
+class SCFolder(CPSDocument): ###(
+    """
+    WAeUP StudyCourseFolder containing StudyCourses 
+    """
+    meta_type = 'SCFolder'
+    portal_type = meta_type
+    security = ClassSecurityInfo()
+    
+    def __init__(self, id, **kw):
+        CPSDocument.__init__(self, id, **kw)
+
+    security.declareProtected(View,"Title")
+    def Title(self):
+        """compose title"""
+        return "SCFolder of %s" % (self.title)
+
+InitializeClass(SCFolder)
+
+def addSCFolder(container, id, REQUEST=None, **kw):
+    """Add a SCFolder."""
+    ob = SCFolder(id, **kw)
+    return CPSBase_adder(container, ob, REQUEST=REQUEST)
+
+###)
+
+class StudyCourse(CPSDocument): ###(
+    """
+    WAeUP StudyCourse 
+    """
+    meta_type = 'StudyCourse'
+    portal_type = meta_type
+    security = ClassSecurityInfo()
+    
+    def __init__(self, id, **kw):
+        CPSDocument.__init__(self, id, **kw)
+
+##    security.declareProtected(View,"Title")
+##    def Title(self):
+##        """compose title"""
+##        return "StudyCourse of %s" % (self.title)
+
+InitializeClass(StudyCourse)
+
+def addStudyCourse(container, id, REQUEST=None, **kw):
+    """Add a StudyCourse."""
+    ob = StudyCourse(id, **kw)
+    return CPSBase_adder(container, ob, REQUEST=REQUEST)
+
+###)
+
+class Faculty(CPSDocument): ###(
+    """
+    WAeUP Faculty containing Departments 
+    """
+    meta_type = 'Faculty'
+    portal_type = meta_type
+    security = ClassSecurityInfo()
+    
+##    def __init__(self, id, **kw):
+##        CPSDocument.__init__(self, id, **kw)
+
+    security.declareProtected(View,"Title")
+    def Title(self):
+        """compose title"""
+        return "%s" % (self.title)
+
+InitializeClass(Faculty)
+
+def addFaculty(container, id, REQUEST=None, **kw):
+    """Add a Faculty."""
+    ob = Faculty(id, **kw)
+    return CPSBase_adder(container, ob, REQUEST=REQUEST)
+
+###)
+
+class Department(CPSDocument): ###(
+    """
+    WAeUP Department containing the courses and students
+    """
+    meta_type = 'Department'
+    portal_type = meta_type
+    security = ClassSecurityInfo()
+
+##    security.declareProtected(View,"Title")
+##    def Title(self):
+##        """compose title"""
+##        reg_nr = self.getId()[1:]
+##        return "Department of %s" % (self.title)
+
+InitializeClass(Department)
+
+def addDepartment(container, id, REQUEST=None, **kw):
+    """Add a Department."""
+    ob = Department(id, **kw)
+    return CPSBase_adder(container, ob, REQUEST=REQUEST)
+###)
+
+class Course(CPSDocument): ###(
+    """
+    WAeUP Course  
+    """
+    meta_type = 'Course'
+    portal_type = meta_type
+    security = ClassSecurityInfo()
+
+    security.declareProtected(View,"Title")
+    def Title(self):
+        """compose title"""
+        return self.title
+    
+InitializeClass(Course)
+
+def addCourse(container, id, REQUEST=None, **kw):
+    """Add a Course."""
+    ob = Course(id, **kw)
+    return CPSBase_adder(container, ob, REQUEST=REQUEST)
+###)
+
+class CourseTicket(CPSDocument): ###(
+    """
+    WAeUP CourseTicket  
+    """
+    meta_type = 'CourseTicket'
+    portal_type = meta_type
+    security = ClassSecurityInfo()
+    
+InitializeClass(CourseTicket)
+
+def addCourseTicket(container, id, REQUEST=None, **kw):
+    """Add a CourseTicket."""
+    ob = CourseTicket(id, **kw)
+    return CPSBase_adder(container, ob, REQUEST=REQUEST)
+###)
Index: waeup_product/trunk/Faculty.py
===================================================================
--- waeup_product/trunk/Faculty.py	(revision 223)
+++ 	(revision )
@@ -1,120 +1,0 @@
-#-*- mode: python; mode: fold -*-
-from Globals import InitializeClass
-from AccessControl import ClassSecurityInfo
-
-from Products.CMFCore.utils import UniqueObject, getToolByName
-from Products.CMFCore.permissions import View
-from Products.CMFCore.permissions import ModifyPortalContent
-from Products.CPSCore.CPSBase import CPSBase_adder, CPSBaseFolder 
-#from Products.CPSCore.CPSBase import CPSBaseDocument as BaseDocument 
-from Products.CPSDocument.CPSDocument import CPSDocument 
-#from Products.CPSCore.CPSBase import CPSBaseBTreeFolder as BaseBTreeFolder 
-#from Products.CPSCore.CPSBase import CPSBaseBTreeDocument as BaseBTreeDocument 
-#from Products.CMFCore.DirectoryView import registerDirectory
-
-#registerDirectory('skins', globals())
-#registerDirectory('skins/waeup_default', globals())
-#registerDirectory('skins/waeup_faculty', globals())
-
-class Faculty(CPSDocument): ###(
-    """
-    WAeUP Faculty containing Departments 
-    """
-    meta_type = 'Faculty'
-    portal_type = meta_type
-    security = ClassSecurityInfo()
-    
-    def __init__(self, id, **kw):
-        CPSDocument.__init__(self, id, **kw)
-
-    security.declareProtected(View,"Title")
-    def Title(self):
-        """compose title"""
-        return "Faculty of %s" % (self.title)
-
-InitializeClass(Faculty)
-
-def addFaculty(container, id, REQUEST=None, **kw):
-    """Add a Faculty."""
-    ob = Faculty(id, **kw)
-    return CPSBase_adder(container, ob, REQUEST=REQUEST)
-
-###)
-
-
-class Department(CPSDocument): ###(
-    """
-    WAeUP Department containing the courses and students
-    """
-    meta_type = 'Department'
-    portal_type = meta_type
-    security = ClassSecurityInfo()
-
-##    security.declareProtected(View,"Title")
-##    def Title(self):
-##        """compose title"""
-##        reg_nr = self.getId()[1:]
-##        return "Department of %s" % (self.title)
-
-InitializeClass(Department)
-
-def addDepartment(container, id, REQUEST=None, **kw):
-    """Add a Department."""
-    ob = Department(id, **kw)
-    return CPSBase_adder(container, ob, REQUEST=REQUEST)
-###)
-
-##course_fti = { ###(
-##    'title': 'WAeUP Course',
-##    'description': '',
-##    'content_icon': '',
-##    'content_meta_type': 'Course',
-##    'factory': 'addCourse',
-##    'immediate_view': 'cpsdocument_view',
-##    'global_allow': True,
-##    'filter_content_types': True,
-##    'allowed_content_types': (),
-##    'allow_discussion': False,
-##}
-#####)
-
-class Course(CPSDocument): ###(
-    """
-    WAeUP Course  
-    """
-    meta_type = 'Course'
-    portal_type = meta_type
-    security = ClassSecurityInfo()
-
-    security.declareProtected(View,"Title")
-    def Title(self):
-        """compose title"""
-        content = self.getContent()
-        heading = getattr(content,'heading',None)
-        if heading is None:
-            return self.title
-        return heading
-    
-InitializeClass(Course)
-
-def addCourse(container, id, REQUEST=None, **kw):
-    """Add a Course."""
-    ob = Course(id, **kw)
-    return CPSBase_adder(container, ob, REQUEST=REQUEST)
-###)
-
-class CourseTicket(CPSDocument): ###(
-    """
-    WAeUP CourseTicket  
-    """
-    meta_type = 'CourseTicket'
-    portal_type = meta_type
-    security = ClassSecurityInfo()
-    
-InitializeClass(CourseTicket)
-
-def addCourseTicket(container, id, REQUEST=None, **kw):
-    """Add a CourseTicket."""
-    ob = CourseTicket(id, **kw)
-    return CPSBase_adder(container, ob, REQUEST=REQUEST)
-###)
Index: waeup_product/trunk/__init__.py
===================================================================
--- waeup_product/trunk/__init__.py	(revision 223)
+++ waeup_product/trunk/__init__.py	(revision 238)
@@ -14,8 +14,10 @@
 from Products.WAeUP.Accommodation import AccoFolder, addAccoFolder
 from Products.WAeUP.Accommodation import Accommodation, addAccommodation
-from Products.WAeUP.Faculty import Faculty, addFaculty
-from Products.WAeUP.Faculty import Department, addDepartment
-from Products.WAeUP.Faculty import Course, addCourse
-from Products.WAeUP.Faculty import CourseTicket, addCourseTicket
+from Products.WAeUP.Academics import SCFolder, addSCFolder
+from Products.WAeUP.Academics import StudyCourse, addStudyCourse
+from Products.WAeUP.Academics import Faculty, addFaculty
+from Products.WAeUP.Academics import Department, addDepartment
+from Products.WAeUP.Academics import Course, addCourse
+from Products.WAeUP.Academics import CourseTicket, addCourseTicket
 from Products.WAeUP.Students import Student, addStudent
 from Products.WAeUP.Students import StudentPersonal, addStudentPersonal
@@ -31,4 +33,6 @@
 contentClasses = (
     University,
+    SCFolder,
+    StudyCourse,
     Faculty,
     Department,
@@ -48,4 +52,6 @@
 contentConstructors = (
     addUniversity,
+    addSCFolder,
+    addStudyCourse,
     addFaculty,
     addDepartment,
@@ -65,4 +71,6 @@
 fti = (
     {}, # University
+    {}, #SCFolder
+    {}, #StudyCourse
     {}, # Faculty
     {}, # Department
Index: waeup_product/trunk/exportimport.py
===================================================================
--- waeup_product/trunk/exportimport.py	(revision 223)
+++ waeup_product/trunk/exportimport.py	(revision 238)
@@ -12,4 +12,5 @@
 association in the `configure.zcml` file.
 """
+import csv,re
 
 # Zope3 component architecture
@@ -30,4 +31,7 @@
 from Products.GenericSetup.interfaces import ISetupEnviron
 from Products.WAeUP.interfaces import IWAeUPTool
+import Globals
+p_home = Globals.package_home(globals())
+i_home = Globals.INSTANCE_HOME
 
 TOOL = 'portal_waeup'
@@ -37,30 +41,4 @@
 # im- / export steps defined in the corresponding XML files in the
 # WAeUP/profiles/default/ directory.
-
-
-def setupStructure(context): ###(
-    sections = getattr(context,'sections')
-    portal = getattr(sections,'uniportal',None)
-    if portal is None:
-        sections.invokeFactory('University','uniportal')
-        portal = getattr(context,'uniportal',None)
-        portal.getContent().edit(mapping={'Title':SRPP_TITLE})
-    students =  getattr(portal,'students',None)
-    if students is None:
-        portal.invokeFactory('StudentsFolder','students')
-        students = getattr(portal,'students').getContent()
-        students.edit(mapping={'Title':'Students'})
-    academics = getattr(portal,'academics',None)
-    if academics is None:
-        portal.invokeFactory('AcademicsFolder','academics')
-        academics = getattr(portal,'academics')
-        academics.getContent().edit(mapping={'Title':'Academics'})
-    installFaculties(academics)
-    if not hasattr(portal,'accommodation'):
-        portal.invokeFactory('AccoFolder','accommodation')
-        accommodation = getattr(portal,'accommodation').getContent()
-        accommodation.edit(mapping={'Title':'Accommodation'})
-###)
-
 
 def installFaculties( academics): ###(
@@ -152,4 +130,107 @@
 ###)
 
+def loadFacultiesFromCSV(academics,site,context): ###(
+    """install Universityspecific Faculies from CSV values"""
+    logger = context.getLogger('loadfaculties')
+    faculties = csv.DictReader(open("%s/import/faculty.csv" % i_home,"rb"))
+    for faculty in faculties:
+        fid = faculty['FacultyKey']
+        f = getattr(academics,fid,None)
+        if f is None:
+            #self.log('Creating Faculty %(id)s = %(Title)s' % faculty)
+            logger.info('Creating Faculty %(FacultyKey)s = %(Description)s' % faculty)
+            academics.invokeFactory('Faculty', fid)
+            f = getattr(academics,fid)
+            d = {'Title': faculty['Description']}
+            f.getContent().edit(mapping=d)
+###)
+
+def loadDepartmentsFromCSV(academics,site,context): ###(
+    """install Universityspecific Faculies from CSV values"""
+    logger = context.getLogger('loaddepartments')
+    deps = csv.DictReader(open("%s/import/departments.csv" % i_home,"rb"))
+    for dep in deps:
+        fid = dep['FacultyCode']
+        f = getattr(academics,fid,None)
+        if f is None:
+            logger.info( "No Faculty with ID: %s" % fid)
+        else:
+            did = dep.get('DeptCode')
+            d = getattr(f,did,None)
+            if d is None:
+                #self.log('Creating Department %(DeptCode)s = %(Description)s' % dep)
+                logger.info('Creating Department %(DeptCode)s = %(Description)s' % dep)
+                f.invokeFactory('Department', did)
+                d = getattr(f,did)
+                dict = {'Title': dep['Description']}
+                d.getContent().edit(mapping=dict)
+###)
+
+def loadCoursesFromCSV(academics,site,context): ###(
+    """install Universityspecific Faculies from CSV values"""
+    logger = context.getLogger('loadcourses')
+    courses = csv.DictReader(open("%s/import/courses.csv" % i_home,"rb"))
+    for course in courses:
+        if course.get("FORMERCODE") != '':
+            continue
+        depid = course['Dept']
+        res = site.portal_catalog({'meta_type': "Department",
+                                      'id': depid})
+        if not res:
+            continue
+        dept=res[0].getObject()
+        course_id = ''.join(re.split('\W+',course.get('CourseCode')))
+        if len(course_id) != 6:
+            logger.info("invalid course_code %(CourseCode)s" % course)
+            #print course_id,course.get('CourseCode'),course.get('Description')
+            continue
+        c = getattr(dept,course_id,None)
+        if c is None:
+            #self.log('Creating Department %(DeptCode)s = %(Description)s' % dep)
+            logger.info('Creating Course %(CourseCode)s  %(Description)s in Department %(Dept)s' % course)
+            dept.invokeFactory('Course', course_id)
+            c = getattr(dept,course_id)
+        dict = {'Title': course['Description']}
+        dict['code'] = course_id
+        dict['credit'] = course.get('Credits')
+        #dict['level'] = course.get('CourseCode').split()[1][0]
+        dict['level'] = "%c00" % course_id[3]
+        dict['semester'] = "%(Semester)s" % course
+        dict['passmark'] = course.get('PassMark')
+        c.getContent().edit(mapping=dict)
+###)
+
+def setupStructure(site,context): ###(
+    sections = getattr(site,'sections')
+    portal = getattr(sections,'uniportal',None)
+    if portal is None:
+        sections.invokeFactory('University','uniportal')
+        portal = getattr(site,'uniportal',None)
+        portal.getContent().edit(mapping={'Title':SRPP_TITLE})
+    students =  getattr(portal,'students',None)
+    if students is None:
+        portal.invokeFactory('StudentsFolder','students')
+        students = getattr(portal,'students').getContent()
+        students.edit(mapping={'Title':'Students'})
+    academics = getattr(portal,'academics',None)
+    if academics is None:
+        portal.invokeFactory('AcademicsFolder','academics')
+        academics = getattr(portal,'academics')
+        academics.getContent().edit(mapping={'Title':'Academics'})
+    loadFacultiesFromCSV(academics,site,context)
+    loadDepartmentsFromCSV(academics,site,context)
+    loadCoursesFromCSV(academics,site,context)
+    studycourses = getattr(academics,'studycourses',None)
+    if studycourses is None:
+        academics.invokeFactory('SCFolder','studycourses')
+        studycourses = getattr(academics,'studycourses')
+        studycourses.getContent().edit(mapping={'Title':'Studycourses'})
+    installFaculties(academics)
+    if not hasattr(portal,'accommodation'):
+        portal.invokeFactory('AccoFolder','accommodation')
+        accommodation = getattr(portal,'accommodation').getContent()
+        accommodation.edit(mapping={'Title':'Accommodation'})
+###)
+
 
 def exportWAeUP(context):
@@ -168,6 +249,7 @@
     """
     site = context.getSite()
+    setupStructure(site,context)
     #import pdb; pdb.set_trace()
-    setupStructure(site)
+    print ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>p_home: ",p_home,i_home
     pass
     #site = context.getSite()
Index: waeup_product/trunk/profiles/default/layouts.xml
===================================================================
--- waeup_product/trunk/profiles/default/layouts.xml	(revision 223)
+++ waeup_product/trunk/profiles/default/layouts.xml	(revision 238)
@@ -24,4 +24,5 @@
  <object name="student_semester" meta_type="CPS Layout"/>
  <object name="study_level" meta_type="CPS Layout"/>
+ <object name="studycourse" meta_type="CPS Layout"/>
  <object name="university" meta_type="CPS Layout"/>
  <object name="waeup_common" meta_type="CPS Layout"/>
Index: waeup_product/trunk/profiles/default/layouts/course.xml
===================================================================
--- waeup_product/trunk/profiles/default/layouts/course.xml	(revision 223)
+++ waeup_product/trunk/profiles/default/layouts/course.xml	(revision 238)
@@ -35,15 +35,4 @@
   <property name="label_edit">Credit</property>
  </widget>
- <widget name="heading" meta_type="String Widget">
-  <property name="fields">
-   <element value="heading"/>
-  </property>
-  <property name="is_required">True</property>
-  <property name="label">Title</property>
-  <property name="label_edit">Title</property>
-  <property name="help">Course Title</property>
-  <property name="display_width">40</property>
-  <property name="size_max">40</property>
- </widget>
  <widget name="level" meta_type="Select Widget">
   <property name="fields">
@@ -55,21 +44,26 @@
   <property name="vocabulary">courselevel</property>
  </widget>
- <widget name="nr_of_seats" meta_type="Int Widget">
+ <widget name="passmark" meta_type="Int Widget">
   <property name="fields">
-   <element value="nr_of_seats"/>
+   <element value="passmark"/>
   </property>
   <property name="is_required">True</property>
-  <property name="label">Nr. of seats</property>
-  <property name="label_edit">Nr. of seats</property>
+  <property name="label">Passmark</property>
+  <property name="label_edit">Passmark</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
  </widget>
- <widget name="semester" meta_type="Boolean Widget">
+ <widget name="semester" meta_type="Select Widget">
+  <property name="title">Semester</property>
   <property name="fields">
    <element value="semester"/>
   </property>
-  <property name="is_required">True</property>
   <property name="label">Semester</property>
   <property name="label_edit">Semester</property>
-  <property name="label_false">Second Semester</property>
-  <property name="label_true">First Semester</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
+  <property name="vocabulary">semester_voc</property>
  </widget>
  <widget name="text" meta_type="Text Widget">
@@ -108,5 +102,5 @@
   </row>
   <row>
-   <cell name="nr_of_seats"/>
+   <cell name="passmark"/>
   </row>
  </table>
Index: waeup_product/trunk/profiles/default/layouts/studycourse.xml
===================================================================
--- waeup_product/trunk/profiles/default/layouts/studycourse.xml	(revision 238)
+++ waeup_product/trunk/profiles/default/layouts/studycourse.xml	(revision 238)
@@ -0,0 +1,103 @@
+<?xml version="1.0"?>
+<object name="studycourse" 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_default_</property>
+ <property name="flexible_widgets"/>
+ <property name="validate_values_expr"></property>
+ <widget name="code" meta_type="String Widget">
+  <property name="title">Code</property>
+  <property name="fields">
+   <element value="code"/>
+  </property>
+  <property name="is_required">True</property>
+  <property name="label">Code</property>
+  <property name="label_edit">Code</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
+  <property name="display_width">6</property>
+  <property name="size_max">6</property>
+ </widget>
+ <widget name="department" meta_type="Select Widget">
+  <property name="title">Department</property>
+  <property name="fields">
+   <element value="department"/>
+  </property>
+  <property name="is_required">True</property>
+  <property name="label">Department</property>
+  <property name="label_edit">Department</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
+ </widget>
+ <widget name="faculty" meta_type="Select Widget">
+  <property name="title">Faculty</property>
+  <property name="fields">
+   <element value="faculty"/>
+  </property>
+  <property name="is_required">True</property>
+  <property name="label">Faculty</property>
+  <property name="label_edit">Faculty</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
+ </widget>
+ <widget name="max_load" meta_type="Int Widget">
+  <property name="title">Maximum Load</property>
+  <property name="fields">
+   <element value="max_load"/>
+  </property>
+  <property name="is_required">True</property>
+  <property name="label">Maximum Load</property>
+  <property name="label_edit">Maximum Load</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
+ </widget>
+ <widget name="max_pass" meta_type="Int Widget">
+  <property name="title">Maximum Pass</property>
+  <property name="fields">
+   <element value="max_pass"/>
+  </property>
+  <property name="is_required">True</property>
+  <property name="label">Maximum Pass</property>
+  <property name="label_edit">Maximum Pass</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
+ </widget>
+ <widget name="nr_of_levels" meta_type="Int Widget">
+  <property name="title">Nr of Levels</property>
+  <property name="fields">
+   <element value="nr_of_levels"/>
+  </property>
+  <property name="is_required">True</property>
+  <property name="label">Nr of Levels</property>
+  <property name="label_edit">Nr of Levels</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
+ </widget>
+ <table>
+  <row>
+   <cell name="code"/>
+  </row>
+  <row>
+   <cell name="faculty"/>
+  </row>
+  <row>
+   <cell name="department"/>
+  </row>
+  <row>
+   <cell name="nr_of_levels"/>
+  </row>
+  <row>
+   <cell name="max_load"/>
+  </row>
+  <row>
+   <cell name="max_pass"/>
+  </row>
+ </table>
+</object>
Index: waeup_product/trunk/profiles/default/schemas.xml
===================================================================
--- waeup_product/trunk/profiles/default/schemas.xml	(revision 223)
+++ waeup_product/trunk/profiles/default/schemas.xml	(revision 238)
@@ -21,4 +21,5 @@
  <object name="student_schoolresults" meta_type="CPS Schema"/>
  <object name="students" meta_type="CPS Schema"/>
+ <object name="studycourse" meta_type="CPS Schema"/>
  <object name="study_level" meta_type="CPS Schema"/>
  <object name="university" meta_type="CPS Schema"/>
Index: waeup_product/trunk/profiles/default/schemas/course.xml
===================================================================
--- waeup_product/trunk/profiles/default/schemas/course.xml	(revision 223)
+++ waeup_product/trunk/profiles/default/schemas/course.xml	(revision 238)
@@ -10,16 +10,14 @@
   <property name="default_expr">string:</property>
  </field>
- <field name="heading" meta_type="CPS String Field">
-  <property name="is_searchabletext">True</property>
- </field>
  <field name="level" meta_type="CPS String Field">
   <property name="is_searchabletext">True</property>
  </field>
- <field name="nr_of_seats" meta_type="CPS Int Field"/>
- <field name="semester" meta_type="CPS Boolean Field">
-  <property name="default_expr">python:True</property>
+ <field name="passmark" meta_type="CPS Int Field">
+  <property name="default_expr">python:40</property>
  </field>
+ <field name="semester" meta_type="CPS String Field"/>
  <field name="text" meta_type="CPS String Field">
   <property name="is_searchabletext">True</property>
  </field>
 </object>
+
Index: waeup_product/trunk/profiles/default/schemas/studycourse.xml
===================================================================
--- waeup_product/trunk/profiles/default/schemas/studycourse.xml	(revision 238)
+++ waeup_product/trunk/profiles/default/schemas/studycourse.xml	(revision 238)
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<object name="studycourse" meta_type="CPS Schema">
+ <field name="code" meta_type="CPS String Field">
+  <property name="is_searchabletext">True</property>
+ </field>
+ <field name="department" meta_type="CPS String Field"/>
+ <field name="faculty" meta_type="CPS String Field"/>
+ <field name="heading" meta_type="CPS String Field"/>
+  <field name="max_load" meta_type="CPS Int Field"/>
+ <field name="max_pass" meta_type="CPS Int Field"/>
+ <field name="nr_of_levels" meta_type="CPS Int Field"/>
+</object>
Index: waeup_product/trunk/profiles/default/themes.xml
===================================================================
--- waeup_product/trunk/profiles/default/themes.xml	(revision 238)
+++ waeup_product/trunk/profiles/default/themes.xml	(revision 238)
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<object name="portal_themes" meta_type="Portal Themes Tool">
+ <property name="accesskey">*</property>
+ <property name="debug_mode">True</property>
+ <property name="method_themes">
+  <element key="index_html" value="default+Front"/>
+ </property>
+ <object name="waeup_management_theme" meta_type="Portal Theme"/>
+ <object name="waeup_plain_theme" meta_type="Portal Theme"/>
+</object>
Index: waeup_product/trunk/profiles/default/types.xml
===================================================================
--- waeup_product/trunk/profiles/default/types.xml	(revision 223)
+++ waeup_product/trunk/profiles/default/types.xml	(revision 238)
@@ -12,4 +12,6 @@
  <object name="ScratchCard" meta_type="CPS Flexible Type Information"/>
  <object name="Semester" meta_type="CPS Flexible Type Information"/>
+ <object name="SCFolder" meta_type="CPS Flexible Type Information"/>
+ <object name="StudyCourse" meta_type="CPS Flexible Type Information"/>
  <object name="Student" meta_type="CPS Flexible Type Information"/>
  <object name="StudentDocuments" meta_type="CPS Flexible Type Information"/>
Index: waeup_product/trunk/profiles/default/types/AcademicsFolder.xml
===================================================================
--- waeup_product/trunk/profiles/default/types/AcademicsFolder.xml	(revision 223)
+++ waeup_product/trunk/profiles/default/types/AcademicsFolder.xml	(revision 238)
@@ -13,4 +13,5 @@
  <property name="allowed_content_types">
   <element value="Faculty"/>
+  <element value="SCFolder"/>
  </property>
  <property name="allow_discussion">False</property>
Index: waeup_product/trunk/profiles/default/types/Department.xml
===================================================================
--- waeup_product/trunk/profiles/default/types/Department.xml	(revision 223)
+++ waeup_product/trunk/profiles/default/types/Department.xml	(revision 238)
@@ -12,10 +12,10 @@
  <property name="filter_content_types">True</property>
  <property name="allowed_content_types">
+  <element value="Course"/>
   <element value="Student"/>
-  <element value="Course"/>
  </property>
  <property name="allow_discussion">False</property>
  <property name="cps_is_searchable">True</property>
- <property name="cps_proxy_type">folder</property>
+ <property name="cps_proxy_type">btreefolderishdocument</property>
  <property name="cps_display_as_document_in_listing">True</property>
  <property name="schemas">
Index: waeup_product/trunk/profiles/default/types/SCFolder.xml
===================================================================
--- waeup_product/trunk/profiles/default/types/SCFolder.xml	(revision 238)
+++ waeup_product/trunk/profiles/default/types/SCFolder.xml	(revision 238)
@@ -0,0 +1,58 @@
+<?xml version="1.0"?>
+<object name="SCFolder" meta_type="CPS Flexible Type Information"
+   xmlns:i18n="http://xml.zope.org/namespaces/i18n">
+ <property name="title">WAeUP StudyCourse Folder</property>
+ <property name="description">The WAeUP StudyCourses Folder</property>
+ <property name="content_icon"></property>
+ <property name="content_meta_type">SCFolder</property>
+ <property name="product">CPSDefault</property>
+ <property name="factory">addFolder</property>
+ <property name="immediate_view">folder_view</property>
+ <property name="global_allow">True</property>
+ <property name="filter_content_types">True</property>
+ <property name="allowed_content_types">
+  <element value="StudyCourse"/>
+ </property>
+ <property name="allow_discussion">False</property>
+ <property name="cps_is_searchable">True</property>
+ <property name="cps_proxy_type">folder</property>
+ <property name="cps_display_as_document_in_listing">True</property>
+ <property name="schemas">
+  <element value="metadata"/>
+  <element value="common"/>
+  <element value="folder"/>
+ </property>
+ <property name="layouts">
+  <element value="common"/>
+  <element value="folder"/>
+ </property>
+ <property name="layout_clusters">
+  <element value="metadata:metadata"/>
+ </property>
+ <property name="flexible_layouts"/>
+ <property name="storage_methods"/>
+ <property name="cps_is_portlet">False</property>
+ <alias from="(Default)" to="temporary_view_all"/>
+ <alias from="view" to="temporary_view_all"/>
+ <action title="Standard View" action_id="view" category="object"
+    condition_expr="" url_expr="string:${object_url}/temporary_view_all"
+    visible="True">
+  <permission value="View"/>
+ </action>
+ <action title="Add StudyCourse" action_id="add_studycourse" category="object"
+    condition_expr="python:True or member and 'UniversityManager'in member.getRoles()"
+    url_expr="string:${object/absolute_url}/create_studycourse"
+    visible="True">
+  <permission value="University Manage"/>
+ </action>
+ <action title="action_folder_contents" action_id="contents" category="object"
+    condition_expr="" url_expr="string:${object/absolute_url}/folder_contents"
+    visible="True">
+  <permission value="University Manage"/>
+ </action>
+ <action title="delegate" action_id="localroles" category="object"
+    condition_expr="" url_expr="string:${object_url}/folder_localrole_form"
+    visible="False">
+  <permission value="University Manage"/>
+ </action>
+</object>
Index: waeup_product/trunk/profiles/default/types/StudyCourse.xml
===================================================================
--- waeup_product/trunk/profiles/default/types/StudyCourse.xml	(revision 238)
+++ waeup_product/trunk/profiles/default/types/StudyCourse.xml	(revision 238)
@@ -0,0 +1,53 @@
+<?xml version="1.0"?>
+<object name="StudyCourse" meta_type="CPS Flexible Type Information"
+   xmlns:i18n="http://xml.zope.org/namespaces/i18n">
+ <property name="title">WAeUP StudyCourse</property>
+ <property name="description"></property>
+ <property name="content_icon"></property>
+ <property name="content_meta_type">StudyCourse</property>
+ <property name="product">WAeUP</property>
+ <property name="factory">addStudyCourse</property>
+ <property name="immediate_view">folder_view</property>
+ <property name="global_allow">True</property>
+ <property name="filter_content_types">True</property>
+ <property name="allow_discussion">False</property>
+ <property name="cps_is_searchable">True</property>
+ <property name="cps_proxy_type">folder</property>
+ <property name="cps_display_as_document_in_listing">True</property>
+ <property name="schemas">
+  <element value="metadata"/>
+  <element value="common"/>
+  <element value="studycourse"/>
+ </property>
+ <property name="layouts">
+  <element value="studycourse"/>
+ </property>
+ <property name="layout_clusters">
+  <element value="metadata:metadata"/>
+ </property>
+ <property name="flexible_layouts"/>
+ <property name="storage_methods"/>
+ <property name="cps_is_portlet">False</property>
+ <alias from="(Default)" to="temporary_view_all"/>
+ <alias from="view" to="temporary_view_all"/>
+ <action title="Standard View" action_id="view" category="object"
+    condition_expr="" url_expr="string:${object_url}/temporary_view_all"
+    visible="True">
+  <permission value="View"/>
+ </action>
+ <action title="action_edit" action_id="edit" category="object"
+    condition_expr="python:member and 'Manager' in member.getRoles()"
+    url_expr="string:${object_url}/cpsdocument_edit_form" visible="True">
+  <permission value="Modify portal content"/>
+ </action>
+ <action title="action_metadata" action_id="metadata" category="object"
+    condition_expr="python:member and 'Manager' in member.getRoles()"
+    url_expr="string:${object_url}/cpsdocument_metadata" visible="True">
+  <permission value="Modify portal content"/>
+ </action>
+ <action title="delegate" action_id="localroles" category="object"
+    condition_expr="" url_expr="string:${object_url}/folder_localrole_form"
+    visible="False">
+  <permission value="Modify portal content"/>
+ </action>
+</object>
Index: waeup_product/trunk/profiles/default/vocabularies.xml
===================================================================
--- waeup_product/trunk/profiles/default/vocabularies.xml	(revision 223)
+++ waeup_product/trunk/profiles/default/vocabularies.xml	(revision 238)
@@ -12,3 +12,4 @@
  <object name="range5" meta_type="CPS Vocabulary"/>
  <object name="range50" meta_type="CPS Vocabulary"/>
+ <object name="semester_voc" meta_type="CPS Vocabulary"/>
  </object>
Index: waeup_product/trunk/profiles/default/vocabularies/semester_voc.xml
===================================================================
--- waeup_product/trunk/profiles/default/vocabularies/semester_voc.xml	(revision 238)
+++ waeup_product/trunk/profiles/default/vocabularies/semester_voc.xml	(revision 238)
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<object name="courselevel" meta_type="CPS Vocabulary">
+ <property name="title"></property>
+ <property name="title_msgid"></property>
+ <property name="description"></property>
+ <property name="acl_write_roles">Manager</property>
+ <item key="1" msgid="">1st</item>
+ <item key="2" msgid="">2nd</item>
+</object>
Index: waeup_product/trunk/profiles/default/workflows.xml
===================================================================
--- waeup_product/trunk/profiles/default/workflows.xml	(revision 223)
+++ waeup_product/trunk/profiles/default/workflows.xml	(revision 238)
@@ -4,4 +4,5 @@
  <object name="waeup_base_wf" meta_type="CPS Workflow"/>
  <object name="waeup_faculty_wf" meta_type="CPS Workflow"/>
+ <object name="waeup_studycourse_wf" meta_type="CPS Workflow"/>
  <object name="waeup_department_wf" meta_type="CPS Workflow"/>
  <object name="waeup_course_wf" meta_type="CPS Workflow"/>
@@ -22,4 +23,7 @@
    <bound-workflow workflow_id="section_folder_wf"/>
   </type>
+  <type type_id="SCFolder">
+   <bound-workflow workflow_id="section_folder_wf"/>
+  </type>
   <type type_id="Faculty">
    <bound-workflow workflow_id="waeup_faculty_wf"/>
@@ -30,4 +34,7 @@
   <type type_id="Course">
    <bound-workflow workflow_id="waeup_course_wf"/>
+  </type>
+  <type type_id="StudyCourse">
+   <bound-workflow workflow_id="waeup_studycourse_wf"/>
   </type>
   <type type_id="StudentsFolder">
Index: waeup_product/trunk/profiles/default/workflows/waeup_studycourse.xml
===================================================================
--- waeup_product/trunk/profiles/default/workflows/waeup_studycourse.xml	(revision 238)
+++ waeup_product/trunk/profiles/default/workflows/waeup_studycourse.xml	(revision 238)
@@ -0,0 +1,54 @@
+<?xml version="1.0"?>
+<cps-workflow workflow_id="waeup_studycourse_wf"
+              title="CPS Workflow Definition"
+              state_variable="review_state"
+              meta_type="CPS Workflow">
+ <permission>View</permission>
+ <state state_id="work" title="Work">
+  <exit-transition transition_id="create_content"/>
+  <exit-transition transition_id="cut_copy_paste"/>
+  <permission-map name="View" acquired="False">
+   <permission-role>Manager</permission-role>
+   <permission-role>SectionManager</permission-role>
+   <permission-role>SectionReviewer</permission-role>
+   <permission-role>SectionReader</permission-role>
+  </permission-map>
+ </state>
+ <transition transition_id="create" title="Initial creation"
+             new_state="work" trigger="USER"
+             before_script="" after_script="">
+  
+  <guard>
+   <guard-role>Manager</guard-role>
+   <guard-role>SectionManager</guard-role>
+  </guard>
+  <transition-behavior behavior_id="initial-create"/>
+ </transition>
+ <transition transition_id="create_content"
+             title="Create content" new_state="work"
+             trigger="USER" before_script="" after_script="">
+  
+  <guard>
+   <guard-role>Manager</guard-role>
+   <guard-role>SectionManager</guard-role>
+   <guard-role>SectionReviewer</guard-role>
+   <guard-role>SectionReader</guard-role>
+  </guard>
+  <transition-behavior behavior_id="allow-sub-create"/>
+  <transition-behavior behavior_id="allow-sub-publishing"/>
+ </transition>
+ <transition transition_id="cut_copy_paste"
+             title="Cut/Copy/Paste" new_state=""
+             trigger="USER" before_script="" after_script="">
+  
+  <guard>
+   <guard-role>Manager</guard-role>
+   <guard-role>SectionManager</guard-role>
+   <guard-role>SectionReviewer</guard-role>
+   <guard-role>SectionReader</guard-role>
+  </guard>
+  <transition-behavior behavior_id="allow-sub-move"/>
+  <transition-behavior behavior_id="allow-sub-delete"/>
+  <transition-behavior behavior_id="allow-sub-copy"/>
+ </transition>
+</cps-workflow>
Index: waeup_product/trunk/skins/waeup_default/temporary_view_all_form.pt
===================================================================
--- waeup_product/trunk/skins/waeup_default/temporary_view_all_form.pt	(revision 223)
+++ waeup_product/trunk/skins/waeup_default/temporary_view_all_form.pt	(revision 238)
@@ -24,7 +24,8 @@
   
     <br />
-    <span  tal:condition="python:context.portal_type != 'University'"  tal:omit-tag="">
+    <span  tal:condition="python:context.portal_type != 'University' and doc.render()"  tal:omit-tag="">
       <p>Exemplary view of the <strong>object's data fields</strong>: </p>
-      <tal:block  tal:content="structure rendered_main|python:doc.render()" />
+      <tal:block  
+          tal:content="structure python:doc.render()" />
     </span>
     <br />      
Index: waeup_product/trunk/skins/waeup_faculty/create_studycourse.py
===================================================================
--- waeup_product/trunk/skins/waeup_faculty/create_studycourse.py	(revision 238)
+++ waeup_product/trunk/skins/waeup_faculty/create_studycourse.py	(revision 238)
@@ -0,0 +1,50 @@
+##parameters=REQUEST=None
+# $Id: create_course.py 145 2005-11-03 08:53:17Z joachim $
+"""
+Create a Course
+
+"""
+type_name = 'StudyCourse'
+REQUEST.set('type_name',type_name)
+
+ti = context.portal_types[type_name]
+pr = context.portal_registration
+pm = context.portal_membership
+
+validate = REQUEST.has_key("cpsdocument_create_button")
+
+lt = context.portal_layouts
+
+res,psm,ds = lt.renderLayout(layout_id= 'studycourse',
+                      schema_id = 'studycourse',
+                      context=context,
+                      mapping=validate and REQUEST,
+                      ob={},
+                      layout_mode='create',
+                      create_action = 'create_studycourse',
+                      )
+if  psm == 'invalid':
+    return context.common_edit_form(rendered = res,
+                                 create = 1,
+                                 type_name = type_name,
+                                 psm = 'Please correct your errors',
+                                 )
+elif psm == '':
+    return context.common_edit_form(rendered = res,
+                                 create = 1,
+                                 type_name = type_name,
+                                 psm = psm,
+                                 )
+    
+elif psm == 'valid':
+    oid = "%s" % ds.get('code').replace(' ','')
+    context.invokeFactory(type_name,oid) 
+    object = getattr(context,oid)
+    ds.set('Title',ds.get('heading'))
+    object.getContent().edit(mapping=ds,proxy=object)
+    context.notifyCPSDocumentCreation(ob=object)
+    psm = 'new %s created' % oid
+    context_ti = context.portal_types[context.portal_type] 
+    index = context_ti.getActionById('view','university_view')
+    return getattr(context,index)(psm=psm)
+
