Back to index

plone3  3.1.7
Functions
CMFCalendar.setuphandlers Namespace Reference

Functions

def importVarious

Function Documentation

Import various settings for CMF Calendar.

This provisional handler will be removed again as soon as full handlers
are implemented for these steps.

Definition at line 25 of file setuphandlers.py.

00025 
00026 def importVarious(context):
00027     """ Import various settings for CMF Calendar.
00028 
00029     This provisional handler will be removed again as soon as full handlers
00030     are implemented for these steps.
00031     """
00032     site = context.getSite()
00033     mdtool = getUtility(IMetadataTool)
00034 
00035     # Set up a MetadataTool element policy for events
00036     try:
00037         _ = str # MetadataTool ist not aware of Message objects
00038         mdtool.DCMI.addElementPolicy(
00039             element='Subject',
00040             content_type='Event',
00041             is_required=0,
00042             supply_default=0,
00043             default_value='',
00044             enforce_vocabulary=0,
00045             allowed_vocabulary=(_('Appointment'),
00046                                 _('Convention'),
00047                                 _('Meeting'),
00048                                 _('Social Event'),
00049                                 _('Work'),
00050                                ),
00051             REQUEST=None)
00052     except MetadataError:
00053         pass
00054 
00055     return 'Various settings for CMF Calendar imported.'