Index: waeup_product/trunk/Extensions/install.py
===================================================================
--- waeup_product/trunk/Extensions/install.py	(revision 195)
+++ waeup_product/trunk/Extensions/install.py	(revision 197)
@@ -360,5 +360,4 @@
         self.finalize()
 
-
     def verifyPortlets(self, portlets=(), object=None): ###(
         """Verify the existence of given portet in the object's portlet
@@ -417,4 +416,5 @@
         return returned
     ###)
+
 
     def installCustomWorkflows(self): ###(
@@ -536,5 +536,6 @@
     installer = WAeUPInstaller(self)
     installer.install(self)
-    dirtool = getattr(self,'portal_directories')
+    #dirtool = getattr(self,'portal_directories')
+    return installer.logResult()
     groups = dirtool.groups
     for delEntry in ('StudentManager',):
Index: waeup_product/trunk/University.py
===================================================================
--- waeup_product/trunk/University.py	(revision 195)
+++ waeup_product/trunk/University.py	(revision 197)
@@ -1,3 +1,3 @@
-from Globals import InitializeClass
+from Globals import InitializeClass,HTMLFile
 from AccessControl import ClassSecurityInfo
 
@@ -13,5 +13,4 @@
 # The WAeUP BaseContainer
 #
-
 class University(CPSDocument):
     """
@@ -28,31 +27,8 @@
         return self.REQUEST
     
-    
-##    security.declarePublic('backEnd')
-##    def backEnd(self):
-##        """ are we in back-end mode"""
-##        mtool = self.portal_membership
-##        member = mtool.getAuthenticatedMember()
-##        roles = member.getRoles()
-##        if 'UniversityManager' in roles or 'StudentManager' in roles:
-##            return True
-##        return False
-##
-##    security.declarePublic('frontEnd')
-##    def frontEnd(self):
-##        """ are we in front-end mode"""
-##        mtool = self.portal_membership
-##        member = mtool.getAuthenticatedMember()
-##        roles = member.getRoles()
-##        if 'Student' in roles:
-##            return True
-##        return False
-    
-        
 InitializeClass(University)
 
-
 def addUniversity(container, id, REQUEST=None, **kw):
-    """Add a WAeUP"""
+    """Add a University"""
     ob = University(id, **kw)
     return CPSBase_adder(container, ob, REQUEST=REQUEST)
