Back to index

plone3  3.1.7
metadirectives.py
Go to the documentation of this file.
00001 from zope.interface import Interface
00002 
00003 from zope import schema
00004 from zope.configuration import fields as configuration_fields
00005 
00006 class IRuleElementDirective(Interface):
00007     """Directive which registers a new rule element.
00008     
00009     The actual directives will use IRuleActionDirective or IRuleConditionDirective
00010     """
00011     
00012     name = schema.TextLine(
00013         title=u"Name",
00014         description=u"A unique name for the element",
00015         required=True)
00016     
00017     title = schema.TextLine(
00018         title=u"Title",
00019         description=u"A user-friendly title for the element",
00020         required=True)
00021                            
00022     description = schema.Text(
00023         title=u"Description",
00024         description=u"A helpful description of the element",
00025         required=False)                       
00026                            
00027     for_ = configuration_fields.GlobalInterface(
00028         title = u"Available for",
00029         description = u"The interface this element is available for",
00030         required = False)
00031     
00032     event = configuration_fields.GlobalInterface(
00033         title = u"Event",
00034         description = u"The event this element is available for",
00035         required = False)
00036     
00037     addview = schema.TextLine(
00038         title = u"Add view",
00039         description = u"Name of the add view",
00040         required = True)
00041     
00042     editview = schema.TextLine(
00043         title = u"Edit view",
00044         description = u"Name of the edit view",
00045         required = False)
00046         
00047     schema = configuration_fields.GlobalInterface(
00048         title = u"Schema",
00049         description = u"The schema interface for configuring the element",
00050         required = False)
00051         
00052     factory = configuration_fields.GlobalObject(
00053         title = u"Factory",
00054         description = u"A callable which can create the element",
00055         required = False)
00056         
00057 class IRuleActionDirective(IRuleElementDirective):
00058     """An element directive describing what is logically an action element.
00059     """
00060 
00061 class IRuleConditionDirective(IRuleElementDirective):
00062     """An element directive describing what is logically a condition element.
00063     """