##parameters=REQUEST # $Id: import.py 2262 2007-09-20 14:02:45Z henrik $ """ process the Application Form return html renderer + psm """ try: from Products.zdb import set_trace except: def set_trace(): pass import DateTime from urllib import urlencode current = DateTime.DateTime() pr = context.portal_registration validate = REQUEST.has_key("import") enable = REQUEST.has_key("enable_bypass") disable = REQUEST.has_key("disable_bypass") #set_trace() lt = context.portal_layouts #pr = context.portal_registration res,psm,ds = lt.renderLayout(layout_id= 'import', schema_id= 'import', context=context, mapping=validate and REQUEST, ob={}, layout_mode='create', commit=False, ) if enable: context.portal_catalog.setBypassQueue(1) psm = "QueueCatalog Bypass enabled!" #return REQUEST.RESPONSE.redirect("%s" % context.absolute_url()) elif disable: context.portal_catalog.setBypassQueue(0) psm = "QueueCatalog Bypass disabled!" elif psm == 'invalid': return context.import_form(rendered = res, psm = "Please correct your input!", ds = ds, ) elif psm == '': return context.import_form(rendered = res, psm = None, ds = ds, ) elif psm == 'valid': psm = context.waeup_tool.importData(ds.get('filename'), ds.get('name'), ds.get('import_or_edit') ) return context.import_form(rendered = res, psm = psm, ds = ds, )