Index: waeup_product/trunk/WAeUPTool.py
===================================================================
--- waeup_product/trunk/WAeUPTool.py	(revision 197)
+++ waeup_product/trunk/WAeUPTool.py	(revision 197)
@@ -0,0 +1,308 @@
+#-*- mode: python; mode: fold -*-
+# (C) Copyright 2005 The WAeUP group  <http://www.waeup.org>
+# Author: Joachim Schmitz (js@aixtraware.de)
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as published
+# by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+#
+# $Id$
+"""The WAeUPTool.
+"""
+
+from zLOG import LOG, DEBUG
+from Globals import InitializeClass, HTMLFile
+from AccessControl import ClassSecurityInfo
+from OFS.Folder import Folder
+
+from Products.CPSInstaller.CPSInstaller import CPSInstaller
+from Products.CMFCore.PortalFolder import PortalFolder
+from Products.CMFCore.permissions import View, ManagePortal
+from Products.CMFCore.utils import UniqueObject
+
+class WAeUPTool(UniqueObject,PortalFolder):
+    """WAeUP tool"""
+
+    id = 'portal_WAeUP'
+    meta_type = 'WAeUP Tool'
+
+    security = ClassSecurityInfo()
+    manage_options = (#ActionProviderBase.manage_options +
+                      PortalFolder.manage_options[:1] +
+                      PortalFolder.manage_options[2:])
+
+    _actions = ()
+
+
+    #
+    # ZMI
+    #
+    _properties = (
+        {'id': 'title', 'type': 'string', 'mode': 'w', 
+         'label': 'Title'},
+        {'id': 'uni_id', 'type': 'string', 'mode': 'w', 
+         'label': 'University ID'},
+        {'id': 'uni_name', 'type': 'string', 'mode': 'w', 
+         'label': 'University Name'},
+    )
+    title = ''
+    def __init__(self,uni_id,uni_name):
+        self.manage_changeProperties(uni_id = uni_id,
+                                     uni_name = uni_name,
+                                     )
+        PortalFolder.__init__(self, self.id)
+
+
+    def verifyFaculties(self, academics): ###(
+        """install Universityspecific Faculies with Departments"""
+        faculties = [
+##                     {'id': 'agri', ###(
+##                      'Title': 'Agriculture',
+##                      'departments': [
+##                                     { 'id': 'dep1', ###(
+##                                       'Title': 'One',
+##                                     },
+##                                     ],
+##                      },###)
+                      { 'id': 'science',
+                      'Title': 'Science',
+                      'departments': [
+                                     { 'id': 'bio', ###(
+                                       'Title': 'Biochemistry',
+                                     },
+                                     { 'id': 'bot',
+                                       'Title': 'Botany',
+                                     },
+                                     { 'id': 'che',
+                                       'Title': 'Chemistry',
+                                     },
+                                     { 'id': 'com',
+                                       'Title': 'Computer Science',
+                                     },
+                                     { 'id': 'geo',
+                                       'Title': 'Geologie',
+                                     },
+                                     { 'id': 'mat',
+                                       'Title': 'Mathematics',
+                                     },
+                                     { 'id': 'mic',
+                                       'Title': 'Microbiology',
+                                     },
+                                     { 'id': 'opt',
+                                       'Title': 'Optometry',
+                                     },
+                                     { 'id': 'phy',
+                                       'Title': 'Physics',
+                                     },
+                                     { 'id': 'zoo',
+                                       'Title': 'Zoology',
+                                     },
+                                     ],
+                      },###)
+                     ]###)
+        #self.log('Verifying Faculties in %s' % academics.absolute_url(relative=1))
+        for faculty in faculties:
+            fid = faculty['id']
+            f = getattr(academics,fid,None)
+            #self.log('Checking Faculty %(id)s = %(Title)s' % faculty)
+            if f is None:
+                #self.log('Creating Faculty %(id)s = %(Title)s' % faculty)
+                academics.invokeFactory('Faculty', fid)
+                f = getattr(academics,fid)
+                f.getContent().edit(mapping=faculty)
+            for department in faculty['departments']:
+                #self.log('Checking Department %(id)s = %(Title)s' % department)
+                did = department['id']
+                d = getattr(f,did,None)
+                if d is None:
+                    #self.log('Creating Department %(id)s = %(Title)s' % department)
+                    f.invokeFactory('Department', did)
+                    d = getattr(f,did)
+                    d.getContent().edit(mapping=department)
+    ###)
+
+InitializeClass(WAeUPTool)
+
+def verifyPortlets(portal, portlets=(), object=None): ###(
+    """Verify the existence of given portet in the object's portlet
+    container. If not found, a portlet is instantiated.
+    Existing portlets are not affected.
+    'portlets' is a tuple with the dictionaries given by the export tab
+    as entries.
+    The default object is the portal itself.
+    return the list a new portlet ids.
+    """
+    #self.log('Verifying portlets on %s' % object.absolute_url(relative=1))
+    #portlet_container = CPSInstaller.getPortletContainer(object, create=1)
+    idpc = portal.portal_cpsportlets.getPortletContainerId()
+    if not hasattr(object, idpc):
+##            self.log("   Creating %s/%s" %
+##                (object.absolute_url(relative=1), idpc))
+        object.manage_addProduct['CPSPortlets'].addPortletsContainer()
+    portlet_container = getattr(object, idpc, None)
+    ttool = portal.portal_types
+    returned = []
+    for new_portlet in portlets:
+        existing_portlets = portlet_container.listPortlets()
+        updated = 0
+        # Check if the portlet needs an update
+        identifier = new_portlet.get('identifier')
+        if identifier:
+            for portlet in existing_portlets:
+                if identifier == portlet.identifier:
+                    #portal.log(" Update of portlet: %s" % portlet)
+                    portlet.edit(**new_portlet)
+                    portlet_id = portlet.getId()
+                    updated = 1
+                    continue
+        slot = new_portlet.get('slot')
+        if slot:
+            for portlet in existing_portlets:
+                if slot == portlet.slot:
+                    #portal.log(" Update of portlet: %s" % portlet)
+                    portlet.edit(**new_portlet)
+                    portlet_id = portlet.getId()
+                    updated = 1
+                    continue
+                
+        if not updated:
+            #portal.log("   Creation of portlet: %s" % new_portlet)
+            portlet_id = portal.portal_cpsportlets.createPortlet(
+            ptype_id=new_portlet['type'],
+            context=object,
+            **new_portlet)
+        if portlet_id not in returned:
+            returned.append(portlet_id)
+    return returned
+    ###)
+
+addWAeUPToolForm = HTMLFile('zmi/manage_addWAeUPUniversity',
+                                                globals())
+
+def addWAeUPTool(container, id,
+                             title='WAeUP University',
+                             description='',
+                             langs_list=None,
+                             manager_id='manager',
+                             manager_sn='CPS',
+                             manager_givenName='Manager',
+                             manager_email='',
+                             manager_password='',
+                             manager_password_confirmation='',
+                             REQUEST=None):
+    """Add WAeUPTool"""
+
+    _log = []
+    def pr(bla, zlog=1, _log=_log):
+        if bla == 'flush':
+            return '<br/>\n'.join(_log)
+        _log.append(bla)
+        if (bla and zlog):
+            LOG('addWAeUPUniversity:', INFO, bla)
+
+    uni_id = id.strip()
+    uni_name = title.strip()
+    description = description.strip()
+    manager_id = manager_id.strip()
+
+##    if not id:
+##        raise ValueError, "You have to provide an id for the portal!"
+##    if not manager_id:
+##        raise ValueError, "You have to provide an id for the CPS Administrator!"
+##    if not manager_email:
+##        raise ValueError, "You have to provide an email address for the CPS Administrator!"
+##    if not manager_password:
+##        raise ValueError, "You have to provide CPS Administrator password!"
+##    if manager_password != manager_password_confirmation:
+##        raise ValueError, "Password confirmation does not match password!"
+
+    email_from_name = ('%s %s' % (manager_givenName, manager_sn)).strip()
+    wt = WAeUPTool(uni_id,uni_name)
+    id = wt.getId()
+    container._setObject(id, wt)
+    sections = getattr(container,'sections')
+    workspaces = getattr(container,'workspaces') 
+    sections.invokeFactory('University',uni_id)
+    uni = getattr(sections,uni_id)
+    uni.getContent().edit(title=uni_name)
+    uni.invokeFactory('StudentsFolder','students')
+    students = getattr(uni,'students').getContent()
+    students.edit(mapping={'Title':'Students'})
+##    uni.folder_localrole_add(member_ids=('group:Students',),
+##                                            member_role='SectionReviewer',
+##                                            )
+##        uni.content_create(type_name='AcademicsFolder',title='academics')
+##        sections.uni.folder_localrole_add(member_ids=('group:StudentManager',),
+##                                            member_role='SectionManager',
+##                                            )
+##        uni.students.manage_setLocalGroupRoles(groupid = 'Students',roles=('Contributor',))
+    uni.invokeFactory('AcademicsFolder','academics', title='Academics')
+    academics = getattr(uni,'academics').getContent()
+    academics.edit(mapping={'Title':'Academics'})
+    uni.invokeFactory('AccoFolder','accommodation', title='Accommodation')
+    accommodation = getattr(uni,'accommodation').getContent()
+    accommodation.edit(mapping={'Title':'Accommodation'})
+    academics = getattr(uni,'academics',None)
+    if academics is None:
+        uni.invokeFactory('AcademicsFolder','academics')
+        academics = getattr(uni,'academics')
+        academics.getContent().edit(mapping={'Title':'Academics'})
+    wt.verifyFaculties(academics)
+    if not hasattr(uni,'accommodation'):
+        uni.invokeFactory('AccoFolder','accommodation')
+        accommodation = getattr(uni,'accommodation').getContent()
+        accommodation.edit(mapping={'Title':'Accommodation'})
+    #uni.manage_setLocalGroupRoles(groupid = 'role:Anonymous',roles=('SectionReader',))
+    # portlets ###(
+    #
+    portlets = (
+              {#'identifier': 'waeup_breadcrumbs',
+              'type': 'Breadcrumbs Portlet',
+              'slot': 'waeup_breadcrumbs',
+              'first_item': 0,
+              'display_site_root': 0,
+              'Title': 'waeup_breadcrumbs',
+              'display': 'horizontal_trail',
+              'display_hidden_folders': 0,
+              'order': 0,
+              },
+              {#'identifier': 'waeup_main_tab_actions',
+              'type': 'Actions Portlet',
+              'slot': 'main_tabs',
+              'order': 0,
+              'categories': ['main_tabs',],
+              'Title': 'waep_main_tab_actions',
+              },
+              {#'identifier': 'waeup_object_actions',
+              'type': 'Actions Portlet',
+              'slot': 'waeup_object_actions',
+              'order': 0,
+              'categories': ['object',],
+              'Title': 'waep_manager_actions',
+              },
+              {#'identifier': 'waeup_left_top',
+              'type': 'Custom Portlet',
+              'slot': 'left_top',
+              'order': 0,
+              'render_method': 'portlet_session_info',
+              'Title': 'Session Info',
+              },
+            )
+    #verifyPortletContainer(uni)
+    verifyPortlets(container,portlets,uni)
+
+    ###)
+    if REQUEST is not None:
+        url = container.absolute_url()
+        REQUEST.RESPONSE.redirect('%s/manage_main' % url)
+
Index: waeup_product/trunk/__init__.py
===================================================================
--- waeup_product/trunk/__init__.py	(revision 195)
+++ waeup_product/trunk/__init__.py	(revision 197)
@@ -1,2 +1,3 @@
+from Products.CMFCore.utils import ContentInit, ToolInit
 from Products.CMFCore.DirectoryView import registerDirectory
 from Products.CMFCore import utils as cmfutils
