Index: WAeUP_SRP/base/PatchBasicWidgetsCPSStringWidget.py
===================================================================
--- WAeUP_SRP/base/PatchBasicWidgetsCPSStringWidget.py	(revision 3672)
+++ 	(revision )
@@ -1,5 +1,0 @@
-#-*- mode: python; mode: fold -*-
-from Products.CPSSchemas.BasicWidgets import CPSStringWidget
-from Products.CPSSchemas.BasicWidgets import CPSEmailWidget
-CPSStringWidget.display_width = 30
-CPSEmailWidget.display_width = 30
Index: WAeUP_SRP/base/PatchBasicWidgetsUnprepare.py
===================================================================
--- WAeUP_SRP/base/PatchBasicWidgetsUnprepare.py	(revision 3672)
+++ 	(revision )
@@ -1,9 +1,0 @@
-def unprepare(self, datastructure):
-    # Remove costly things already stored from the datastructure
-    try:
-        del datastructure[self.getWidgetId()]
-    except KeyError:
-        # unprepare may be called several times
-        pass
-from Products.CPSSchemas.BasicWidgets import CPSFileWidget
-CPSFileWidget.unprepare = unprepare
Index: WAeUP_SRP/base/PatchCPSDefaultImportExport.py
===================================================================
--- WAeUP_SRP/base/PatchCPSDefaultImportExport.py	(revision 3672)
+++ 	(revision )
@@ -1,75 +1,0 @@
-from Products.CPSDocument.exportimport import importCPSObjects
-from Products.CMFCore.utils import getToolByName
-from zope.app import zapi
-from Products.GenericSetup.interfaces import INode
-import Products
-
-# Patch to allow the roots importer to create CMF objects.
-# Only for CPS 3.4.1. In 3.4.2 and later this should be fixed.
-
-def _initObjects(self, node):
-    for child in node.childNodes:
-        if child.nodeName != 'object':
-            continue
-        if child.hasAttribute('deprecated'):
-            continue
-        parent = self.context
-
-        obj_id = str(child.getAttribute('name'))
-        if child.hasAttribute('remove'):
-            parent._delObject(obj_id)
-            continue
-
-        if obj_id not in parent.objectIds():
-            portal_type = str(child.getAttribute('portal_type'))
-            if portal_type:
-                wftool = getToolByName(parent, 'portal_workflow')
-                wftool.invokeFactoryFor(parent, portal_type, obj_id)
-            else:
-                meta_type = str(child.getAttribute('meta_type'))
-                __traceback_info__ = obj_id, meta_type
-                for mt_info in Products.meta_types:
-                    if mt_info['name'] == meta_type:
-                        parent._setObject(obj_id, mt_info['instance'](obj_id))
-                        break
-                else:
-                    raise ValueError("unknown meta_type '%s'" % meta_type)
-                        
-
-        if child.hasAttribute('insert-before'):
-            insert_before = child.getAttribute('insert-before')
-            if insert_before == '*':
-                parent.moveObjectsToTop(obj_id)
-            else:
-                try:
-                    position = parent.getObjectPosition(insert_before)
-                    if parent.getObjectPosition(obj_id) < position:
-                        position -= 1
-                    parent.moveObjectToPosition(obj_id, position)
-                except ValueError:
-                    pass
-        elif child.hasAttribute('insert-after'):
-            insert_after = child.getAttribute('insert-after')
-            if insert_after == '*':
-                parent.moveObjectsToBottom(obj_id)
-            else:
-                try:
-                    position = parent.getObjectPosition(insert_after)
-                    if parent.getObjectPosition(obj_id) < position:
-                        position -= 1
-                    parent.moveObjectToPosition(obj_id, position+1)
-                except ValueError:
-                    pass
-
-        obj = getattr(self.context, obj_id)
-        if child.hasAttribute('Title'):
-            print "set title",obj_id 
-            obj.title = child.getAttribute('Title')
-        
-        importer = zapi.queryMultiAdapter((obj, self.environ), INode)
-        if importer:
-            importer.node = child
-
-from Products.CPSDefault.exportimport import RootXMLAdapter
-RootXMLAdapter._initObjects = _initObjects
-
Index: WAeUP_SRP/base/PatchCPSMembershipTool.py
===================================================================
--- WAeUP_SRP/base/PatchCPSMembershipTool.py	(revision 3672)
+++ 	(revision )
@@ -1,8 +1,0 @@
-#-*- mode: python; mode: fold -*-
-from Products.CPSCore.CPSMembershipTool import CPSMembershipTool
-CPSMembershipTool.roles_managing_local_roles = ('WorkspaceManager', 
-                                                'SectionManager',
-                                                'SectionOfficer',
-                                                )
-
-
Index: WAeUP_SRP/base/PatchCPSSchemasAttributeStorageAdapter.py
===================================================================
--- WAeUP_SRP/base/PatchCPSSchemasAttributeStorageAdapter.py	(revision 3672)
+++ 	(revision )
@@ -1,6 +1,0 @@
-def _getContentUrl(self, object, field_id, file_name):
-    return '%s/%s' % (
-        object.aq_parent.absolute_url(), field_id)
-    
-from Products.CPSSchemas.StorageAdapter import AttributeStorageAdapter
-AttributeStorageAdapter._getContentUrl = _getContentUrl
Index: WAeUP_SRP/base/PatchCPSSchemasDataModel.py
===================================================================
--- WAeUP_SRP/base/PatchCPSSchemasDataModel.py	(revision 3672)
+++ 	(revision )
@@ -1,18 +1,0 @@
-def _commitData(self):
-    """Compute dependent fields and write data into object."""
-
-    # Compute dependent fields.
-    data = self.data
-    for schema in self._schemas:
-        for field_id, field in schema.items():
-            if self.isDirty(field_id):
-                #LOG("DataModel", TRACE, "Computing field '%s'" % (field_id,))
-                field.computeDependantFields(self._schemas, data,
-                                             context=self._context)
-
-    # Call the adapters to store the data.
-    for adapter in self._adapters:
-        adapter.setData(data)
-
-from Products.CPSSchemas.DataModel import DataModel
-DataModel._commitData = _commitData
Index: WAeUP_SRP/base/PatchCPSSchemasVocabulariesTool.py
===================================================================
--- WAeUP_SRP/base/PatchCPSSchemasVocabulariesTool.py	(revision 3672)
+++ 	(revision )
@@ -1,30 +1,0 @@
-from Products.CPSSchemas.VocabulariesTool import LOCAL_VOCABULARY_CONTAINER_ID
-def getVocabularyFor(self, context, voc_id):
-    """Returns vocabulary for given context."""
-
-    def hasLocalVocContainer(context):
-        if getattr(context, 'hasObject', None) is None:
-            return False
-        return context.hasObject(LOCAL_VOCABULARY_CONTAINER_ID)
-
-    def getLocalVocContainer(context):
-        return context._getOb(LOCAL_VOCABULARY_CONTAINER_ID, None)
-
-    getParentNode = lambda node: getattr(getattr(node, 'aq_inner', None),
-                                         'aq_parent', None)
-
-    if not hasLocalVocContainer(context):
-        parent = getParentNode(context)
-        while parent is not None:
-            if hasLocalVocContainer(parent):
-                return getLocalVocContainer(parent).getVocabulary(voc_id)
-            parent = getParentNode(parent)
-        # no local vocabulary container found for given context
-        globvoc = self._getOb(voc_id, None)
-        if globvoc is None:
-            raise KeyError, 'No vocabulary by id %s' % voc_id
-        return globvoc
-    else:
-        return getLocalVocContainer(context).getVocabulary(voc_id)
-from Products.CPSSchemas.VocabulariesTool import VocabulariesTool
-VocabulariesTool.getVocabularyFor = getVocabularyFor
Index: WAeUP_SRP/base/PatchCPSStackingDirectoryStorageAdapter.py
===================================================================
--- WAeUP_SRP/base/PatchCPSStackingDirectoryStorageAdapter.py	(revision 3672)
+++ 	(revision )
@@ -1,54 +1,0 @@
-# (C) Copyright 2004 Nuxeo SARL <http://nuxeo.com>
-# Author: Georges Racinet <gracinet@nuxeo.com>
-#
-# 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: utils.py 35055 2006-04-10 15:51:21Z gracinet $
-
-from Products.CMFCore.utils import getToolByName
-from Products.CPSDirectory.BaseDirectory import ConfigurationError
-
-def _setData(self, data, **kw):
-    """Set data to the entry, from a mapping."""
-
-    # TODO : this code should be placed in parent class
-    # and used by all StorageAdapter descendants
-    data = self._setDataDoProcess(data, **kw)
-
-    if not self._creation:
-        # XXX Note: if we attempt to change the backing id here, we get
-        # a KeyError. Unless an entry with the new backing id already
-        # exists,
-        # in which case, it would be overwritten...
-        # An explicit test would be better.
-        old_entry, b_dir = self._dir._getEntryFromBacking(self._id)
-        b_dir._editEntry(data)
-    else:
-        dir_id = self._dir.creation_dir
-        if "Student" in data.get('roles'):
-            dir_id = "students"
-        if not dir_id:
-            raise ValueError("Creation not allowed (no backing directory)")
-
-        dtool = getToolByName(self._dir, 'portal_directories')
-        try:
-            b_dir = getattr(dtool, dir_id)
-        except AttributeError:
-            raise ConfigurationError("No backing directory '%s'" % dir_id)
-
-        b_dir._createEntry(data)
-
-from Products.CPSDirectory.StackingDirectory import StackingStorageAdapter
-StackingStorageAdapter._setData = _setData
Index: WAeUP_SRP/base/PatchCPSUserFolderUserFolder.py
===================================================================
--- WAeUP_SRP/base/PatchCPSUserFolderUserFolder.py	(revision 3672)
+++ 	(revision )
@@ -1,155 +1,0 @@
-from AccessControl import ClassSecurityInfo
-from ExtensionClass import Base
-from Acquisition import Implicit
-from Acquisition import aq_base, aq_parent, aq_inner
-import re
-security = ClassSecurityInfo()
-
-def getCertificateObject(self,st_entry):
-    try:
-        return getattr(getattr(getattr(self.portal_url.getPortalObject().campus.academics,st_entry.faculty),
-                               st_entry.department).certificates,st_entry.course)
-    except:
-        return None
-
-security.declarePublic('getRolesInContext')
-def getRolesInContext(self, object):
-    """Get the list of roles assigned to the user.
-    This includes local roles assigned in the context of
-    the passed in object.
-    Knows about local roles blocking (roles starting with '-').
-    """
-    name = self.getUserName()
-    roles = self.getRoles()
-    # deal with groups
-    groups = self.getComputedGroups()
-    # end groups
-    local = {}
-    stop_loop = 0
-    real_object = object
-    object = aq_inner(object)
-    while 1:
-        # Collect all roles info
-        lrd = {}
-        local_roles = getattr(object, '__ac_local_roles__', None)
-        if local_roles:
-            if callable(local_roles):
-                local_roles = local_roles() or {}
-            for r in local_roles.get(name, ()):
-                if r:
-                    lrd[r] = None
-        local_group_roles = getattr(object, '__ac_local_group_roles__', None)
-        if local_group_roles:
-            if callable(local_group_roles):
-                local_group_roles = local_group_roles() or {}
-            for g in groups:
-                for r in local_group_roles.get(g, ()):
-                    if r:
-                        lrd[r] = None
-        lr = lrd.keys()
-        # Positive role assertions
-        for r in lr:
-            if r[0] != '-':
-                if not local.has_key(r):
-                    local[r] = 1 # acquired role
-        # Negative (blocking) role assertions
-        for r in lr:
-            if r[0] == '-':
-                r = r[1:]
-                if not r:
-                    # role '-' blocks all acquisition
-                    stop_loop = 1
-                    break
-                if not local.has_key(r):
-                    local[r] = 0 # blocked role
-        if stop_loop:
-            break
-        if hasattr(object, 'aq_parent'):
-            object = aq_inner(object.aq_parent)
-            continue
-        if hasattr(object, 'im_self'):
-            object = aq_inner(object.im_self)
-            continue
-        break
-    roles = list(roles)
-    for r, v in local.items():
-        if v: # only if not blocked
-            roles.append(r)
-    ## patch to assign dynamic roles for WAeUP
-    while 1:
-
-        o = ord(name[1])
-        if o >= 48 and o <= 57:
-            break
-        groups = self.portal_membership.getAuthenticatedMember().getGroups()
-        if not ("ClearanceOfficers" in groups or "CourseAdvisers" in groups):
-            break
-        if callable(real_object) and hasattr(real_object,'im_self'):
-            real_object = real_object.im_self
-
-        if real_object is None:
-            break
-        if hasattr(real_object,'portal_type') and\
-                   real_object.portal_type not in ("Student",
-                                                   "StudentClearance",
-                                                   "StudentStudyLevel",
-                                                   "StudentPersonal",
-                                                  ):
-            break
-        student_id = self.getStudentId()
-        res = self.students_catalog(id=student_id)
-        if len(res) != 1:
-            break
-        st_entry = res[0]
-
-        if real_object.portal_type == "StudentStudyLevel":
-            certificate_obj = getCertificateObject(self,st_entry)
-            if certificate_obj is None:
-                #from pdb import set_trace;set_trace()
-                break
-            if real_object.meta_type.endswith('Folder'): # it is a proxy
-                object = real_object
-            else:
-                object = real_object.aq_parent
-            level = object.getId()
-            d,m = divmod(int(level),100)
-            if m: # its repeater
-                level = "%s" % (d*100)
-            context_obj = getattr(certificate_obj,level,None)
-            if context_obj is None and d > 1: 
-                #may-be spillover t
-                level = "%s" % ((d-1)*100)
-                context_obj = getattr(certificate_obj,level,None)
-                if context_obj is None:
-                    #from pdb import set_trace;set_trace()
-                    break
-            allowed = set(('CourseAdviser', 'SectionManager'))
-        elif real_object.portal_type == "Student" and "CourseAdvisers" in groups:
-            #we need some special processing since CourseAdvisers are only
-            #specified per StudyLevel
-            certificate_obj = getCertificateObject(self,st_entry)
-            if certificate_obj is None:
-                #from pdb import set_trace;set_trace()
-                break
-            allowed = set(('CourseAdviser', 'SectionManager'))
-            for context_obj in certificate_obj.objectValues():
-                dynamic_roles = set(self.getRolesInContext(context_obj))
-                intersect = dynamic_roles & allowed
-                if intersect:
-                    roles.extend(list(intersect))
-            break
-        else:
-            res = self.portal_catalog(portal_type="Department",id=st_entry.department)
-            allowed = set(('ClearanceOfficer', 'SectionManager'))
-            if len(res) != 1:
-                break
-            context_obj = res[0].getObject()
-        dynamic_roles = set(self.getRolesInContext(context_obj))
-        intersect = dynamic_roles & allowed
-        if intersect:
-            roles.extend(list(intersect))
-        break
-    return roles
-
-from Products.CPSUserFolder.CPSUserFolder import CPSUser
-CPSUser.getRolesInContext = getRolesInContext
Index: WAeUP_SRP/base/PatchCPSWorkflowWorkflowDefinition.py
===================================================================
--- WAeUP_SRP/base/PatchCPSWorkflowWorkflowDefinition.py	(revision 3672)
+++ 	(revision )
@@ -1,183 +1,0 @@
-import logging
-from ZODB.loglevels import TRACE
-
-from AccessControl import ClassSecurityInfo
-from AccessControl import getSecurityManager
-from Acquisition import aq_parent
-from Acquisition import aq_inner
-from Globals import InitializeClass
-
-from Products.CMFCore.utils import getToolByName
-from Products.CMFCore.WorkflowCore import ObjectMoved
-from Products.CMFCore.WorkflowCore import ObjectDeleted
-from Products.CMFCore.WorkflowCore import WorkflowException
-
-from Products.DCWorkflow.DCWorkflow import DCWorkflowDefinition
-from Products.DCWorkflow.Transitions import TRIGGER_USER_ACTION
-
-#from expression import CPSStateChangeInfo as StateChangeInfo
-#from expression import createExprContext
-
-#from zope.interface import implements
-#from Products.CPSWorkflow.interfaces import ICPSWorkflowDefinition
-
-from Products.CPSCore.ProxyBase import ProxyBase
-from Products.CPSCore.EventServiceTool import getEventService
-
-#from constants import TRANSITION_FLAGS_EXPORT
-
-#
-# Backwards compatibility with CPS3 <= 3.2.x
-# Importing transition flags from here before.
-#
-
-from Products.CPSWorkflow.transitions import *
-from Products.CPSWorkflow.states import *
-
-
-logger = logging.getLogger('CPSWorkflow.workflow')
-security = ClassSecurityInfo()
-
-security.declarePrivate('updateStackDefinitionsRoleMappingFor')
-def updateStackDefinitionsRoleMappingsFor(self, ob, **kw):
-    """Update local roles for delegatees that are within workflow stacks
-    """
-    current_wf_var_id = kw.get('current_wf_var_id', '')
-
-    wftool = getToolByName(self, 'portal_workflow')
-    stackdefs = wftool.getStackDefinitionsFor(ob)
-
-    changed = 0
-
-    #
-    # First save the former local roles maping They will be
-    # overriden if defined on the state just after.  For the other
-    # ones, we need to keep the flrm's since the stackdef might be
-    # defined on another state further within the process
-    # definition or called by a stack flaged transition.
-    #
-    tdef = kw.get('tdef')
-    history = wftool.getHistoryOf(self.id, ob)
-    if history is not None:
-        try:
-            former_status = history[-2]
-        except IndexError:
-            # Virgin instance ;)
-            pass
-        else:
-            sflrm = former_status.get('sflrm', {})
-            for k, v in sflrm.items():
-                wftool.updateFormerLocalRoleMappingForStack(ob, self.id,
-                                                            k, v)
-
-    #
-    # Let's ask the stack definition for the list of local roles
-    #
-
-    for stackdef in stackdefs.keys():
-
-        # Update only the variable on wich the transition just applied
-        if not stackdef == current_wf_var_id:
-            continue
-
-        ds = wftool.getInfoFor(ob, stackdef, self.id)
-        former_mapping = wftool.getFormerLocalRoleMappingForStack(
-            ob, self.id, stackdef)
-        mapping = stackdefs[stackdef]._getLocalRolesMapping(ds)
-
-        #
-        # First remove associated local roles to the ones who are not
-        # supposed to have any (not a single one)
-        #
-
-        for id in former_mapping.keys():
-            old_local_roles = former_mapping[id]
-
-            # Remove all previous local roles in this case
-            if id not in mapping.keys():
-                roles_to_remove = old_local_roles
-
-            # Remove only local roles that are only within the
-            # previous mapping
-            else:
-                roles_to_remove = []
-                for old_role in old_local_roles:
-                    if old_role not in mapping[id]:
-                        roles_to_remove.append(old_role)
-
-
-            # Check that no other stack distributes currently this role
-            # to the current member
-            roles_to_keep = ()
-            for old_local_role in roles_to_remove:
-                stacks = wftool.getStacks(ob)
-                for stack_id, stack in stacks.items():
-                    if stack_id != current_wf_var_id:
-                        # The current transition is already
-                        # executed on ob thus we can take the
-                        # former mapping for this other given
-                        if (old_local_role in
-                            wftool.getFormerLocalRoleMappingForStack(
-                            ob, self.id, stack_id).get(id, ())):
-                            roles_to_keep += (old_local_role,)
-
-            # Do the actual job to remove absolete roles
-            for old_local_role in roles_to_remove:
-
-                # Don't remove those already managed by another stack
-                if old_local_role in roles_to_keep:
-                    continue
-
-                if not id.startswith('group:'):
-                    current_roles = list(
-                        ob.get_local_roles_for_userid(userid=id))
-                    new_roles = [role for role in current_roles
-                                 if role != old_local_role]
-                    ob.manage_delLocalRoles(userids=[id])
-                    if new_roles:
-                        ob.manage_setLocalRoles(id, new_roles)
-                else:
-                    id = id[len('group:'):]
-                    current_roles = list(
-                        ob.get_local_roles_for_groupid(groupid=id))
-                    new_roles = [role for role in current_roles
-                                 if role != old_local_role]
-                    ob.manage_delLocalGroupRoles(groupids=[id])
-                    if new_roles:
-                        ob.manage_setLocalGroupRoles(id, new_roles)
-
-            # Update ?
-            if roles_to_remove:
-                changed = 1
-
-        #
-        # Add local roles to member / groups within the mapping if
-        # they don't have the roles already in their merged local roles
-        #
-
-        for id in mapping.keys():
-            changed = 1
-            local_roles = mapping[id]
-            if not id.startswith('group:'):
-                current_roles = ob.get_local_roles_for_userid(userid=id)
-                new_roles = list(current_roles)
-                for role in local_roles:
-                    if role not in new_roles:
-                        new_roles.append(role)
-                ob.manage_setLocalRoles(id, new_roles)
-            else:
-                id = id[len('group:'):]
-                current_roles = ob.get_local_roles_for_groupid(groupid=id)
-                new_roles = list(current_roles)
-                for role in local_roles:
-                    if role not in new_roles:
-                        new_roles.append(role)
-                ob.manage_setLocalGroupRoles(id, new_roles)
-
-        # Update the former local role mapping
-        wftool.updateFormerLocalRoleMappingForStack(ob, self.id, stackdef,
-                                                    mapping)
-    return changed
-
-from Products.CPSWorkflow.workflow import WorkflowDefinition
-WorkflowDefinition.updateStackDefinitionsRoleMappingsFor = updateStackDefinitionsRoleMappingsFor
Index: WAeUP_SRP/base/PatchCatalogToolSearchResults.py
===================================================================
--- WAeUP_SRP/base/PatchCatalogToolSearchResults.py	(revision 3672)
+++ 	(revision )
@@ -1,14 +1,0 @@
-from Products.ZCatalog.ZCatalog import ZCatalog
-def searchResults(self, REQUEST=None, **kw):
-    """
-    Calls ZCatalog.searchResults with extra arguments that
-    limit the results to what the user is allowed to see.
-    don't do that for WAeUP
-    """
-    # user = _getAuthenticatedUser(self)
-    # kw[ 'allowedRolesAndUsers' ] = self._listAllowedRolesAndUsers( user )
-
-    return ZCatalog.searchResults(self, REQUEST, **kw)
-
-from Products.CMFCore import CatalogTool
-CatalogTool.searchResults = searchResults
Index: WAeUP_SRP/base/PatchCatalogToolXMLAdapter.py
===================================================================
--- WAeUP_SRP/base/PatchCatalogToolXMLAdapter.py	(revision 3672)
+++ 	(revision )
@@ -1,64 +1,0 @@
-#from Products.CMFCore.utils import getToolByName
-#from zope.app import zapi
-#from Products.GenericSetup.interfaces import INode
-#import Products
-
-def _importNode(self, node):
-    """Import the object from the DOM node.
-    """
-    na = node.attributes.items()
-    something_changed = False
-    new_indexes = []
-    new_columns = []
-    meta_type = na[0][1]
-    name = na[1][1]
-    if self.environ.shouldPurge():
-        self._purgeProperties()
-        self._purgeObjects()
-        self._purgeIndexes()
-        self._purgeColumns()
-    columns = []
-    # for col in self._extractColumns()._get_childNodes():
-    #     columns.append(col.attributes.items()[0][1])
-    for col in self.context.schema():
-        columns.append(col)
-    inds = {}
-    # for ind in self._extractIndexes()._get_childNodes():
-    #     inds[ind.attributes.items()[1][1]] = ind.attributes.items()[0][1]
-    for ind in self.context.getIndexObjects():
-        inds[ind.getId()] = ind.meta_type
-    if meta_type in ('CMF Catalog',"WAeUP Table"):
-        self._logger.info("Working on %s"  % na[1][1])
-        for ch in node._get_childNodes():
-            if ch.nodeName in ('index',):
-                cha = ch.attributes.items()
-                iname = cha[1][1]
-                itype = cha[0][1]
-                if iname in inds.keys() and inds[iname] == itype:
-                    continue
-                new_indexes.append(iname)
-                something_changed = True
-            elif ch.nodeName in ('column',):
-                cha = ch.attributes.items()
-                iname = cha[0][1]
-                if iname in columns:
-                    continue
-                new_columns.append(iname)
-                something_changed = True
-            else:
-                continue
-    if something_changed :
-        #import pdb;pdb.set_trace()
-        self._logger.info("Catalog tool %s cleared."  % na[1][1])
-        self._logger.info("%s modified." % na[1][1])
-        self._initProperties(node)
-        if new_indexes and len(self.context()) == 0: #disable creation of new indexes if records in the table
-            self._initObjects(node)
-            self._initIndexes(node)
-        self._initColumns(node)
-        #self._refreshCatalog()
-
-    self._logger.info("Catalog tool %s imported."  % na[1][1])
-    
-from Products.CPSCore.exportimport.catalog import CatalogToolXMLAdapter
-CatalogToolXMLAdapter._importNode = _importNode
Index: WAeUP_SRP/base/PatchExtendedWidgetsCPSDateTimeWidget.py
===================================================================
--- WAeUP_SRP/base/PatchExtendedWidgetsCPSDateTimeWidget.py	(revision 3672)
+++ 	(revision )
@@ -1,65 +1,0 @@
-#-*- mode: python; mode: fold -*-
-import re
-from DateTime.DateTime import DateTime
-from Products.CPSSchemas.ExtendedWidgets import CPSDateTimeWidget
-CPSDateTimeWidget.time_hour_default = '00'
-
-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
-    #import pdb;pdb.set_trace()
-    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:
-            d, m, y = re.split(r'[/,\-,\.]',date) # always use d/m/y and use /,- or . as separator
-            #d, m, y = date.split('/') # always use d/m/y
-            # locale = self.translation_service.getSelectedLanguage()
-            # if False and locale in ('en', 'hu'): 
-            #     m, d, y = date.split('/')
-            # else:
-        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/base/PatchFasterSessionData.py
===================================================================
--- WAeUP_SRP/base/PatchFasterSessionData.py	(revision 3672)
+++ 	(revision )
@@ -1,3 +1,0 @@
-from Products.faster.sessiondata import CBSessionDataContainer
-from Products.faster.appendict import AppendOnlyDict
-CBSessionDataContainer._BUCKET_TYPE = AppendOnlyDict
Index: WAeUP_SRP/base/PatchLocalizerMessageCatalog_gettext.py
===================================================================
--- WAeUP_SRP/base/PatchLocalizerMessageCatalog_gettext.py	(revision 3672)
+++ 	(revision )
@@ -1,50 +1,0 @@
-from types import StringType, UnicodeType
-from AccessControl import ClassSecurityInfo
-from Products.Localizer.Utils import charsets, get_language_name, lang_negotiator
-security = ClassSecurityInfo()
-security.declarePublic('gettext')
-# set default for add = 0
-_marker = []
-def gettext(self, message, lang=None, add=0, default=_marker):
-    """Returns the message translation from the database if available.
-
-    If add=1, add any unknown message to the database.
-    If a default is provided, use it instead of the message id
-    as a translation for unknown messages.
-    """
-
-    if type(message) not in (StringType, UnicodeType):
-        raise TypeError, 'only strings can be translated.'
-
-    message = message.strip()
-
-    if default is _marker:
-        default = message
-
-    # Add it if it's not in the dictionary
-    if add and not self._messages.has_key(message) and message:
-        self._messages[message] = PersistentMapping()
-
-    # Get the string
-    if self._messages.has_key(message):
-        m = self._messages[message]
-
-        if lang is None:
-            # Builds the list of available languages
-            # should the empty translations be filtered?
-            available_languages = list(self._languages)
-
-            # Get the language!
-            lang = lang_negotiator(available_languages)
-
-            # Is it None? use the default
-            if lang is None:
-                lang = self._default_language
-
-        if lang is not None:
-            return m.get(lang) or default
-
-    return default
-from Products.Localizer.MessageCatalog import MessageCatalog
-MessageCatalog.gettext = gettext
-
Index: WAeUP_SRP/base/PatchQueueCatalogProcessQueue.py
===================================================================
--- WAeUP_SRP/base/PatchQueueCatalogProcessQueue.py	(revision 3672)
+++ 	(revision )
@@ -1,189 +1,0 @@
-import sets
-import logging
-from types import StringType
-from AccessControl.Permissions \
-import manage_zcatalog_entries, view_management_screens
-from AccessControl import ModuleSecurityInfo, ClassSecurityInfo
-from AccessControl.SecurityInfo import ClassSecurityInformation
-from Products.PageTemplates.PageTemplateFile import PageTemplateFile
-from Products.QueueCatalog.CatalogEventQueue import CatalogEventQueue, EVENT_TYPES, ADDED_EVENTS
-from Products.QueueCatalog.CatalogEventQueue import ADDED, CHANGED, CHANGED_ADDED, REMOVED
-from Products.QueueCatalog.CatalogEventQueue import SAFE_POLICY, ALTERNATIVE_POLICY
-from Products.QueueCatalog.QueueCatalog import cataloged
-from Products.QueueCatalog.QueueCatalog import QueueCatalog
-from ZODB.POSException import ConflictError
-from ZEO.Exceptions import ClientDisconnected
-logger = logging.getLogger('event.QueueCatalog')
-security = ClassSecurityInformation()
-
-def __init__(self,
-             buckets=1009,
-             conflict_policy=SAFE_POLICY,
-             bypass = False,
-             location = "portal_catalog_real"):
-    self._buckets = buckets
-    self._conflict_policy = conflict_policy
-    self._clearQueues()
-    self._bypass = bypass
-    self._location = location
-
-security.declareProtected(view_management_screens, 'getBypassQueue')
-def getBypassQueue(self):
-    "get _by_pass"
-    if not hasattr(self,"_bypass"):
-        self._bypass = False
-    return getattr(self,'_bypass',False)
-
-security.declareProtected(view_management_screens, 'setBypassQueue')
-def setBypassQueue(self, bypass=False):
-    "set _bypass"
-    self._bypass = bypass
-
-def catalog_object(self, obj, uid=None, idxs=None, update_metadata=1):
-    # update_metadata=0 is ignored if the queued catalog is set to
-    # update metadata during queue processing, rather than immediately
-
-    # similarly, limiting the idxs only limits the immediate indexes.  If
-    # any work needs to be done in the queue processing, it will all be
-    # done: we have not implemented partial indexing during queue
-    # processing.  The only way to avoid any of it is to avoid all of it
-    # (i.e., update metadata immediately and don't have any indexes to
-    # update on the queued side).
-
-    # Make sure the current context is allowed to do this:
-    catalog_object = self.getZCatalog('catalog_object')
-
-    if uid is None:
-        uid = '/'.join(obj.getPhysicalPath())
-    elif not isinstance(uid, StringType):
-        uid = '/'.join(uid)
-
-    catalog = self.getZCatalog()
-    cat_indexes = sets.Set(catalog.indexes())
-    immediate_indexes = sets.Set(self._immediate_indexes)
-    cat_indexes -= immediate_indexes
-
-    # The ZCatalog API doesn't allow us to distinguish between
-    # adds and updates, so we have to try to figure this out
-    # ourselves.
-
-    # There's a risk of a race here. What if there is a previously
-    # unprocessed add event? If so, then this should be a changed
-    # event. If we undo this transaction later, we'll generate a
-    # remove event, when we should generate an add changed event.
-    # To avoid this, we need to make sure we see consistent values
-    # of the event queue. We also need to avoid resolving
-    # (non-undo) conflicts of add events. This will slow things
-    # down a bit, but adds should be relatively infrequent.
-    bypass_queue = self.getBypassQueue()
-    # Now, try to decide if the catalog has the uid (path).
-    already_cataloged = cataloged(catalog, uid)
-    if not already_cataloged:
-        # Looks like we should add, but maybe there's already a
-        # pending add event. We'd better check the event queue:
-        already_cataloged = (
-            self._queues[hash(uid) % self._buckets].getEvent(uid) in
-            ADDED_EVENTS)
-            
-    if idxs and already_cataloged:
-        # if not already_cataloged, we index the whole thing
-        idxs = sets.Set(idxs)
-        immediate_indexes.intersection_update(idxs)
-        cat_indexes.intersection_update(idxs)
-
-    immediate_metadata = self.getImmediateMetadataUpdate()
-    if cat_indexes or update_metadata and not immediate_metadata:
-        if bypass_queue:
-            catalog_object(obj, uid, cat_indexes)
-        else:
-            #import pdb;pdb.set_trace()
-            self._update(uid, already_cataloged and CHANGED or ADDED)
-        # Update some of the indexes immediately.
-    if immediate_indexes:
-        # Update some of the indexes immediately.
-        catalog.catalog_object(
-            obj, uid, immediate_indexes,
-            update_metadata=update_metadata and immediate_metadata)
-    elif update_metadata and immediate_metadata:
-        # if it is added, no point in doing the metadata, and it will be
-        # done in the queue process anyway
-        catalog._catalog.updateMetadata(obj, uid)
-
-def _process_queue(self, queue, limit):
-    """Process a single queue"""
-    catalog = self.getZCatalog()
-
-    if self.getProcessAllIndexes():
-        #idxs = None
-        idxs = catalog.indexes()
-    else:
-        cat_indexes = sets.Set(catalog.indexes())
-        immediate_indexes = sets.Set(self._immediate_indexes)
-        if not immediate_indexes or immediate_indexes==cat_indexes:
-            idxs = catalog.indexes() # do all of 'em
-        else:
-            idxs = list(cat_indexes - immediate_indexes)
-    events = queue.process(limit)
-    count = 0
-
-    for uid, (t, event) in events.items():
-        if event is REMOVED:
-            try:
-                if cataloged(catalog, uid):
-                    catalog.uncatalog_object(uid)
-            except (ConflictError, ClientDisconnected):
-                logger.error('conflict-error uncataloging object', exc_info=True)
-            except:
-                logger.error('error uncataloging object', exc_info=True)
-        else:
-            # add or change
-            if event is CHANGED and not cataloged(catalog, uid):
-                continue
-            # Note that the uid may be relative to the catalog.
-            obj = catalog.unrestrictedTraverse(uid, None)
-            if obj is not None:
-                immediate_metadata = self.getImmediateMetadataUpdate()
-                try:
-                    catalog.catalog_object(
-                        obj, uid, idxs=idxs,
-                        update_metadata=not immediate_metadata)
-                except (ConflictError, ClientDisconnected):
-                    logger.error('conflict-error uncataloging object', exc_info=True)
-                    #raise
-                except:
-                    logger.error('error cataloging object', exc_info=True)
-
-        count = count + 1
-
-    return count
-def manage_edit(self, title='', location='', immediate_indexes=(),
-                immediate_removal=0, bucket_count=0, immediate_metadata=0,
-                all_indexes=0, conflict_policy=SAFE_POLICY, RESPONSE=None,
-               enable_bypass=0):
-    """ Edit the instance """
-    self.title = title
-    self.setLocation(location or None)
-    self.setImmediateIndexes(immediate_indexes)
-    self.setImmediateRemoval(immediate_removal)
-    self.setImmediateMetadataUpdate(immediate_metadata)
-    self.setProcessAllIndexes(all_indexes)
-    self.setConflictPolicy(conflict_policy)
-    self.setBypassQueue(enable_bypass)
-    if bucket_count:
-        bucket_count = int(bucket_count)
-        if bucket_count != self.getBucketCount():
-            self.setBucketCount(bucket_count)
-
-    if RESPONSE is not None:
-        RESPONSE.redirect('%s/manage_editForm?manage_tabs_message='
-                            'Properties+changed' % self.absolute_url())
-
-QueueCatalog.__init__ = __init__
-QueueCatalog.getBypassQueue = getBypassQueue
-QueueCatalog.getBypassQueue__roles__ = ['Manager', 'Owner',]
-QueueCatalog.setBypassQueue = setBypassQueue
-QueueCatalog.setBypassQueue__roles__ = ['Manager', 'Owner',]
-QueueCatalog.catalog_object = catalog_object
-QueueCatalog._process_queue = _process_queue
-QueueCatalog.manage_editForm = PageTemplateFile('zmi/qc_edit', globals())
-QueueCatalog.manage_edit = manage_edit
Index: WAeUP_SRP/base/PatchRenderActionIcon.py
===================================================================
--- WAeUP_SRP/base/PatchRenderActionIcon.py	(revision 3672)
+++ 	(revision )
@@ -1,44 +1,0 @@
-from Products.CMFCore.utils import getToolByName
-
-ACTIONICON_RAMCACHE_ID = 'actioncons'
-IMG_TAG = '<img src="%s" width="%s" height="%s" alt="%s" />'
-
-def renderActionIcon(self, category=None, action_id=None,
-                     base_url='', alt=''):
-    """Renders the action's icon"""
-
-    if category is None or action_id is None:
-        return None
-
-    aitool = getToolByName(self, 'portal_actionicons', None)
-    if aitool is None:
-        return None
-
-    cache = self.getCache(ACTIONICON_RAMCACHE_ID)
-    # compute the cache index
-    index = (action_id, category, base_url, alt)
-
-    img_tag = cache.getEntry(index)
-    # the icon is not in the cache
-    if img_tag is None:
-        icon_path = aitool.queryActionIcon(category=category,
-            action_id=action_id)
-        if not icon_path:
-            return
-
-
-
-        # fall back to the icon path specified in CMFActionIcons
-        img = self.unrestrictedTraverse(icon_path, default=None)
-        if img is None:
-            return None
-        img_tag = IMG_TAG % (icon_path,
-                             getattr(img, 'width', 0),
-                             getattr(img, 'height', 0),
-                             alt)
-        if cache is not None:
-            cache.setEntry(index, img_tag)
-    return img_tag
-
-from Products.CPSPortlets.PortletsTool import PortletsTool
-PortletsTool.renderActionIcon = renderActionIcon
Index: WAeUP_SRP/base/PatchZCatalogCatalogUpdateMetadata.py
===================================================================
--- WAeUP_SRP/base/PatchZCatalogCatalogUpdateMetadata.py	(revision 3672)
+++ 	(revision )
@@ -1,42 +1,0 @@
-from BTrees.IOBTree import IOBTree
-from random import randint
-def updateMetadata(self, object, uid):
-    """ Given an object and a uid, update the column data for the
-    uid with the object data iff the object has changed """
-    data = self.data
-    index = self.uids.get(uid, None)
-    newDataRecord = self.recordify(object)
-
-    if index is None:
-        if type(data) is IOBTree:
-            # New style, get random id
-
-            index=getattr(self, '_v_nextid', 0)
-            if index % 4000 == 0:
-                index = randint(-2000000000, 2000000000)
-            while not data.insert(index, newDataRecord):
-                index = randint(-2000000000, 2000000000)
-
-            # We want ids to be somewhat random, but there are
-            # advantages for having some ids generated
-            # sequentially when many catalog updates are done at
-            # once, such as when reindexing or bulk indexing.
-            # We allocate ids sequentially using a volatile base,
-            # so different threads get different bases. This
-            # further reduces conflict and reduces churn in
-            # here and it result sets when bulk indexing.
-            self._v_nextid=index+1
-        else:
-            if data:
-                # find the next available unique id
-                index = data.keys()[-1] + 1
-            else:
-                index=0
-            # meta_data is stored as a tuple for efficiency
-            data[index] = newDataRecord
-    else:
-        #if True or data.get(index, 0) != newDataRecord:
-        data[index] = newDataRecord
-    return index
-from Products.ZCatalog.Catalog import Catalog
-Catalog.updateMetadata = updateMetadata
Index: WAeUP_SRP/base/PatchZODBConnectionOpen.py
===================================================================
--- WAeUP_SRP/base/PatchZODBConnectionOpen.py	(revision 3672)
+++ 	(revision )
@@ -1,61 +1,0 @@
-from ZODB.Connection import Connection
-from time import time
-import transaction
-
-global_reset_counter = 0
-
-def open(self, transaction_manager=None, mvcc=True, synch=True,
-            delegate=True):
-    """Register odb, the DB that this Connection uses.
-
-    This method is called by the DB every time a Connection
-    is opened.  Any invalidations received while the Connection
-    was closed will be processed.
-
-    If the global module function resetCaches() was called, the
-    cache will be cleared.
-
-    Parameters:
-    odb: database that owns the Connection
-    mvcc: boolean indicating whether MVCC is enabled
-    transaction_manager: transaction manager to use.  None means
-        use the default transaction manager.
-    synch: boolean indicating whether Connection should
-    register for afterCompletion() calls.
-    """
-
-    # TODO:  Why do we go to all the trouble of setting _db and
-    # other attributes on open and clearing them on close?
-    # A Connection is only ever associated with a single DB
-    # and Storage.
-
-    self._opened = time()
-    self._synch = synch
-    self._mvcc = mvcc and not self._version
-    if transaction_manager is None:
-        transaction_manager = transaction.manager
-
-    self.transaction_manager = transaction_manager
-
-    # js 28-5-2007 always call _flush_invalidations 
-    self._flush_invalidations()
-    if self._reset_counter != global_reset_counter:
-        # New code is in place.  Start a new cache.
-        self._resetCache()
-    # else:
-    #     import pdb; pdb.set_trace()
-    #     self._flush_invalidations()
-
-    if synch:
-        transaction_manager.registerSynch(self)
-
-    if self._cache is not None:
-        self._cache.incrgc() # This is a good time to do some GC
-
-    if delegate:
-        # delegate open to secondary connections
-        for connection in self.connections.values():
-            if connection is not self:
-                connection.open(transaction_manager, mvcc, synch, False)
-
-Connection.open = open
Index: WAeUP_SRP/base/PatchZODBDirectory_searchEntries.py
===================================================================
--- WAeUP_SRP/base/PatchZODBDirectory_searchEntries.py	(revision 3672)
+++ 	(revision )
@@ -1,82 +1,0 @@
-# (C) Copyright 2004 Nuxeo SARL <http://nuxeo.com>
-# Author: Georges Racinet <gracinet@nuxeo.com>
-# Patched by 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: utils.py 35055 2006-04-10 15:51:21Z gracinet $
-
-from zLOG import LOG, DEBUG, TRACE
-from copy import deepcopy
-from AccessControl import ClassSecurityInfo
-from Products.CPSSchemas.StorageAdapter import AttributeStorageAdapter
-from Products.CPSDirectory.utils import QueryMatcher
-security = ClassSecurityInfo()
-
-
-security.declarePrivate('_searchEntries')
-def _searchEntries(self, return_fields=None, **kw):
-    """Search for entries in the directory.
-    """
-    if self.ZCacheable_isCachingEnabled():
-        keyset = {'return_fields' : return_fields}
-        keyset.update(kw)
-        LOG('ZODBDirectory._searchEntries', TRACE,
-            "Searching cache for %s" % (keyset,))
-        from_cache = self.ZCacheable_get(keywords=keyset)
-        if from_cache is not None:
-            LOG('ZODBDirectory._searchEntries', TRACE, " -> results=%s" %
-                (from_cache[:20],))
-            return deepcopy(from_cache)
-    else:
-        keyset = None
-
-    matcher = QueryMatcher(kw, accepted_keys=self._getFieldIds(),
-                           substring_keys=self.search_substring_fields)
-
-    # Compute needed fields from object.
-    # All fields we need to return.
-    field_ids_d, return_fields = self._getSearchFields(return_fields)
-    # Add all fields the search is made on.
-    field_ids = matcher.getKeysSet().union(field_ids_d)
-
-    # Do the search.
-    schema = self._getUniqueSchema()
-    adapter = AttributeStorageAdapter(schema, None,
-                                      field_ids=list(field_ids))
-    res = []
-    for id, ob in self.objectItems():
-        if getattr(ob,'homeless',False):
-            continue
-        adapter.setContextObject(ob)
-        entry = adapter.getData()
-        adapter.finalizeDefaults(entry)
-        if not matcher.match(entry):
-            continue
-        # Compute result to return.
-        if return_fields is None:
-            res.append(id)
-        else:
-            d = {}
-            for key in return_fields:
-                d[key] = entry[key]
-            res.append((id, d))
-
-    if keyset is not None:
-        LOG('ZODBDirectory._searchEntries', TRACE, "Putting in cache")
-        self.ZCacheable_set(res, keywords=keyset)
-
-    return deepcopy(res)
-from Products.CPSDirectory.ZODBDirectory import  ZODBDirectory
-ZODBDirectory._searchEntries = _searchEntries
Index: WAeUP_SRP/base/__init__.py
===================================================================
--- WAeUP_SRP/base/__init__.py	(revision 3672)
+++ WAeUP_SRP/base/__init__.py	(revision 3673)
@@ -12,24 +12,6 @@
 from Products.CPSDirectory.DirectoryTool import DirectoryTypeRegistry
 
