Exemplo n.º 1
0
def AddViewFactory(name,
                   schema,
                   label,
                   permission,
                   layer,
                   template,
                   default_template,
                   bases,
                   for_,
                   fields,
                   content_factory,
                   arguments,
                   keyword_arguments,
                   set_before_add,
                   set_after_add,
                   menu=u''):

    s = getGlobalService(Presentation)
    class_ = makeClassForTemplate(template, used_for=schema, bases=bases)

    class_.schema = schema
    class_.label = label
    class_.fieldNames = fields
    class_._factory = content_factory
    class_._arguments = arguments
    class_._keyword_arguments = keyword_arguments
    class_._set_before_add = set_before_add
    class_._set_after_add = set_after_add

    class_.generated_form = ZopeTwoPageTemplateFile(default_template)

    s.provideView(for_, name, IBrowserRequest, class_, layer)
    protectClass(class_, permission)
    initializeClass(class_)
Exemplo n.º 2
0
def EditViewFactory(name,
                    schema,
                    label,
                    permission,
                    layer,
                    template,
                    default_template,
                    bases,
                    for_,
                    fields,
                    fulledit_path=None,
                    fulledit_label=None,
                    menu=u''):
    s = getGlobalService(Presentation)
    class_ = makeClassForTemplate(template, used_for=schema, bases=bases)
    class_.schema = schema
    class_.label = label
    class_.fieldNames = fields

    class_.fulledit_path = fulledit_path
    if fulledit_path and (fulledit_label is None):
        fulledit_label = "Full edit"

    class_.fulledit_label = fulledit_label

    class_.generated_form = ZopeTwoPageTemplateFile(default_template)

    s.provideView(for_, name, IBrowserRequest, class_, layer)
    protectClass(class_, permission)
    initializeClass(class_)
Exemplo n.º 3
0
def EditViewFactory(name, schema, label, permission, layer,
                    template, default_template, bases, for_, fields,
                    fulledit_path=None, fulledit_label=None, menu=u''):
    s = getGlobalService(Presentation)
    class_ = makeClassForTemplate(template, used_for=schema, bases=bases)
    class_.schema = schema
    class_.label = label
    class_.fieldNames = fields

    class_.fulledit_path = fulledit_path
    if fulledit_path and (fulledit_label is None):
        fulledit_label = "Full edit"

    class_.fulledit_label = fulledit_label

    class_.generated_form = ZopeTwoPageTemplateFile(default_template)


    s.provideView(for_, name, IBrowserRequest, class_, layer)
    protectClass(class_, permission)
    initializeClass(class_)
Exemplo n.º 4
0
def AddViewFactory(name, schema, label, permission, layer,
                   template, default_template, bases, for_,
                   fields, content_factory, arguments,
                   keyword_arguments, set_before_add, set_after_add,
                   menu=u''):

    s = getGlobalService(Presentation)
    class_ = makeClassForTemplate(template, used_for=schema, bases=bases)

    class_.schema = schema
    class_.label = label
    class_.fieldNames = fields
    class_._factory = content_factory
    class_._arguments = arguments
    class_._keyword_arguments = keyword_arguments
    class_._set_before_add = set_before_add
    class_._set_after_add = set_after_add

    class_.generated_form = ZopeTwoPageTemplateFile(default_template)

    s.provideView(for_, name, IBrowserRequest, class_, layer)
    protectClass(class_, permission)
    initializeClass(class_)