@@ -11,4 +12,9 @@
 import Widgets
 import WAeUPPermissions
+import WAeUPTool
+
+tools = (
+    WAeUPTool.WAeUPTool,
+)
 
 fti = (Students.student_fti,
@@ -61,7 +67,13 @@
                        )
 
-def initialize(registrar):
-    cmfutils.ContentInit(
-        'WAeUP',
+def initialize(context):
+    ToolInit(
+        'WAeUP Tool',
+        tools = tools,
+        icon = 'tool.png',
+    ).initialize(context)
+
+    ContentInit(
+        'WAeUP Contenttypes',
         content_types=contentClasses,
         permission=AddPortalContent,
@@ -69,3 +81,8 @@
         fti=fti,
         
-    ).initialize(registrar)
+    ).initialize(context)
+        
+    context.registerClass(WAeUPTool.WAeUPTool,
+                          constructors=(WAeUPTool.addWAeUPToolForm,
+                          WAeUPTool.addWAeUPTool,))
+
Index: waeup_product/trunk/skins/waeup_default/getWAeUPTypes.py
===================================================================
--- waeup_product/trunk/skins/waeup_default/getWAeUPTypes.py	(revision 195)
+++ waeup_product/trunk/skins/waeup_default/getWAeUPTypes.py	(revision 197)
@@ -67,5 +67,5 @@
                  'action': 'folder_localrole_form',
                  'permissions': (ModifyPortalContent),