-import PatchCPSWorkflowWorkflowDefinition
-import PatchCatalogToolSearchResults
-import PatchCatalogToolXMLAdapter
-import PatchCPSSchemasAttributeStorageAdapter
-import PatchCPSSchemasDataModel
-import PatchCPSSchemasVocabulariesTool
-import PatchCPSMembershipTool
-import PatchCPSUserFolderUserFolder
-import PatchCPSStackingDirectoryStorageAdapter
-import PatchBasicWidgetsCPSStringWidget
-import PatchExtendedWidgetsCPSDateTimeWidget
-import PatchBasicWidgetsUnprepare
-import PatchFasterSessionData
-import PatchQueueCatalogProcessQueue
-import PatchZCatalogCatalogUpdateMetadata
-# Only for CPS 3.4.1. In 3.4.2 and later this should be fixed.
-import PatchCPSDefaultImportExport
-import PatchRenderActionIcon
-#import PatchZODBConnectionOpen
-import PatchLocalizerMessageCatalog_gettext
+import patches
+
 import Products.WAeUP_SRP.WAeUPPermissions
 import WAeUPTool
Index: WAeUP_SRP/base/patches/PatchBasicWidgetsCPSStringWidget.py
===================================================================
--- WAeUP_SRP/base/patches/PatchBasicWidgetsCPSStringWidget.py	(revision 3673)
+++ WAeUP_SRP/base/patches/PatchBasicWidgetsCPSStringWidget.py	(revision 3673)
@@ -0,0 +1,5 @@
+#-*- mode: python; mode: fold -*-
+from Products.CPSSchemas.BasicWidgets import CPSStringWidget
+from Products.CPSSchemas.BasicWidgets import CPSEmailWidget
+CPSStringWidget.display_width = 30
+CPSEmailWidget.display_width = 30
Index: WAeUP_SRP/base/patches/PatchBasicWidgetsUnprepare.py
===================================================================
--- WAeUP_SRP/base/patches/PatchBasicWidgetsUnprepare.py	(revision 3673)
+++ WAeUP_SRP/base/patches/PatchBasicWidgetsUnprepare.py	(revision 3673)
@@ -0,0 +1,9 @@
+def unprepare(self, datastructure):
+    # Remove costly things already stored from the datastructure
+    try:
+        del datastructure[self.getWidgetId()]
+    except KeyError:
+        # unprepare may be called several times
+        pass
+from Products.CPSSchemas.BasicWidgets import CPSFileWidget
+CPSFileWidget.unprepare = unprepare
Index: WAeUP_SRP/base/patches/PatchCPSDefaultImportExport.py
===================================================================
--- WAeUP_SRP/base/patches/PatchCPSDefaultImportExport.py	(revision 3673)
+++ WAeUP_SRP/base/patches/PatchCPSDefaultImportExport.py	(revision 3673)
@@ -0,0 +1,75 @@
+from Products.CPSDocument.exportimport import importCPSObjects
+from Products.CMFCore.utils import getToolByName
+from zope.app import zapi
+from Products.GenericSetup.interfaces import INode
+import Products
+
+# Patch to allow the roots importer to create CMF objects.
+# Only for CPS 3.4.1. In 3.4.2 and later this should be fixed.
+
+def _initObjects(self, node):
+    for child in node.childNodes:
+        if child.nodeName != 'object':
+            continue
+        if child.hasAttribute('deprecated'):
+            continue
+        parent = self.context
+
+        obj_id = str(child.getAttribute('name'))
+        if child.hasAttribute('remove'):
+            parent._delObject(obj_id)
+            continue
+
+        if obj_id not in parent.objectIds():
+            portal_type = str(child.getAttribute('portal_type'))
+            if portal_type:
+                wftool = getToolByName(parent, 'portal_workflow')
+                wftool.invokeFactoryFor(parent, portal_type, obj_id)
+            else:
+                meta_type = str(child.getAttribute('meta_type'))
+                __traceback_info__ = obj_id, meta_type
+                for mt_info in Products.meta_types:
+                    if mt_info['name'] == meta_type:
+                        parent._setObject(obj_id, mt_info['instance'](obj_id))
+                        break
+                else:
+                    raise ValueError("unknown meta_type '%s'" % meta_type)
+                        
+
+        if child.hasAttribute('insert-before'):
+            insert_before = child.getAttribute('insert-before')
+            if insert_before == '*':
+                parent.moveObjectsToTop(obj_id)
+            else:
+                try:
+                    position = parent.getObjectPosition(insert_before)
+                    if parent.getObjectPosition(obj_id) < position:
+                        position -= 1
+                    parent.moveObjectToPosition(obj_id, position)
+                except ValueError:
+                    pass
+        elif child.hasAttribute('insert-after'):
+            insert_after = child.getAttribute('insert-after')
+            if insert_after == '*':
+                parent.moveObjectsToBottom(obj_id)
+            else:
+                try:
+                    position = parent.getObjectPosition(insert_after)
+                    if parent.getObjectPosition(obj_id) < position:
+                        position -= 1
+                    parent.moveObjectToPosition(obj_id, position+1)
+                except ValueError:
+                    pass
+
+        obj = getattr(self.context, obj_id)
+        if child.hasAttribute('Title'):
+            print "set title",obj_id 
+            obj.title = child.getAttribute('Title')
+        
+        importer = zapi.queryMultiAdapter((obj, self.environ), INode)
+        if importer:
+            importer.node = child
+
+from Products.CPSDefault.exportimport import RootXMLAdapter
+RootXMLAdapter._initObjects = _initObjects
+
Index: WAeUP_SRP/base/patches/PatchCPSMembershipTool.py
===================================================================
--- WAeUP_SRP/base/patches/PatchCPSMembershipTool.py	(revision 3673)
+++ WAeUP_SRP/base/patches/PatchCPSMembershipTool.py	(revision 3673)
@@ -0,0 +1,8 @@
+#-*- mode: python; mode: fold -*-
+from Products.CPSCore.CPSMembershipTool import CPSMembershipTool
+CPSMembershipTool.roles_managing_local_roles = ('WorkspaceManager', 
+                                                'SectionManager',
+                                                'SectionOfficer',
+                                                )
+
+
Index: WAeUP_SRP/base/patches/PatchCPSSchemasAttributeStorageAdapter.py
===================================================================
--- WAeUP_SRP/base/patches/PatchCPSSchemasAttributeStorageAdapter.py	(revision 3673)
+++ WAeUP_SRP/base/patches/PatchCPSSchemasAttributeStorageAdapter.py	(revision 3673)
@@ -0,0 +1,6 @@
+def _getContentUrl(self, object, field_id, file_name):
+    return '%s/%s' % (
+        object.aq_parent.absolute_url(), field_id)
+    
+from Products.CPSSchemas.StorageAdapter import AttributeStorageAdapter
+AttributeStorageAdapter._getContentUrl = _getContentUrl
Index: WAeUP_SRP/base/patches/PatchCPSSchemasDataModel.py
===================================================================
--- WAeUP_SRP/base/patches/PatchCPSSchemasDataModel.py	(revision 3673)
+++ WAeUP_SRP/base/patches/PatchCPSSchemasDataModel.py	(revision 3673)
@@ -0,0 +1,18 @@
+def _commitData(self):
+    """Compute dependent fields and write data into object."""
+
+    # Compute dependent fields.
+    data = self.data
+    for schema in self._schemas:
+        for field_id, field in schema.items():
+            if self.isDirty(field_id):
+                #LOG("DataModel", TRACE, "Computing field '%s'" % (field_id,))
+                field.computeDependantFields(self._schemas, data,
+                                             context=self._context)
+
+    # Call the adapters to store the data.
+    for adapter in self._adapters:
+        adapter.setData(data)
+
+from Products.CPSSchemas.DataModel import DataModel
+DataModel._commitData = _commitData
Index: WAeUP_SRP/base/patches/PatchCPSSchemasVocabulariesTool.py
===================================================================
--- WAeUP_SRP/base/patches/PatchCPSSchemasVocabulariesTool.py	(revision 3673)
+++ WAeUP_SRP/base/patches/PatchCPSSchemasVocabulariesTool.py	(revision 3673)
@@ -0,0 +1,30 @@
+from Products.CPSSchemas.VocabulariesTool import LOCAL_VOCABULARY_CONTAINER_ID
+def getVocabularyFor(self, context, voc_id):
+    """Returns vocabulary for given context."""
+
+    def hasLocalVocContainer(context):
+        if getattr(context, 'hasObject', None) is None:
+            return False
+        return context.hasObject(LOCAL_VOCABULARY_CONTAINER_ID)
+
+    def getLocalVocContainer(context):
+        return context._getOb(LOCAL_VOCABULARY_CONTAINER_ID, None)
+
+    getParentNode = lambda node: getattr(getattr(node, 'aq_inner', None),
+                                         'aq_parent', None)
+
+    if not hasLocalVocContainer(context):
+        parent = getParentNode(context)
+        while parent is not None:
+            if hasLocalVocContainer(parent):
+                return getLocalVocContainer(parent).getVocabulary(voc_id)
+            parent = getParentNode(parent)
+        # no local vocabulary container found for given context
+        globvoc = self._getOb(voc_id, None)
+        if globvoc is None:
+            raise KeyError, 'No vocabulary by id %s' % voc_id
+        return globvoc
+    else:
+        return getLocalVocContainer(context).getVocabulary(voc_id)
+from Products.CPSSchemas.VocabulariesTool import VocabulariesTool
+VocabulariesTool.getVocabularyFor = getVocabularyFor
Index: WAeUP_SRP/base/patches/PatchCPSStackingDirectoryStorageAdapter.py
===================================================================
--- WAeUP_SRP/base/patches/PatchCPSStackingDirectoryStorageAdapter.py	(revision 3673)
+++ WAeUP_SRP/base/patches/PatchCPSStackingDirectoryStorageAdapter.py	(revision 3673)
@@ -0,0 +1,54 @@
+# (C) Copyright 2004 Nuxeo SARL <http://nuxeo.com>
+# Author: Georges Racinet <gracinet@nuxeo.com>
+#
+# 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: utils.py 35055 2006-04-10 15:51:21Z gracinet $
+
+from Products.CMFCore.utils import getToolByName
+from Products.CPSDirectory.BaseDirectory import ConfigurationError
+
+def _setData(self, data, **kw):
+    """Set data to the entry, from a mapping."""
+
+    # TODO : this code should be placed in parent class
+    # and used by all StorageAdapter descendants
+    data = self._setDataDoProcess(data, **kw)
+
+    if not self._creation:
+        # XXX Note: if we attempt to change the backing id here, we get
+        # a KeyError. Unless an entry with the new backing id already
+        # exists,
+        # in which case, it would be overwritten...
+        # An explicit test would be better.
+        old_entry, b_dir = self._dir._getEntryFromBacking(self._id)
+        b_dir._editEntry(data)
+    else:
+        dir_id = self._dir.creation_dir
+        if "Student" in data.get('roles'):
+            dir_id = "students"
+        if not dir_id:
+            raise ValueError("Creation not allowed (no backing directory)")
+
+        dtool = getToolByName(self._dir, 'portal_directories')
+        try:
+            b_dir = getattr(dtool, dir_id)
+        except AttributeError:
+            raise ConfigurationError("No backing directory '%s'" % dir_id)
+
+        b_dir._createEntry(data)
+
+from Products.CPSDirectory.StackingDirectory import StackingStorageAdapter
+StackingStorageAdapter._setData = _setData
Index: WAeUP_SRP/base/patches/PatchCPSUserFolderUserFolder.py
===================================================================
--- WAeUP_SRP/base/patches/PatchCPSUserFolderUserFolder.py	(revision 3673)
+++ WAeUP_SRP/base/patches/PatchCPSUserFolderUserFolder.py	(revision 3673)
@@ -0,0 +1,155 @@
+from AccessControl import ClassSecurityInfo
+from ExtensionClass import Base
+from Acquisition import Implicit
+from Acquisition import aq_base, aq_parent, aq_inner
+import re
+security = ClassSecurityInfo()
+
+def getCertificateObject(self,st_entry):
+    try:
+        return getattr(getattr(getattr(self.portal_url.getPortalObject().campus.academics,st_entry.faculty),
+                               st_entry.department).certificates,st_entry.course)
+    except:
+        return None
+
+security.declarePublic('getRolesInContext')
+def getRolesInContext(self, object):
+    """Get the list of roles assigned to the user.
+    This includes local roles assigned in the context of
+    the passed in object.
+    Knows about local roles blocking (roles starting with '-').
+    """
+    name = self.getUserName()
+    roles = self.getRoles()
+    # deal with groups
+    groups = self.getComputedGroups()
+    # end groups
+    local = {}
+    stop_loop = 0
+    real_object = object
+    object = aq_inner(object)
+    while 1:
+        # Collect all roles info
+        lrd = {}
+        local_roles = getattr(object, '__ac_local_roles__', None)
+        if local_roles:
+            if callable(local_roles):
+                local_roles = local_roles() or {}
+            for r in local_roles.get(name, ()):
+                if r:
+                    lrd[r] = None
+        local_group_roles = getattr(object, '__ac_local_group_roles__', None)
+        if local_group_roles:
+            if callable(local_group_roles):
+                local_group_roles = local_group_roles() or {}
+            for g in groups:
+                for r in local_group_roles.get(g, ()):
+                    if r:
+                        lrd[r] = None
+        lr = lrd.keys()
+        # Positive role assertions
+        for r in lr:
+            if r[0] != '-':
+                if not local.has_key(r):
+                    local[r] = 1 # acquired role
+        # Negative (blocking) role assertions
+        for r in lr:
+            if r[0] == '-':
+                r = r[1:]
+                if not r:
+                    # role '-' blocks all acquisition
+                    stop_loop = 1
+                    break
+                if not local.has_key(r):
+                    local[r] = 0 # blocked role
+        if stop_loop:
+            break
+        if hasattr(object, 'aq_parent'):
+            object = aq_inner(object.aq_parent)
+            continue
+        if hasattr(object, 'im_self'):
+            object = aq_inner(object.im_self)
+            continue
+        break
+    roles = list(roles)
+    for r, v in local.items():
+        if v: # only if not blocked
+            roles.append(r)
+    ## patch to assign dynamic roles for WAeUP
+    while 1:
+
+        o = ord(name[1])
+        if o >= 48 and o <= 57:
+            break
+        groups = self.portal_membership.getAuthenticatedMember().getGroups()
+        if not ("ClearanceOfficers" in groups or "CourseAdvisers" in groups):
+            break
+        if callable(real_object) and hasattr(real_object,'im_self'):
+            real_object = real_object.im_self
+
+        if real_object is None:
+            break
+        if hasattr(real_object,'portal_type') and\
+                   real_object.portal_type not in ("Student",
+                                                   "StudentClearance",
+                                                   "StudentStudyLevel",
+                                                   "StudentPersonal",
+                                                  ):
+            break
+        student_id = self.getStudentId()
+        res = self.students_catalog(id=student_id)
+        if len(res) != 1:
+            break
+        st_entry = res[0]
+
+        if real_object.portal_type == "StudentStudyLevel":
+            certificate_obj = getCertificateObject(self,st_entry)
+            if certificate_obj is None:
+                #from pdb import set_trace;set_trace()
+                break
+            if real_object.meta_type.endswith('Folder'): # it is a proxy
+                object = real_object
+            else:
+                object = real_object.aq_parent
+            level = object.getId()
+            d,m = divmod(int(level),100)
+            if m: # its repeater
+                level = "%s" % (d*100)
+            context_obj = getattr(certificate_obj,level,None)
+            if context_obj is None and d > 1: 
+                #may-be spillover t
+                level = "%s" % ((d-1)*100)
+                context_obj = getattr(certificate_obj,level,None)
+                if context_obj is None:
+                    #from pdb import set_trace;set_trace()
+                    break
+            allowed = set(('CourseAdviser', 'SectionManager'))
+        elif real_object.portal_type == "Student" and "CourseAdvisers" in groups:
+            #we need some special processing since CourseAdvisers are only
+            #specified per StudyLevel
+            certificate_obj = getCertificateObject(self,st_entry)
+            if certificate_obj is None:
+                #from pdb import set_trace;set_trace()
+                break
+            allowed = set(('CourseAdviser', 'SectionManager'))
+            for context_obj in certificate_obj.objectValues():
+                dynamic_roles = set(self.getRolesInContext(context_obj))
+                intersect = dynamic_roles & allowed
+                if intersect:
+                    roles.extend(list(intersect))
+            break
+        else:
+            res = self.portal_catalog(portal_type="Department",id=st_entry.department)
+            allowed = set(('ClearanceOfficer', 'SectionManager'))
+            if len(res) != 1:
+                break
+            context_obj = res[0].getObject()
+        dynamic_roles = set(self.getRolesInContext(context_obj))
+        intersect = dynamic_roles & allowed
+        if intersect:
+            roles.extend(list(intersect))
+        break
+    return roles
+
+from Products.CPSUserFolder.CPSUserFolder import CPSUser
+CPSUser.getRolesInContext = getRolesInContext
Index: WAeUP_SRP/base/patches/PatchCPSWorkflowWorkflowDefinition.py
===================================================================
--- WAeUP_SRP/base/patches/PatchCPSWorkflowWorkflowDefinition.py	(revision 3673)
+++ WAeUP_SRP/base/patches/PatchCPSWorkflowWorkflowDefinition.py	(revision 3673)
@@ -0,0 +1,183 @@
+import logging
+from ZODB.loglevels import TRACE
+
+from AccessControl import ClassSecurityInfo
+from AccessControl import getSecurityManager
+from Acquisition import aq_parent
+from Acquisition import aq_inner
+from Globals import InitializeClass
+
+from Products.CMFCore.utils import getToolByName
+from Products.CMFCore.WorkflowCore import ObjectMoved
+from Products.CMFCore.WorkflowCore import ObjectDeleted
+from Products.CMFCore.WorkflowCore import WorkflowException
+
+from Products.DCWorkflow.DCWorkflow import DCWorkflowDefinition
+from Products.DCWorkflow.Transitions import TRIGGER_USER_ACTION
+
+#from expression import CPSStateChangeInfo as StateChangeInfo
+#from expression import createExprContext
+
+#from zope.interface import implements
+#from Products.CPSWorkflow.interfaces import ICPSWorkflowDefinition
+
+from Products.CPSCore.ProxyBase import ProxyBase
+from Products.CPSCore.EventServiceTool import getEventService
+
+#from constants import TRANSITION_FLAGS_EXPORT
+
+#
+# Backwards compatibility with CPS3 <= 3.2.x
+# Importing transition flags from here before.
+#
+
+from Products.CPSWorkflow.transitions import *
+from Products.CPSWorkflow.states import *
+
+
+logger = logging.getLogger('CPSWorkflow.workflow')
+security = ClassSecurityInfo()
+
+security.declarePrivate('updateStackDefinitionsRoleMappingFor')
+def updateStackDefinitionsRoleMappingsFor(self, ob, **kw):
+    """Update local roles for delegatees that are within workflow stacks
+    """
+    current_wf_var_id = kw.get('current_wf_var_id', '')
+
+    wftool = getToolByName(self, 'portal_workflow')
+    stackdefs = wftool.getStackDefinitionsFor(ob)
+
+    changed = 0
+
+    #
+    # First save the former local roles maping They will be
+    # overriden if defined on the state just after.  For the other
+    # ones, we need to keep the flrm's since the stackdef might be
+    # defined on another state further within the process
+    # definition or called by a stack flaged transition.
+    #
+    tdef = kw.get('tdef')
+    history = wftool.getHistoryOf(self.id, ob)
+    if history is not None:
+        try:
+            former_status = history[-2]
+        except IndexError:
+            # Virgin instance ;)
+            pass
+        else:
+            sflrm = former_status.get('sflrm', {})
+            for k, v in sflrm.items():
+                wftool.updateFormerLocalRoleMappingForStack(ob, self.id,
+                                                            k, v)
+
+    #
+    # Let's ask the stack definition for the list of local roles
+    #
+
+    for stackdef in stackdefs.keys():
+
+        # Update only the variable on wich the transition just applied
+        if not stackdef == current_wf_var_id:
+            continue
+
+        ds = wftool.getInfoFor(ob, stackdef, self.id)
+        former_mapping = wftool.getFormerLocalRoleMappingForStack(
+            ob, self.id, stackdef)
+        mapping = stackdefs[stackdef]._getLocalRolesMapping(ds)
+
+        #
+        # First remove associated local roles to the ones who are not
+        # supposed to have any (not a single one)
+        #
+
+        for id in former_mapping.keys():
+            old_local_roles = former_mapping[id]
+
+            # Remove all previous local roles in this case
+            if id not in mapping.keys():
+                roles_to_remove = old_local_roles
+
+            # Remove only local roles that are only within the
+            # previous mapping
+            else:
+                roles_to_remove = []
+                for old_role in old_local_roles:
+                    if old_role not in mapping[id]:
+                        roles_to_remove.append(old_role)
+
+
+            # Check that no other stack distributes currently this role
+            # to the current member
+            roles_to_keep = ()
+            for old_local_role in roles_to_remove:
+                stacks = wftool.getStacks(ob)
+                for stack_id, stack in stacks.items():
+                    if stack_id != current_wf_var_id:
+                        # The current transition is already
+                        # executed on ob thus we can take the
+                        # former mapping for this other given
+                        if (old_local_role in
+                            wftool.getFormerLocalRoleMappingForStack(
+                            ob, self.id, stack_id).get(id, ())):
+                            roles_to_keep += (old_local_role,)
+
+            # Do the actual job to remove absolete roles
+            for old_local_role in roles_to_remove:
+
+                # Don't remove those already managed by another stack
+                if old_local_role in roles_to_keep:
+                    continue
+
+                if not id.startswith('group:'):
+                    current_roles = list(
+                        ob.get_local_roles_for_userid(userid=id))
+                    new_roles = [role for role in current_roles
+                                 if role != old_local_role]
+                    ob.manage_delLocalRoles(userids=[id])
+                    if new_roles:
+                        ob.manage_setLocalRoles(id, new_roles)
+                else:
+                    id = id[len('group:'):]
+                    current_roles = list(
+                        ob.get_local_roles_for_groupid(groupid=id))
+                    new_roles = [role for role in current_roles
+                                 if role != old_local_role]
+                    ob.manage_delLocalGroupRoles(groupids=[id])
+                    if new_roles:
+                        ob.manage_setLocalGroupRoles(id, new_roles)
+
+            # Update ?
+            if roles_to_remove:
+                changed = 1
+
+        #
+        # Add local roles to member / groups within the mapping if
+        # they don't have the roles already in their merged local roles
+        #
+
+        for id in mapping.keys():
+            changed = 1
+            local_roles = mapping[id]
+            if not id.startswith('group:'):
+                current_roles = ob.get_local_roles_for_userid(userid=id)
+                new_roles = list(current_roles)
+                for role in local_roles:
+                    if role not in new_roles:
+                        new_roles.append(role)
+                ob.manage_setLocalRoles(id, new_roles)
+            else:
+                id = id[len('group:'):]
+                current_roles = ob.get_local_roles_for_groupid(groupid=id)
+                new_roles = list(current_roles)
+                for role in local_roles:
+                    if role not in new_roles:
+                        new_roles.append(role)
+                ob.manage_setLocalGroupRoles(id, new_roles)
+
+        # Update the former local role mapping
+        wftool.updateFormerLocalRoleMappingForStack(ob, self.id, stackdef,
+                                                    mapping)
+    return changed
+
+from Products.CPSWorkflow.workflow import WorkflowDefinition
+WorkflowDefinition.updateStackDefinitionsRoleMappingsFor = updateStackDefinitionsRoleMappingsFor
Index: WAeUP_SRP/base/patches/PatchCatalogToolSearchResults.py
===================================================================
--- WAeUP_SRP/base/patches/PatchCatalogToolSearchResults.py	(revision 3673)
+++ WAeUP_SRP/base/patches/PatchCatalogToolSearchResults.py	(revision 3673)
@@ -0,0 +1,14 @@
+from Products.ZCatalog.ZCatalog import ZCatalog
+def searchResults(self, REQUEST=None, **kw):
+    """
+    Calls ZCatalog.searchResults with extra arguments that
+    limit the results to what the user is allowed to see.
+    don't do that for WAeUP
+    """
+    # user = _getAuthenticatedUser(self)
+    # kw[ 'allowedRolesAndUsers' ] = self._listAllowedRolesAndUsers( user )
+
+    return ZCatalog.searchResults(self, REQUEST, **kw)
+
+from Products.CMFCore import CatalogTool
+CatalogTool.searchResults = searchResults
Index: WAeUP_SRP/base/patches/PatchCatalogToolXMLAdapter.py
===================================================================
--- WAeUP_SRP/base/patches/PatchCatalogToolXMLAdapter.py	(revision 3673)
+++ WAeUP_SRP/base/patches/PatchCatalogToolXMLAdapter.py	(revision 3673)
@@ -0,0 +1,64 @@
+#from Products.CMFCore.utils import getToolByName
+#from zope.app import zapi
+#from Products.GenericSetup.interfaces import INode
+#import Products
+
+def _importNode(self, node):
+    """Import the object from the DOM node.
+    """
+    na = node.attributes.items()
+    something_changed = False
+    new_indexes = []
+    new_columns = []
+    meta_type = na[0][1]
+    name = na[1][1]
+    if self.environ.shouldPurge():
+        self._purgeProperties()
+        self._purgeObjects()
+        self._purgeIndexes()
+        self._purgeColumns()
+    columns = []
+    # for col in self._extractColumns()._get_childNodes():
+    #     columns.append(col.attributes.items()[0][1])
+    for col in self.context.schema():
+        columns.append(col)
+    inds = {}
+    # for ind in self._extractIndexes()._get_childNodes():
+    #     inds[ind.attributes.items()[1][1]] = ind.attributes.items()[0][1]
+    for ind in self.context.getIndexObjects():
+        inds[ind.getId()] = ind.meta_type
+    if meta_type in ('CMF Catalog',"WAeUP Table"):
+        self._logger.info("Working on %s"  % na[1][1])
+        for ch in node._get_childNodes():
+            if ch.nodeName in ('index',):
+                cha = ch.attributes.items()
+                iname = cha[1][1]
+                itype = cha[0][1]
+                if iname in inds.keys() and inds[iname] == itype:
+                    continue
+                new_indexes.append(iname)
+                something_changed = True
+            elif ch.nodeName in ('column',):
+                cha = ch.attributes.items()
+                iname = cha[0][1]
+                if iname in columns:
+                    continue
+                new_columns.append(iname)
+                something_changed = True
+            else:
+                continue
+    if something_changed :
+        #import pdb;pdb.set_trace()
+        self._logger.info("Catalog tool %s cleared."  % na[1][1])
+        self._logger.info("%s modified." % na[1][1])
+        self._initProperties(node)
+        if new_indexes and len(self.context()) == 0: #disable creation of new indexes if records in the table
+            self._initObjects(node)
+            self._initIndexes(node)
+        self._initColumns(node)
+        #self._refreshCatalog()
+
+    self._logger.info("Catalog tool %s imported."  % na[1][1])
+    
+from Products.CPSCore.exportimport.catalog import CatalogToolXMLAdapter
+CatalogToolXMLAdapter._importNode = _importNode
Index: WAeUP_SRP/base/patches/PatchExtendedWidgetsCPSDateTimeWidget.py
===================================================================
--- WAeUP_SRP/base/patches/PatchExtendedWidgetsCPSDateTimeWidget.py	(revision 3673)
+++ WAeUP_SRP/base/patches/PatchExtendedWidgetsCPSDateTimeWidget.py	(revision 3673)
@@ -0,0 +1,65 @@
+#-*- mode: python; mode: fold -*-
+import re
+from DateTime.DateTime import DateTime
+from Products.CPSSchemas.ExtendedWidgets import CPSDateTimeWidget
+CPSDateTimeWidget.time_hour_default = '00'
+
+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
+    #import pdb;pdb.set_trace()
+    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:
+            d, m, y = re.split(r'[/,\-,\.]',date) # always use d/m/y and use /,- or . as separator
+            #d, m, y = date.split('/') # always use d/m/y
+            # locale = self.translation_service.getSelectedLanguage()
+            # if False and locale in ('en', 'hu'): 
+            #     m, d, y = date.split('/')
+            # else:
+        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/base/patches/PatchFasterSessionData.py
===================================================================
--- WAeUP_SRP/base/patches/PatchFasterSessionData.py	(revision 3673)
+++ WAeUP_SRP/base/patches/PatchFasterSessionData.py	(revision 3673)
@@ -0,0 +1,3 @@
+from Products.faster.sessiondata import CBSessionDataContainer
+from Products.faster.appendict import AppendOnlyDict
+CBSessionDataContainer._BUCKET_TYPE = AppendOnlyDict
Index: WAeUP_SRP/base/patches/PatchLocalizerMessageCatalog_gettext.py
===================================================================
--- WAeUP_SRP/base/patches/PatchLocalizerMessageCatalog_gettext.py	(revision 3673)
+++ WAeUP_SRP/base/patches/PatchLocalizerMessageCatalog_gettext.py	(revision 3673)
@@ -0,0 +1,50 @@
+from types import StringType, UnicodeType
+from AccessControl import ClassSecurityInfo
+from Products.Localizer.Utils import charsets, get_language_name, lang_negotiator
+security = ClassSecurityInfo()
+security.declarePublic('gettext')
+# set default for add = 0
+_marker = []
+def gettext(self, message, lang=None, add=0, default=_marker):
+    """Returns the message translation from the database if available.
+
+    If add=1, add any unknown message to the database.
+    If a default is provided, use it instead of the message id
+    as a translation for unknown messages.
+    """
+
+    if type(message) not in (StringType, UnicodeType):
+        raise TypeError, 'only strings can be translated.'
+
+    message = message.strip()
+
+    if default is _marker:
+        default = message
+
+    # Add it if it's not in the dictionary
+    if add and not self._messages.has_key(message) and message:
+        self._messages[message] = PersistentMapping()
+
+    # Get the string
+    if self._messages.has_key(message):
+        m = self._messages[message]
+
+        if lang is None:
+            # Builds the list of available languages
+            # should the empty translations be filtered?
+            available_languages = list(self._languages)
+
+            # Get the language!
+            lang = lang_negotiator(available_languages)
+
+            # Is it None? use the default
+            if lang is None:
+                lang = self._default_language
+
+        if lang is not None:
+            return m.get(lang) or default
+
+    return default
+from Products.Localizer.MessageCatalog import MessageCatalog
+MessageCatalog.gettext = gettext
+
Index: WAeUP_SRP/base/patches/PatchQueueCatalogProcessQueue.py
===================================================================
--- WAeUP_SRP/base/patches/PatchQueueCatalogProcessQueue.py	(revision 3673)
+++ WAeUP_SRP/base/patches/PatchQueueCatalogProcessQueue.py	(revision 3673)
@@ -0,0 +1,189 @@
+import sets
+import logging
+from types import StringType
+from AccessControl.Permissions \
+import manage_zcatalog_entries, view_management_screens
+from AccessControl import ModuleSecurityInfo, ClassSecurityInfo
+from AccessControl.SecurityInfo import ClassSecurityInformation
+from Products.PageTemplates.PageTemplateFile import PageTemplateFile
+from Products.QueueCatalog.CatalogEventQueue import CatalogEventQueue, EVENT_TYPES, ADDED_EVENTS
+from Products.QueueCatalog.CatalogEventQueue import ADDED, CHANGED, CHANGED_ADDED, REMOVED
+from Products.QueueCatalog.CatalogEventQueue import SAFE_POLICY, ALTERNATIVE_POLICY
+from Products.QueueCatalog.QueueCatalog import cataloged
+from Products.QueueCatalog.QueueCatalog import QueueCatalog
+from ZODB.POSException import ConflictError
+from ZEO.Exceptions import ClientDisconnected
+logger = logging.getLogger('event.QueueCatalog')
+security = ClassSecurityInformation()
+
+def __init__(self,
+             buckets=1009,
+             conflict_policy=SAFE_POLICY,
+             bypass = False,
+             location = "portal_catalog_real"):
+    self._buckets = buckets
+    self._conflict_policy = conflict_policy
+    self._clearQueues()
+    self._bypass = bypass
+    self._location = location
+
+security.declareProtected(view_management_screens, 'getBypassQueue')
+def getBypassQueue(self):
+    "get _by_pass"
+    if not hasattr(self,"_bypass"):
+        self._bypass = False
+    return getattr(self,'_bypass',False)
+
+security.declareProtected(view_management_screens, 'setBypassQueue')
+def setBypassQueue(self, bypass=False):
+    "set _bypass"
+    self._bypass = bypass
+
+def catalog_object(self, obj, uid=None, idxs=None, update_metadata=1):
+    # update_metadata=0 is ignored if the queued catalog is set to
+    # update metadata during queue processing, rather than immediately
+
+    # similarly, limiting the idxs only limits the immediate indexes.  If
+    # any work needs to be done in the queue processing, it will all be
+    # done: we have not implemented partial indexing during queue
+    # processing.  The only way to avoid any of it is to avoid all of it
+    # (i.e., update metadata immediately and don't have any indexes to
+    # update on the queued side).
+
+    # Make sure the current context is allowed to do this:
+    catalog_object = self.getZCatalog('catalog_object')
+
+    if uid is None:
+        uid = '/'.join(obj.getPhysicalPath())
+    elif not isinstance(uid, StringType):
+        uid = '/'.join(uid)
+
+    catalog = self.getZCatalog()
+    cat_indexes = sets.Set(catalog.indexes())
+    immediate_indexes = sets.Set(self._immediate_indexes)
+    cat_indexes -= immediate_indexes
+
+    # The ZCatalog API doesn't allow us to distinguish between
+    # adds and updates, so we have to try to figure this out
+    # ourselves.
+
+    # There's a risk of a race here. What if there is a previously
+    # unprocessed add event? If so, then this should be a changed
+    # event. If we undo this transaction later, we'll generate a
+    # remove event, when we should generate an add changed event.
+    # To avoid this, we need to make sure we see consistent values
+    # of the event queue. We also need to avoid resolving
+    # (non-undo) conflicts of add events. This will slow things
+    # down a bit, but adds should be relatively infrequent.
+    bypass_queue = self.getBypassQueue()
+    # Now, try to decide if the catalog has the uid (path).
+    already_cataloged = cataloged(catalog, uid)
+    if not already_cataloged:
+        # Looks like we should add, but maybe there's already a
+        # pending add event. We'd better check the event queue:
+        already_cataloged = (
+            self._queues[hash(uid) % self._buckets].getEvent(uid) in
+            ADDED_EVENTS)
+            
+    if idxs and already_cataloged:
+        # if not already_cataloged, we index the whole thing
+        idxs = sets.Set(idxs)
+        immediate_indexes.intersection_update(idxs)
+        cat_indexes.intersection_update(idxs)
+
+    immediate_metadata = self.getImmediateMetadataUpdate()
+    if cat_indexes or update_metadata and not immediate_metadata:
+        if bypass_queue:
+            catalog_object(obj, uid, cat_indexes)
+        else:
+            #import pdb;pdb.set_trace()
+            self._update(uid, already_cataloged and CHANGED or ADDED)
+        # Update some of the indexes immediately.
+    if immediate_indexes:
+        # Update some of the indexes immediately.
+        catalog.catalog_object(
+            obj, uid, immediate_indexes,
+            update_metadata=update_metadata and immediate_metadata)
+    elif update_metadata and immediate_metadata:
+        # if it is added, no point in doing the metadata, and it will be
+        # done in the queue process anyway
+        catalog._catalog.updateMetadata(obj, uid)
+
+def _process_queue(self, queue, limit):
+    """Process a single queue"""
+    catalog = self.getZCatalog()
+
+    if self.getProcessAllIndexes():
+        #idxs = None
+        idxs = catalog.indexes()
+    else:
+        cat_indexes = sets.Set(catalog.indexes())
+        immediate_indexes = sets.Set(self._immediate_indexes)
+        if not immediate_indexes or immediate_indexes==cat_indexes:
+            idxs = catalog.indexes() # do all of 'em
+        else:
+            idxs = list(cat_indexes - immediate_indexes)
+    events = queue.process(limit)
+    count = 0
+
+    for uid, (t, event) in events.items():
+        if event is REMOVED:
+            try:
+                if cataloged(catalog, uid):
+                    catalog.uncatalog_object(uid)
+            except (ConflictError, ClientDisconnected):
+                logger.error('conflict-error uncataloging object', exc_info=True)
+            except:
+                logger.error('error uncataloging object', exc_info=True)
+        else:
+            # add or change
+            if event is CHANGED and not cataloged(catalog, uid):
+                continue
+            # Note that the uid may be relative to the catalog.
+            obj = catalog.unrestrictedTraverse(uid, None)
+            if obj is not None:
+                immediate_metadata = self.getImmediateMetadataUpdate()
+                try:
+                    catalog.catalog_object(
+                        obj, uid, idxs=idxs,
+                        update_metadata=not immediate_metadata)
+                except (ConflictError, ClientDisconnected):
+                    logger.error('conflict-error uncataloging object', exc_info=True)
+                    #raise
+                except:
+                    logger.error('error cataloging object', exc_info=True)
+
+        count = count + 1
+
+    return count
+def manage_edit(self, title='', location='', immediate_indexes=(),
+                immediate_removal=0, bucket_count=0, immediate_metadata=0,
+                all_indexes=0, conflict_policy=SAFE_POLICY, RESPONSE=None,
+               enable_bypass=0):
+    """ Edit the instance """
+    self.title = title
+    self.setLocation(location or None)
+    self.setImmediateIndexes(immediate_indexes)
+    self.setImmediateRemoval(immediate_removal)
+    self.setImmediateMetadataUpdate(immediate_metadata)
+    self.setProcessAllIndexes(all_indexes)
+    self.setConflictPolicy(conflict_policy)
+    self.setBypassQueue(enable_bypass)
+    if bucket_count:
+        bucket_count = int(bucket_count)
+        if bucket_count != self.getBucketCount():
+            self.setBucketCount(bucket_count)
+
+    if RESPONSE is not None:
+        RESPONSE.redirect('%s/manage_editForm?manage_tabs_message='
+                            'Properties+changed' % self.absolute_url())
+
+QueueCatalog.__init__ = __init__
+QueueCatalog.getBypassQueue = getBypassQueue
+QueueCatalog.getBypassQueue__roles__ = ['Manager', 'Owner',]
+QueueCatalog.setBypassQueue = setBypassQueue
+QueueCatalog.setBypassQueue__roles__ = ['Manager', 'Owner',]
+QueueCatalog.catalog_object = catalog_object
+QueueCatalog._process_queue = _process_queue
+QueueCatalog.manage_editForm = PageTemplateFile('zmi/qc_edit', globals())
+QueueCatalog.manage_edit = manage_edit
Index: WAeUP_SRP/base/patches/PatchRenderActionIcon.py
===================================================================
--- WAeUP_SRP/base/patches/PatchRenderActionIcon.py	(revision 3673)
+++ WAeUP_SRP/base/patches/PatchRenderActionIcon.py	(revision 3673)
@@ -0,0 +1,44 @@
+from Products.CMFCore.utils import getToolByName
+
+ACTIONICON_RAMCACHE_ID = 'actioncons'
+IMG_TAG = '<img src="%s" width="%s" height="%s" alt="%s" />'
+
+def renderActionIcon(self, category=None, action_id=None,
+                     base_url='', alt=''):
+    """Renders the action's icon"""
+
+    if category is None or action_id is None:
+        return None
+
+    aitool = getToolByName(self, 'portal_actionicons', None)
+    if aitool is None:
+        return None
+
+    cache = self.getCache(ACTIONICON_RAMCACHE_ID)
+    # compute the cache index
+    index = (action_id, category, base_url, alt)
+
+    img_tag = cache.getEntry(index)
+    # the icon is not in the cache
+    if img_tag is None:
+        icon_path = aitool.queryActionIcon(category=category,
+            action_id=action_id)
+        if not icon_path:
+            return
+
+
+
+        # fall back to the icon path specified in CMFActionIcons
+        img = self.unrestrictedTraverse(icon_path, default=None)
+        if img is None:
+            return None
+        img_tag = IMG_TAG % (icon_path,
+                             getattr(img, 'width', 0),
+                             getattr(img, 'height', 0),
+                             alt)
+        if cache is not None:
+            cache.setEntry(index, img_tag)
+    return img_tag
+
+from Products.CPSPortlets.PortletsTool import PortletsTool
+PortletsTool.renderActionIcon = renderActionIcon
Index: WAeUP_SRP/base/patches/PatchZCatalogCatalogUpdateMetadata.py
===================================================================
--- WAeUP_SRP/base/patches/PatchZCatalogCatalogUpdateMetadata.py	(revision 3673)
+++ WAeUP_SRP/base/patches/PatchZCatalogCatalogUpdateMetadata.py	(revision 3673)
@@ -0,0 +1,42 @@
+from BTrees.IOBTree import IOBTree
+from random import randint
+def updateMetadata(self, object, uid):
+    """ Given an object and a uid, update the column data for the
+    uid with the object data iff the object has changed """
+    data = self.data
+    index = self.uids.get(uid, None)
+    newDataRecord = self.recordify(object)
+
+    if index is None:
+        if type(data) is IOBTree:
+            # New style, get random id
+
+            index=getattr(self, '_v_nextid', 0)
+            if index % 4000 == 0:
+                index = randint(-2000000000, 2000000000)
+            while not data.insert(index, newDataRecord):
+                index = randint(-2000000000, 2000000000)
+
+            # We want ids to be somewhat random, but there are
+            # advantages for having some ids generated
+            # sequentially when many catalog updates are done at
+            # once, such as when reindexing or bulk indexing.
+            # We allocate ids sequentially using a volatile base,
+            # so different threads get different bases. This
+            # further reduces conflict and reduces churn in
+            # here and it result sets when bulk indexing.
+            self._v_nextid=index+1
+        else:
+            if data:
+                # find the next available unique id
+                index = data.keys()[-1] + 1
+            else:
+                index=0
+            # meta_data is stored as a tuple for efficiency
+            data[index] = newDataRecord
+    else:
+        #if True or data.get(index, 0) != newDataRecord:
+        data[index] = newDataRecord
+    return index
+from Products.ZCatalog.Catalog import Catalog
+Catalog.updateMetadata = updateMetadata
Index: WAeUP_SRP/base/patches/PatchZODBConnectionOpen.py
===================================================================
--- WAeUP_SRP/base/patches/PatchZODBConnectionOpen.py	(revision 3673)
+++ WAeUP_SRP/base/patches/PatchZODBConnectionOpen.py	(revision 3673)
@@ -0,0 +1,61 @@
+from ZODB.Connection import Connection
+from time import time
+import transaction
+
+global_reset_counter = 0
+
+def open(self, transaction_manager=None, mvcc=True, synch=True,
+            delegate=True):
+    """Register odb, the DB that this Connection uses.
+
+    This method is called by the DB every time a Connection
+    is opened.  Any invalidations received while the Connection
+    was closed will be processed.
+
+    If the global module function resetCaches() was called, the
+    cache will be cleared.
+
+    Parameters:
+    odb: database that owns the Connection
+    mvcc: boolean indicating whether MVCC is enabled
+    transaction_manager: transaction manager to use.  None means
+        use the default transaction manager.
+    synch: boolean indicating whether Connection should
+    register for afterCompletion() calls.
+    """
+
+    # TODO:  Why do we go to all the trouble of setting _db and
+    # other attributes on open and clearing them on close?
+    # A Connection is only ever associated with a single DB
+    # and Storage.
+
+    self._opened = time()
+    self._synch = synch
+    self._mvcc = mvcc and not self._version
+    if transaction_manager is None:
+        transaction_manager = transaction.manager
+
+    self.transaction_manager = transaction_manager
+
+    # js 28-5-2007 always call _flush_invalidations 
+    self._flush_invalidations()
+    if self._reset_counter != global_reset_counter:
+        # New code is in place.  Start a new cache.
+        self._resetCache()
+    # else:
+    #     import pdb; pdb.set_trace()
+    #     self._flush_invalidations()
+
+    if synch:
+        transaction_manager.registerSynch(self)
+
+    if self._cache is not None:
+        self._cache.incrgc() # This is a good time to do some GC
+
+    if delegate:
+        # delegate open to secondary connections
+        for connection in self.connections.values():
+            if connection is not self:
+                connection.open(transaction_manager, mvcc, synch, False)
+
+Connection.open = open
Index: WAeUP_SRP/base/patches/PatchZODBDirectory_searchEntries.py
===================================================================
--- WAeUP_SRP/base/patches/PatchZODBDirectory_searchEntries.py	(revision 3673)
+++ WAeUP_SRP/base/patches/PatchZODBDirectory_searchEntries.py	(revision 3673)
@@ -0,0 +1,82 @@
+# (C) Copyright 2004 Nuxeo SARL <http://nuxeo.com>
+# Author: Georges Racinet <gracinet@nuxeo.com>
+# Patched by 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: utils.py 35055 2006-04-10 15:51:21Z gracinet $
+
+from zLOG import LOG, DEBUG, TRACE
+from copy import deepcopy
+from AccessControl import ClassSecurityInfo
+from Products.CPSSchemas.StorageAdapter import AttributeStorageAdapter
+from Products.CPSDirectory.utils import QueryMatcher
+security = ClassSecurityInfo()
+
+
+security.declarePrivate('_searchEntries')
+def _searchEntries(self, return_fields=None, **kw):
+    """Search for entries in the directory.
+    """
+    if self.ZCacheable_isCachingEnabled():
+        keyset = {'return_fields' : return_fields}
+        keyset.update(kw)
+        LOG('ZODBDirectory._searchEntries', TRACE,
+            "Searching cache for %s" % (keyset,))
+        from_cache = self.ZCacheable_get(keywords=keyset)
+        if from_cache is not None:
+            LOG('ZODBDirectory._searchEntries', TRACE, " -> results=%s" %
+                (from_cache[:20],))
+            return deepcopy(from_cache)
+    else:
+        keyset = None
+
+    matcher = QueryMatcher(kw, accepted_keys=self._getFieldIds(),
+                           substring_keys=self.search_substring_fields)
+
+    # Compute needed fields from object.
+    # All fields we need to return.
+    field_ids_d, return_fields = self._getSearchFields(return_fields)
+    # Add all fields the search is made on.
+    field_ids = matcher.getKeysSet().union(field_ids_d)
+
+    # Do the search.
+    schema = self._getUniqueSchema()
+    adapter = AttributeStorageAdapter(schema, None,
+                                      field_ids=list(field_ids))
+    res = []
+    for id, ob in self.objectItems():
+        if getattr(ob,'homeless',False):
+            continue
+        adapter.setContextObject(ob)
+        entry = adapter.getData()
+        adapter.finalizeDefaults(entry)
+        if not matcher.match(entry):
+            continue
+        # Compute result to return.
+        if return_fields is None:
+            res.append(id)
+        else:
+            d = {}
+            for key in return_fields:
+                d[key] = entry[key]
+            res.append((id, d))
+
+    if keyset is not None:
+        LOG('ZODBDirectory._searchEntries', TRACE, "Putting in cache")
+        self.ZCacheable_set(res, keywords=keyset)
+
+    return deepcopy(res)
+from Products.CPSDirectory.ZODBDirectory import  ZODBDirectory
+ZODBDirectory._searchEntries = _searchEntries
Index: WAeUP_SRP/base/patches/__init__.py
===================================================================
--- WAeUP_SRP/base/patches/__init__.py	(revision 3673)
+++ WAeUP_SRP/base/patches/__init__.py	(revision 3673)
@@ -0,0 +1,19 @@
+import PatchCPSWorkflowWorkflowDefinition
+import PatchCatalogToolSearchResults
+import PatchCatalogToolXMLAdapter
+import PatchCPSSchemasAttributeStorageAdapter
+import PatchCPSSchemasDataModel
+import PatchCPSSchemasVocabulariesTool
+import PatchCPSMembershipTool
+import PatchCPSUserFolderUserFolder
+import PatchCPSStackingDirectoryStorageAdapter
+import PatchBasicWidgetsCPSStringWidget
+import PatchExtendedWidgetsCPSDateTimeWidget
+import PatchBasicWidgetsUnprepare
+import PatchFasterSessionData
+import PatchQueueCatalogProcessQueue
+import PatchZCatalogCatalogUpdateMetadata
+import PatchCPSDefaultImportExport
+import PatchRenderActionIcon
+#import PatchZODBConnectionOpen
+import PatchLocalizerMessageCatalog_gettext