-                 'visible' : 0,
+                 'visible' : 1,
                  },
                  )
@@ -229,5 +229,5 @@
                  'action': 'folder_localrole_form',
                  'permissions': (ModifyPortalContent,UniversityManage),
-                 'visible' : 0,
+                 'visible' : 1,
                 },
                 {'id': 'contents',
Index: waeup_product/trunk/skins/waeup_default/student_view_all_form.pt
===================================================================
--- waeup_product/trunk/skins/waeup_default/student_view_all_form.pt	(revision 195)
+++ waeup_product/trunk/skins/waeup_default/student_view_all_form.pt	(revision 197)
@@ -19,12 +19,10 @@
     <h1> <span tal:content="context/title_or_id" /></h1>      
   
-    <p>This is a temporary view of the object with id <em tal:content="here/id" /> 
-       of type <em tal:content="here/portal_type" /> 
-       which can be customized according to the customer's needs.</p>       
+    <p>This is a temporary view of the Students Registration view for anonymous users..</p>       
   
     <br />
     <span  tal:condition="python:context.portal_type != 'University'"  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(proxy=here)" />
+      <p>You are visiting the Student Registration Portal as anonymous user.
+      </p>
     </span>
   
Index: waeup_product/trunk/skins/waeup_default/temporary_view_all.py
===================================================================
--- waeup_product/trunk/skins/waeup_default/temporary_view_all.py	(revision 195)
+++ waeup_product/trunk/skins/waeup_default/temporary_view_all.py	(revision 197)
@@ -14,5 +14,5 @@
 if context.portal_membership.isAnonymousUser():
     if not url0.endswith('chat'):
-	return context.students.student_view_all_form(psm=psm)
+        return context.students.student_view_all_form(psm=psm)
     return context.Chat()
 else:
Index: waeup_product/trunk/zmi/manage_addWAeUPUniversity.dtml
===================================================================
--- waeup_product/trunk/zmi/manage_addWAeUPUniversity.dtml	(revision 197)
+++ waeup_product/trunk/zmi/manage_addWAeUPUniversity.dtml	(revision 197)
@@ -0,0 +1,159 @@
+<dtml-let form_title="'WAeUP'">
+<dtml-if manage_page_header>
+  <dtml-var manage_page_header>
+  <dtml-var manage_form_title>
+<dtml-else>
+  <html>
+  <head><title>&dtml-form_title;</title>
+  </head>
+  <body>
+  <h2>&dtml-form_title;</h2>
+</dtml-if>
+</dtml-let>
+
+  <div class="form-help">
+  Fill in this form to create a WAeUP Site.
+  </div>
+
+<form action="addWAeUPTool" method="post">
+<table cellspacing="0" cellpadding="2" border="0">
+  <tr>
+    <td align="left" valign="top">
+    <label for="id" class="form-label">
+      Id <span class="required" style="color: #ff0000;">*</span>
+    </label>
+    </td>
+    <td align="left" valign="top">
+    <input type="text" name="id" id="id" size="40" value="demo"/>
+    </td>
+  </tr>
+
+  <tr>
+    <td align="left" valign="top">
+    <label for="title" class="form-label">Title</label>
+    </td>
+    <td align="left" valign="top">
+    <input type="text" name="title" id="title" size="40" value=""/>
+    </td>
+  </tr>
+
+  <tr>
+    <td align="left" valign="top">
+    <label for="description" class="form-label">Description</label>
+    </td>
+    <td align="left" valign="top">
+    <textarea name="description" id="description" cols="40" rows="2"></textarea>
+    </td>
+  </tr>
+<dtml-comment>
+  <tr>
+    <td align="left" valign="top">
+    <label for="login" class="form-label">
+      WAeUP Administrator login <span class="required" style="color: #ff0000;">*</span>
+    </label>
+    </td>
+    <td align="left" valign="top">
+      <input type="text" name="manager_id" id="login" size="40" value="manager"/>
+    </td>
+  </tr>
+
+  <tr>
+    <td align="left" valign="top">
+    <label for="manager_password" class="form-label">
+      CPS Administrator Password <span class="required" style="color: #ff0000;">*</span>
+    </label>
+    </td>
+    <td align="left" valign="top">
+      <input type="password" name="manager_password" id="manager_password" size="40" value=""/>
+    </td>
+  </tr>
+
+  <tr>
+    <td align="left" valign="top">
+    <label for="manager_password_confirmation" class="form-label">
+      CPS Administrator Password Confirmation <span class="required" style="color: #ff0000;">*</span>
+    </label>
+    </td>
+    <td align="left" valign="top">
+      <input type="password" name="manager_password_confirmation" id="manager_password_confirmation" size="40" value="">
+    </td>
+  </tr>
+
+  <tr>
+    <td align="left" valign="top">
+    <label for="manager_email" class="form-label">
+      CPS Administrator E-mail <span class="required" style="color: #ff0000;">*</span>
+    </label>
+    </td>
+    <td align="left" valign="top">
+      <input type="text" name="manager_email" id="manager_email" size="40" value=""/>
+    </td>
+  </tr>
+
+  <tr>
+    <td align="left" valign="top">
+    <label for="manager_name" class="form-label">CPS Administrator Name</label>
+    </td>
+    <td align="left" valign="top">
+      <input type="text" name="manager_sn" id="manager_name" size="40" value="CPS manager"/>
+    </td>
+  </tr>
+
+  <tr>
+    <td align="left" valign="top">
+    <label for="manager_givenName" class="form-label">CPS Administrator Given Name</label>
+    </td>
+    <td align="left" valign="top">
+      <input type="text" name="manager_givenName" id="manager_givenName" size="40" value="Manager"/>
+    </td>
+  </tr>
+
+  <tr>
+    <td align="left" valign="top">
+    <div class="form-label">
+      Languages
+    </div>
+    </td>
+    <td align="left" valign="top">
+      <ul style="margin-left: 0; padding-left: 0; list-style-type: none;">
+      <dtml-in "[
+        ('nl', 'Dutch'),
+        ('en', 'English'),
+        ('fr', 'French'),
+        ('de', 'German'),
+        ('it', 'Italian'),
+        ('pt_BR', 'Portugese (Brazilian)'),
+        ('es', 'Spanish'),
+        ('mg', 'Malagasy'),
+        ('ro', 'Romanian'),
+        ('eu', 'Euskara'),
+        ]">
+        <li>
+        <dtml-let checked="_['sequence-key'] in ('fr', 'en') and 'checked=\'checked\'' or ' '">
+        <input type="checkbox" name="langs_list:list"
+               id="<dtml-var sequence-key>"
+               value="<dtml-var sequence-key>"
+               &dtml-checked;
+               />
+        </dtml-let>
+        <label for="<dtml-var sequence-key>"><dtml-var sequence-item></label>
+        </li>
+      </dtml-in>
+      </ul>
+    </td>
+  </tr>
+</dtml-comment>
+</table>
+
+<p style="text-align: center;">
+    <input type="submit" name="submit" value="Create" />
+</p>
+</form>
+
+<dtml-if manage_page_footer>
+  <dtml-var manage_page_footer>
+<dtml-else>
+
+</body>
+</html>
+</dtml-if>
