示例#1
0
def initialize(context):

    ToolInit('CMF Default Tool', tools=tools,
             icon='tool.gif').initialize(context)

    # BBB: register oldstyle constructors
    ContentInit('CMF Default Content',
                content_types=(),
                permission=AddPortalContent,
                extra_constructors=contentConstructors).initialize(context)

    context.registerClass(Portal.CMFSite,
                          constructors=(factory.addConfiguredSiteForm,
                                        factory.addConfiguredSite),
                          icon='images/portal.gif')

    registerIcon(DefaultWorkflow.DefaultWorkflowDefinition,
                 'images/workflow.gif', globals())

    # make registerHelp work with 2 directories
    help = context.getProductHelp()
    lastRegistered = help.lastRegistered
    context.registerHelp(directory='help', clear=1)
    context.registerHelp(directory='interfaces', clear=1)
    if help.lastRegistered != lastRegistered:
        help.lastRegistered = None
        context.registerHelp(directory='help', clear=1)
        help.lastRegistered = None
        context.registerHelp(directory='interfaces', clear=0)
    context.registerHelpTitle('CMF Default Help')
示例#2
0
def initialize(context):

    initializeBasesPhase2(z_bases, context)
    initializeBasesPhase2(z_tool_bases, context)

    ToolInit('CMFDefault Tool',
             tools=tools,
             product_name='CMFDefault',
             icon='tool.gif').initialize(context)

    ContentInit('CMFDefault Content',
                content_types=contentClasses,
                permission=AddPortalContent,
                extra_constructors=contentConstructors,
                fti=Portal.factory_type_information).initialize(context)

    context.registerClass(Portal.CMFSite,
                          constructors=(Portal.manage_addCMFSiteForm,
                                        Portal.manage_addCMFSite),
                          icon='portal.gif')

    registerIcon(DefaultWorkflow.DefaultWorkflowDefinition,
                 'images/workflow.gif', globals())

    # make registerHelp work with 2 directories
    help = context.getProductHelp()
    lastRegistered = help.lastRegistered
    context.registerHelp(directory='help', clear=1)
    context.registerHelp(directory='interfaces', clear=1)
    if help.lastRegistered != lastRegistered:
        help.lastRegistered = None
        context.registerHelp(directory='help', clear=1)
        help.lastRegistered = None
        context.registerHelp(directory='interfaces', clear=0)
    context.registerHelpTitle('CMF Default Help')
示例#3
0
def initialize(context):
    # (DynamicViewTypeInformation factory is created from ZCML)
    cmf_utils.registerIcon(
        DynamicViewTypeInformation,
        'images/typeinfo.gif',
        globals()
    )

    context.registerClass(
        content_for_tests.DynFolder,
        permission=AddPortalFolders,
        constructors=(
            ('addDynFolder', content_for_tests.addDynFolder),
        ),
        icon='images/typeinfo.gif'
    )

    context.registerClass(
        content_for_tests.DynDocument,
        permission=AddPortalContent,
        constructors=(
            ('addDynDocument', content_for_tests.addDynDocument),
        ),
        icon='images/typeinfo.gif'
    )
示例#4
0
文件: __init__.py 项目: dtgit/dtedu
def initialize(context):

    utils.registerIcon(
        DefaultWorkflowPolicy.DefaultWorkflowPolicyDefinition,
        'images/workflow_policy.gif',
        globals())

    context.registerClass(
        PlacefulWorkflowTool.PlacefulWorkflowTool,
        meta_type="Placeful Workflow Tool",
        constructors=(PlacefulWorkflowTool.addPlacefulWorkflowTool,),
        icon = 'tool.gif')

    context.registerClass(
        WorkflowPolicyConfig.WorkflowPolicyConfig,
        permission='Add Workflow Policy',
        constructors=(WorkflowPolicyConfig.manage_addWorkflowPolicyConfigForm,
                      WorkflowPolicyConfig.manage_addWorkflowPolicyConfig),
        icon='www/WorkflowPolicyConfig_icon.gif',
    )

    utils.ToolInit( 'CMF Placeful Workflow Tool'
                  , tools=tools
                  , icon='tool.gif'
                  ).initialize( context )
示例#5
0
def initialize( context ):

    utils.initializeBasesPhase2( z_bases, context )
    utils.initializeBasesPhase2( z_tool_bases, context )
    utils.ToolInit('CMFDefault Tool', tools=tools,
                   product_name='CMFDefault', icon='tool.gif',
                   ).initialize( context )

    utils.ContentInit( 'CMFDefault Content'
                     , content_types=contentClasses
                     , permission=ADD_CONTENT_PERMISSION
                     , extra_constructors=contentConstructors
                     , fti=Portal.factory_type_information
                     ).initialize( context )

    context.registerClass(Portal.CMFSite,
                          constructors=(Portal.manage_addCMFSiteForm,
                                        Portal.manage_addCMFSite,
                                        ),
                          icon='portal.gif')
    utils.registerIcon(DefaultWorkflow.DefaultWorkflowDefinition,
                       'images/workflow.gif', globals())

    reg = Products.CMFCore.PortalFolder.addPortalTypeHandler
    reg( 'text/html', Document.Document )
    reg( 'text/plain', Document.Document )
    reg( 'image/png', Image.Image )
    reg( 'image/gif', Image.Image )
    reg( 'image/jpeg', Image.Image )
    reg( 'image/unknown', Image.Image )
示例#6
0
文件: __init__.py 项目: goschtl/zope
def initialize( context ):

    utils.initializeBasesPhase2( z_bases, context )
    utils.initializeBasesPhase2( z_tool_bases, context )
    utils.ToolInit('CMFDefault Tool', tools=tools,
                   product_name='CMFDefault', icon='tool.gif',
                   ).initialize( context )

    utils.ContentInit( 'CMFDefault Content'
                     , content_types=contentClasses
                     , permission=ADD_CONTENT_PERMISSION
                     , extra_constructors=contentConstructors
                     , fti=Portal.factory_type_information
                     ).initialize( context )

    context.registerClass(Portal.CMFSite,
                          constructors=(Portal.manage_addCMFSiteForm,
                                        Portal.manage_addCMFSite,
                                        ),
                          icon='portal.gif')
    utils.registerIcon(DefaultWorkflow.DefaultWorkflowDefinition,
                       'images/workflow.gif', globals())

    context.registerHelp()
    context.registerHelpTitle('CMF Default Help')
示例#7
0
def initialize(context):

    utils.initializeBasesPhase2(z_bases, context)
    utils.initializeBasesPhase2(z_tool_bases, context)
    utils.ToolInit(
        'CMFDefault Tool',
        tools=tools,
        product_name='CMFDefault',
        icon='tool.gif',
    ).initialize(context)

    utils.ContentInit('CMFDefault Content',
                      content_types=contentClasses,
                      permission=ADD_CONTENT_PERMISSION,
                      extra_constructors=contentConstructors,
                      fti=Portal.factory_type_information).initialize(context)

    context.registerClass(Portal.CMFSite,
                          constructors=(
                              Portal.manage_addCMFSiteForm,
                              Portal.manage_addCMFSite,
                          ),
                          icon='portal.gif')
    utils.registerIcon(DefaultWorkflow.DefaultWorkflowDefinition,
                       'images/workflow.gif', globals())

    context.registerHelp()
    context.registerHelpTitle('CMF Default Help')
示例#8
0
文件: __init__.py 项目: goschtl/zope
def initialize( context ):

    initializeBasesPhase2( z_bases, context )
    initializeBasesPhase2( z_tool_bases, context )

    ToolInit( 'CMF Default Tool'
            , tools=tools
            , icon='tool.gif'
            ).initialize( context )

    ContentInit( 'CMF Default Content'
               , content_types=contentClasses
               , permission=AddPortalContent
               , extra_constructors=contentConstructors
               ).initialize( context )

    profile_registry.registerProfile('default',
                                     'CMFDefault Site',
                                     'Profile for a default CMFSite.',
                                     'profiles/default',
                                     'CMFDefault',
                                     BASE,
                                     for_=ISiteRoot,
                                    )

    profile_registry.registerProfile('sample_content',
                                     'Sample CMFDefault Content',
                                     'Content for a sample CMFSite.',
                                     'profiles/sample_content',
                                     'CMFDefault',
                                     EXTENSION,
                                     for_=ISiteRoot,
                                    )

    context.registerClass( Portal.CMFSite
                         , constructors=(factory.addConfiguredSiteForm,
                                         factory.addConfiguredSite)
                         , icon='images/portal.gif'
                         )

    registerIcon( DefaultWorkflow.DefaultWorkflowDefinition
                , 'images/workflow.gif'
                , globals()
                )

    # make registerHelp work with 2 directories
    help = context.getProductHelp()
    lastRegistered = help.lastRegistered
    context.registerHelp(directory='help', clear=1)
    context.registerHelp(directory='interfaces', clear=1)
    if help.lastRegistered != lastRegistered:
        help.lastRegistered = None
        context.registerHelp(directory='help', clear=1)
        help.lastRegistered = None
        context.registerHelp(directory='interfaces', clear=0)
    context.registerHelpTitle('CMF Default Help')
示例#9
0
def initialize(context):
    context.registerClass(
        DA.Connection,
        permission = 'Add Z cxOracle Database Connections',
        constructors = (DA.manage_addZcxOracleConnectionForm,
                        DA.manage_addZcxOracleConnection),
        icon = SOFTWARE_HOME + '/Shared/DC/ZRDB/www/DBAdapterFolder_icon.gif')

    utils.registerIcon(FSORAMethod.FSORAMethod,
                       'fsoramethod.gif', globals())
示例#10
0
def initialize( context ):

    initializeBasesPhase2( z_bases, context )
    initializeBasesPhase2( z_tool_bases, context )

    ToolInit( 'CMF Default Tool'
            , tools=tools
            , icon='tool.gif'
            ).initialize( context )

    ContentInit( 'CMF Default Content'
               , content_types=contentClasses
               , permission=AddPortalContent
               , extra_constructors=contentConstructors
               , fti=Portal.factory_type_information
               ).initialize( context )

    profile_registry.registerProfile('default',
                                     'CMFDefault Site',
                                     'Profile for a default CMFSite.',
                                     'profiles/default',
                                     'CMFDefault',
                                     BASE)

    profile_registry.registerProfile('sample_content',
                                     'Sample CMFDefault Content',
                                     'Content for a sample CMFSite.',
                                     'profiles/sample_content',
                                     'CMFDefault',
                                     EXTENSION)

    context.registerClass( Portal.CMFSite
                         , constructors=(factory.addConfiguredSiteForm,
                                         factory.addConfiguredSite,
                                         Portal.manage_addCMFSite)
                         , icon='images/portal.gif'
                         )

    registerIcon( DefaultWorkflow.DefaultWorkflowDefinition
                , 'images/workflow.gif'
                , globals()
                )

    # make registerHelp work with 2 directories
    help = context.getProductHelp()
    lastRegistered = help.lastRegistered
    context.registerHelp(directory='help', clear=1)
    context.registerHelp(directory='interfaces', clear=1)
    if help.lastRegistered != lastRegistered:
        help.lastRegistered = None
        context.registerHelp(directory='help', clear=1)
        help.lastRegistered = None
        context.registerHelp(directory='interfaces', clear=0)
    context.registerHelpTitle('CMF Default Help')
示例#11
0
def initialize(context):
    """
    Initializer called when used as a Zope 2 product.
    """

    cmfutils.registerIcon(AnalyticsReport,
                       'browser/images/chart_bar.gif', globals())

    cmfutils.ToolInit('Google Analytics Tool',
                   tools=tools,
                   icon='browser/images/chart_curve.gif',
                   ).initialize(context)
示例#12
0
def initialize(context):
    """initialize product (called by zope)"""
    ##code-section custom-init-top #fill in your manual code here
    ##/code-section custom-init-top

    # imports packages and types for registration

    import Container
    import Location
    import Broadsheet
    import Tearsheet
    import Column
    import TextColumn
    import RichColumn
    import Issue
    import Pix
    import Article
    import Graphic 
    import Line
    import Headline
    import Line
    import Wordage 
    import Word
    import Block
    import Page 
    import PDFPageTemplate
    import Library

    cmfutils.registerIcon(PDFPageTemplate.PDFPageTemplate, 'images/fspt.gif', globals())

    # Initialize portal content
    all_content_types, all_constructors, all_ftis = process_types(
        listTypes(PROJECTNAME),
        PROJECTNAME)

    cmfutils.ContentInit(
        PROJECTNAME + ' Content',
        content_types      = all_content_types,
        permission         = DEFAULT_ADD_CONTENT_PERMISSION,
        extra_constructors = all_constructors,
        fti                = all_ftis,
        ).initialize(context)

    # Give it some extra permissions to control them on a per class limit
    for i in range(0,len(all_content_types)):
        klassname=all_content_types[i].__name__
        if not klassname in ADD_CONTENT_PERMISSIONS:
            continue

        context.registerClass(meta_type   = all_ftis[i]['meta_type'],
                              constructors= (all_constructors[i],),
                              permission  = ADD_CONTENT_PERMISSIONS[klassname])
def initialize(context):
    """
    Initializer called when used as a Zope 2 product.
    """

    cmfutils.registerIcon(AnalyticsReport, 'browser/images/chart_bar.gif',
                          globals())

    cmfutils.ToolInit(
        'Google Analytics Tool',
        tools=tools,
        icon='browser/images/chart_curve.gif',
    ).initialize(context)
示例#14
0
def initialize(context):

    import NewsletterReference
    import NewsletterRichReference
    import NewsletterBTree

    ContentInit('Plone Gazette Newsletter Theme',
                content_types=(NewsletterTheme.NewsletterTheme, ),
                permission=AddNewsletterTheme,
                extra_constructors=(NewsletterTheme.addNewsletterTheme, ),
                fti=NewsletterTheme.NewsletterTheme.factory_type_information
                ).initialize(context)

    ContentInit(
        'Plone Gazette Newsletter Section',
        content_types=(Section.Section, ),
        permission=ChangeNewsletter,
        extra_constructors=(Section.addSection, ),
        fti=Section.Section.factory_type_information).initialize(context)

    ContentInit('Plone Gazette resources',
                content_types=contentClasses,
                permission=permissions.AddPortalContent,
                extra_constructors=contentConstructors,
                fti=factoryTypes).initialize(context)

    registerIcon(NewsletterTheme.NewsletterTheme,
                 'skins/PloneGazette/NewsletterTheme.gif', globals())
    registerIcon(Newsletter.Newsletter, 'skins/PloneGazette/Newsletter.gif',
                 globals())
    registerIcon(Subscriber.Subscriber, 'skins/PloneGazette/Subscriber.gif',
                 globals())
    registerIcon(Section.Section, 'skins/PloneGazette/Section.gif', globals())
    registerIcon(NewsletterTopic.NewsletterTopic,
                 'skins/PloneGazette/NewsletterTopic.gif', globals())

    # Archetypes init
    content_types, constructors, ftis = process_types(listTypes(PROJECTNAME),
                                                      PROJECTNAME)

    ContentInit(
        PROJECTNAME + ' Content',
        content_types=content_types,
        permission=permissions.AddPortalContent,
        extra_constructors=constructors,
        fti=ftis,
    ).initialize(context)

    return
示例#15
0
文件: __init__.py 项目: goschtl/zope
def initialize( context ):

    initializeBasesPhase2( z_bases, context )
    initializeBasesPhase2( z_tool_bases, context )

    ToolInit( 'CMF Default Tool'
            , tools=tools
            , product_name='CMFDefault'
            , icon='tool.gif'
            ).initialize( context )

    ContentInit( 'CMF Default Content'
               , content_types=contentClasses
               , permission=AddPortalContent
               , extra_constructors=contentConstructors
               , fti=Portal.factory_type_information
               ).initialize( context )

    if has_profile_registry:
        profile_registry.registerProfile('default',
                                         'CMFDefault Site',
                                         'Profile for a default CMFSite.',
                                         'profiles/default',
                                         'CMFDefault',
                                         BASE)

    context.registerClass( Portal.CMFSite
                         , constructors=( Portal.manage_addCMFSiteForm
                                        , Portal.manage_addCMFSite
                                        )
                         , icon='portal.gif'
                         )

    registerIcon( DefaultWorkflow.DefaultWorkflowDefinition
                , 'images/workflow.gif'
                , globals()
                )

    # make registerHelp work with 2 directories
    help = context.getProductHelp()
    lastRegistered = help.lastRegistered
    context.registerHelp(directory='help', clear=1)
    context.registerHelp(directory='interfaces', clear=1)
    if help.lastRegistered != lastRegistered:
        help.lastRegistered = None
        context.registerHelp(directory='help', clear=1)
        help.lastRegistered = None
        context.registerHelp(directory='interfaces', clear=0)
    context.registerHelpTitle('CMF Default Help')
示例#16
0
def initialize(context):
    # (DynamicViewTypeInformation factory is created from ZCML)
    cmf_utils.registerIcon(DynamicViewTypeInformation, 'images/typeinfo.gif',
                           globals())

    context.registerClass(content_for_tests.DynFolder,
                          permission=AddPortalFolders,
                          constructors=(('addDynFolder',
                                         content_for_tests.addDynFolder), ),
                          icon='images/typeinfo.gif')

    context.registerClass(content_for_tests.DynDocument,
                          permission=AddPortalContent,
                          constructors=(('addDynDocument',
                                         content_for_tests.addDynDocument), ),
                          icon='images/typeinfo.gif')
示例#17
0
def initialize(context):
    from Products import CMFTopic

    initializeBasesPhase2(z_bases, context)
    initializeBasesPhase2(z_tool_bases, context)

    ToolInit("CMF Default Tool", tools=tools, icon="tool.gif").initialize(context)

    ContentInit(
        "CMF Default Content",
        content_types=contentClasses,
        permission=AddPortalContent,
        extra_constructors=contentConstructors,
    ).initialize(context)

    profile_registry.registerProfile(
        "default", "CMFDefault Site", "Profile for a default CMFSite.", "profiles/default", "CMFDefault", BASE
    )

    profile_registry.registerProfile(
        "sample_content",
        "Sample CMFDefault Content",
        "Content for a sample CMFSite.",
        "profiles/sample_content",
        "CMFDefault",
        EXTENSION,
        for_=ISiteRoot,
    )

    context.registerClass(
        Portal.CMFSite, constructors=(factory.addConfiguredSiteForm, factory.addConfiguredSite), icon="portal.gif"
    )

    registerIcon(DefaultWorkflow.DefaultWorkflowDefinition, "images/workflow.gif", globals())

    # make registerHelp work with 2 directories
    help = context.getProductHelp()
    lastRegistered = help.lastRegistered
    context.registerHelp(directory="help", clear=1)
    context.registerHelp(directory="interfaces", clear=1)
    if help.lastRegistered != lastRegistered:
        help.lastRegistered = None
        context.registerHelp(directory="help", clear=1)
        help.lastRegistered = None
        context.registerHelp(directory="interfaces", clear=0)
    context.registerHelpTitle("CMF Default Help")
示例#18
0
文件: __init__.py 项目: a25kk/stv2
def initialize(context):

    import NewsletterReference
    import NewsletterRichReference
    import NewsletterBTree

    ContentInit(
        'Plone Gazette Newsletter Theme',
        content_types = (NewsletterTheme.NewsletterTheme,),
        permission = PNLPermissions.AddNewsletterTheme,
        extra_constructors = (NewsletterTheme.addNewsletterTheme,),
        fti = NewsletterTheme.NewsletterTheme.factory_type_information).initialize(context)

    ContentInit(
        'Plone Gazette Newsletter Section',
        content_types = (Section.Section,),
        permission = PNLPermissions.ChangeNewsletter,
        extra_constructors = (Section.addSection,),
        fti = Section.Section.factory_type_information).initialize(context)

    ContentInit(
        'Plone Gazette resources',
        content_types = contentClasses,
        permission = permissions.AddPortalContent,
        extra_constructors = contentConstructors,
        fti = factoryTypes).initialize(context)

    registerIcon(NewsletterTheme.NewsletterTheme, 'skins/PloneGazette/NewsletterTheme.gif', globals())
    registerIcon(Newsletter.Newsletter, 'skins/PloneGazette/Newsletter.gif', globals())
    registerIcon(Subscriber.Subscriber, 'skins/PloneGazette/Subscriber.gif', globals())
    registerIcon(Section.Section, 'skins/PloneGazette/Section.gif', globals())
    registerIcon(NewsletterTopic.NewsletterTopic, 'skins/PloneGazette/NewsletterTopic.gif', globals())

    # Archetypes init
    content_types, constructors, ftis = process_types(listTypes(PROJECTNAME), PROJECTNAME)

    ContentInit(
        PROJECTNAME + ' Content',
        content_types = content_types,
        permission = permissions.AddPortalContent,
        extra_constructors = constructors,
        fti = ftis,).initialize(context)

    return
示例#19
0
def initialize(context):
    utils.registerIcon(DefaultWorkflowPolicy.DefaultWorkflowPolicyDefinition,
                       'images/workflow_policy.gif', globals())

    context.registerClass(
        PlacefulWorkflowTool.PlacefulWorkflowTool,
        meta_type="Placeful Workflow Tool",
        constructors=(PlacefulWorkflowTool.addPlacefulWorkflowTool, ),
        icon='tool.gif')

    context.registerClass(
        WorkflowPolicyConfig.WorkflowPolicyConfig,
        permission='Add Workflow Policy',
        constructors=(WorkflowPolicyConfig.manage_addWorkflowPolicyConfigForm,
                      WorkflowPolicyConfig.manage_addWorkflowPolicyConfig),
        icon='www/WorkflowPolicyConfig_icon.gif',
    )

    utils.ToolInit('CMF Placeful Workflow Tool', tools=tools,
                   icon='tool.gif').initialize(context)
示例#20
0
def initialize(context):

    from Products.CMFCore.utils import ToolInit, registerIcon
    from tool import SetupTool

    ToolInit('CMF Setup Tool', tools=[SetupTool],
             icon=None).initialize(context)

    registerIcon(SetupTool, 'www/tool.png', globals())

    from factory import addConfiguredSiteForm
    from factory import addConfiguredSite

    # Add factory for a site which follows a profile.  We specify
    # meta_type and interfaces because we don't actually register a
    # class here, only a factory.
    context.registerClass(meta_type='Configured CMF Site',
                          constructors=(addConfiguredSiteForm,
                                        addConfiguredSite),
                          permissions=('Add CMF Sites', ),
                          interfaces=None)
示例#21
0
def initialize(context):

    utils.ContentInit(
        'MaintenanceTask',
        content_types = contentClasses,
        permission = ManagePortal,
        extra_constructors = contentConstructors,
        fti = (MaintenanceTask.factory_type_information,),
        ).initialize(context)

    context.registerClass(
        PloneMaintenanceTool.PloneMaintenanceTool,
        meta_type="PloneMaintenance Tool",
        constructors=(PloneMaintenanceTool.addPloneMaintenanceTool,),
        icon = 'tool.gif')

    utils.registerIcon(Tasks.Tasks,
                 'images/task.gif', globals())

    utils.registerIcon(Scripts.Scripts,
                 'images/script.gif', globals())
示例#22
0
def initialize(context):
    tools = (FormController.FormController, )
    ToolInit(
        'Form Controller Tool',
        tools=tools,
        icon='tool.gif',
    ).initialize(context)
    context.registerClass(
        ControllerPageTemplate.ControllerPageTemplate,
        constructors=(
            ControllerPageTemplate.manage_addControllerPageTemplateForm,
            ControllerPageTemplate.manage_addControllerPageTemplate),
        icon='www/cpt.gif',
    )
    context.registerClass(
        ControllerPythonScript.ControllerPythonScript,
        constructors=(
            ControllerPythonScript.manage_addControllerPythonScriptForm,
            ControllerPythonScript.manage_addControllerPythonScript),
        icon='www/cpy.gif',
    )
    context.registerClass(
        ControllerValidator.ControllerValidator,
        constructors=(ControllerValidator.manage_addControllerValidatorForm,
                      ControllerValidator.manage_addControllerValidator),
        icon='www/vpy.gif',
    )
    registerIcon(FSControllerPageTemplate.FSControllerPageTemplate,
                 'www/cpt.gif', globals())
    registerIcon(FSControllerPythonScript.FSControllerPythonScript,
                 'www/cpy.gif', globals())
    registerIcon(FSControllerValidator.FSControllerValidator, 'www/vpy.gif',
                 globals())
示例#23
0
def initialize(context):
    tools = (FormController.FormController,)
    ToolInit("Form Controller Tool", tools=tools, icon="tool.gif").initialize(context)
    context.registerClass(
        ControllerPageTemplate.ControllerPageTemplate,
        constructors=(
            ControllerPageTemplate.manage_addControllerPageTemplateForm,
            ControllerPageTemplate.manage_addControllerPageTemplate,
        ),
        icon="www/cpt.gif",
    )
    context.registerClass(
        ControllerPythonScript.ControllerPythonScript,
        constructors=(
            ControllerPythonScript.manage_addControllerPythonScriptForm,
            ControllerPythonScript.manage_addControllerPythonScript,
        ),
        icon="www/cpy.gif",
    )
    context.registerClass(
        ControllerValidator.ControllerValidator,
        constructors=(
            ControllerValidator.manage_addControllerValidatorForm,
            ControllerValidator.manage_addControllerValidator,
        ),
        icon="www/vpy.gif",
    )
    registerIcon(FSControllerPageTemplate.FSControllerPageTemplate, "www/cpt.gif", globals())
    registerIcon(FSControllerPythonScript.FSControllerPythonScript, "www/cpy.gif", globals())
    registerIcon(FSControllerValidator.FSControllerValidator, "www/vpy.gif", globals())
def initialize(context):
    content_types, constructors, ftis = process_types(
       listTypes(PROJECTNAME),
        PROJECTNAME)

    cmfutils.ToolInit(PROJECTNAME, tools=tools,
                   icon='tool.gif',
                   ).initialize( context )

    cmfutils.registerIcon(ontology.Ontology,
                       'storage.png', globals())

    cmfutils.registerIcon(ClassificationTool,
                       'tool.png', globals())

    cmfutils.ContentInit(
        PROJECTNAME + ' Content',
        content_types      = content_types,
        permission         = ADD_CONTENT_PERMISSION,
        extra_constructors = constructors,
        fti                = ftis,
        ).initialize(context)
示例#25
0
文件: __init__.py 项目: goschtl/zope
def initialize(context):

    ToolInit( 'CMF Default Tool'
            , tools=tools
            , icon='tool.gif'
            ).initialize( context )

    # BBB: register oldstyle constructors
    ContentInit( 'CMF Default Content'
               , content_types=()
               , permission=AddPortalContent
               , extra_constructors=contentConstructors
               ).initialize( context )

    context.registerClass( Portal.CMFSite
                         , constructors=(factory.addConfiguredSiteForm,
                                         factory.addConfiguredSite)
                         , icon='images/portal.gif'
                         )

    registerIcon( DefaultWorkflow.DefaultWorkflowDefinition
                , 'images/workflow.gif'
                , globals()
                )

    # make registerHelp work with 2 directories
    help = context.getProductHelp()
    lastRegistered = help.lastRegistered
    context.registerHelp(directory='help', clear=1)
    context.registerHelp(directory='interfaces', clear=1)
    if help.lastRegistered != lastRegistered:
        help.lastRegistered = None
        context.registerHelp(directory='help', clear=1)
        help.lastRegistered = None
        context.registerHelp(directory='interfaces', clear=0)
    context.registerHelpTitle('CMF Default Help')
示例#26
0
def initialize(context):

    import NewsletterTheme, Newsletter, Subscriber, NewsletterBTree

    contentConstructors = (Newsletter.addNewsletter, Subscriber.addSubscriber)
    contentClasses = (Newsletter.Newsletter, Subscriber.Subscriber)
    factoryTypes = (Newsletter.Newsletter.factory_type_information, Subscriber.Subscriber.factory_type_information)

    ContentInit(
        "Plone Gazette Newsletter Theme",
        content_types=(NewsletterTheme.NewsletterTheme,),
        permission=PNLPermissions.AddNewsletterTheme,
        extra_constructors=(NewsletterTheme.addNewsletterTheme,),
        fti=NewsletterTheme.NewsletterTheme.factory_type_information,
    ).initialize(context)

    ContentInit(
        "Plone Gazette resources",
        content_types=contentClasses,
        permission=permissions.AddPortalContent,
        extra_constructors=contentConstructors,
        fti=factoryTypes,
    ).initialize(context)

    registerIcon(NewsletterTheme.NewsletterTheme, "skins/PloneGazette/NewsletterTheme.gif", globals())
    registerIcon(Newsletter.Newsletter, "skins/PloneGazette/Newsletter.gif", globals())
    registerIcon(Subscriber.Subscriber, "skins/PloneGazette/Subscriber.gif", globals())

    # Archetypes init
    content_types, constructors, ftis = process_types(listTypes(PROJECTNAME), PROJECTNAME)

    ContentInit(
        PROJECTNAME + " Content",
        content_types=content_types,
        permission=permissions.AddPortalContent,
        extra_constructors=constructors,
        fti=ftis,
    ).initialize(context)
示例#27
0
def initialize(context):

    from Products.CMFCore.DirectoryView import registerDirectory
    from Products.CMFCore.utils import ToolInit
    from Products.CMFCore.utils import ContentInit
    from Products.CMFCore.utils import registerIcon
    from Products.GenericSetup import BASE
    from Products.GenericSetup import EXTENSION
    from Products.GenericSetup import profile_registry

    import DefaultWorkflow
    import DiscussionItem
    import DiscussionTool
    import Document
    import DublinCore
    import Favorite
    import File
    import Image
    import Link
    import MembershipTool
    import MetadataTool
    import NewsItem
    import Portal
    import PropertiesTool
    import RegistrationTool
    import SkinnedFolder
    import SyndicationTool
    import factory
    import utils
    from permissions import AddPortalContent

    tools = (DiscussionTool.DiscussionTool, MembershipTool.MembershipTool,
             RegistrationTool.RegistrationTool, PropertiesTool.PropertiesTool,
             MetadataTool.MetadataTool, SyndicationTool.SyndicationTool)

    ToolInit('CMF Default Tool', tools=tools,
             icon='tool.gif').initialize(context)

    contentClasses = (Document.Document, File.File, Image.Image, Link.Link,
                      Favorite.Favorite, NewsItem.NewsItem,
                      SkinnedFolder.SkinnedFolder)

    contentConstructors = (Document.addDocument, File.addFile, Image.addImage,
                           Link.addLink, Favorite.addFavorite,
                           NewsItem.addNewsItem,
                           SkinnedFolder.addSkinnedFolder)

    ContentInit('CMF Default Content',
                content_types=contentClasses,
                permission=AddPortalContent,
                extra_constructors=contentConstructors).initialize(context)

    profile_registry.registerProfile('default', 'CMFDefault Site',
                                     'Profile for a default CMFSite.',
                                     'profiles/default', 'CMFDefault', BASE)

    profile_registry.registerProfile('sample_content',
                                     'Sample CMFDefault Content',
                                     'Content for a sample CMFSite.',
                                     'profiles/sample_content', 'CMFDefault',
                                     EXTENSION)

    context.registerClass(Portal.CMFSite,
                          constructors=(factory.addConfiguredSiteForm,
                                        factory.addConfiguredSite),
                          icon='images/portal.gif')

    registerDirectory('skins', cmfdefault_globals)
    registerDirectory('help', cmfdefault_globals)

    registerIcon(DefaultWorkflow.DefaultWorkflowDefinition,
                 'images/workflow.gif', cmfdefault_globals)

    if 0:  # XXX: comment this out for now
        # make registerHelp work with 2 directories
        help = context.getProductHelp()
        lastRegistered = help.lastRegistered
        context.registerHelp(directory='help', clear=1)
        context.registerHelp(directory='interfaces', clear=1)

        if help.lastRegistered != lastRegistered:
            help.lastRegistered = None
            context.registerHelp(directory='help', clear=1)
            help.lastRegistered = None
            context.registerHelp(directory='interfaces', clear=0)

        context.registerHelpTitle('CMF Default Help')
示例#28
0
文件: __init__.py 项目: goschtl/zope
def initialize(context):

    registerIcon(DCWorkflow.DCWorkflowDefinition,
                 'images/workflow.gif', globals())
    registerIcon(States.States,
                 'images/state.gif', globals())
    States.StateDefinition.icon = States.States.icon
    registerIcon(Transitions.Transitions,
                 'images/transition.gif', globals())
    Transitions.TransitionDefinition.icon = Transitions.Transitions.icon
    registerIcon(Variables.Variables,
                 'images/variable.gif', globals())
    Variables.VariableDefinition.icon = Variables.Variables.icon
    registerIcon(Worklists.Worklists,
                 'images/worklist.gif', globals())
    Worklists.WorklistDefinition.icon = Worklists.Worklists.icon
    registerIcon(Scripts.Scripts,
                 'images/script.gif', globals())
示例#29
0
        finally:
            security.removeContext(self)

        return result

    # Copy over more methods
    security.declareProtected(FTPAccess, 'manage_FTPget')
    manage_FTPget = ZopeSimplate.manage_FTPget

    security.declareProtected(View, 'get_size')
    get_size = ZopeSimplate.get_size
    getSize = get_size

    security.declareProtected(ViewManagementScreens, 'PrincipiaSearchSource')
    PrincipiaSearchSource = ZopeSimplate.PrincipiaSearchSource

    security.declareProtected(ViewManagementScreens, 'document_src')
    document_src = ZopeSimplate.document_src

    simplate_getContext = ZopeSimplate.simplate_getContext

    ZScriptHTML_tryParams = ZopeSimplate.ZScriptHTML_tryParams

Globals.InitializeClass(FSSimplate)

registerFileExtension('smpt', FSSimplate)
registerFileExtension('smpl', FSSimplate)
registerFileExtension('spt', FSSimplate)
registerMetaType('Simplate', FSSimplate)
registerIcon(FSSimplate, 'www/fssimplate.png', globals())
示例#30
0
文件: __init__.py 项目: goschtl/zope
def initialize( context ):

    from Products.CMFCore.DirectoryView import registerDirectory
    from Products.CMFCore.utils import ToolInit
    from Products.CMFCore.utils import ContentInit
    from Products.CMFCore.utils import registerIcon
    from Products.GenericSetup import BASE
    from Products.GenericSetup import EXTENSION
    from Products.GenericSetup import profile_registry

    import DefaultWorkflow
    import DiscussionItem
    import DiscussionTool
    import Document
    import DublinCore
    import Favorite
    import File
    import Image
    import Link
    import MembershipTool
    import MetadataTool
    import NewsItem
    import Portal
    import PropertiesTool
    import RegistrationTool
    import SkinnedFolder
    import SyndicationTool
    import factory
    import utils
    from permissions import AddPortalContent

    tools = ( DiscussionTool.DiscussionTool
            , MembershipTool.MembershipTool
            , RegistrationTool.RegistrationTool
            , PropertiesTool.PropertiesTool
            , MetadataTool.MetadataTool
            , SyndicationTool.SyndicationTool
            )

    ToolInit( 'CMF Default Tool'
            , tools=tools
            , icon='tool.gif'
            ).initialize( context )

    contentClasses = ( Document.Document
                    , File.File
                    , Image.Image
                    , Link.Link
                    , Favorite.Favorite
                    , NewsItem.NewsItem
                    , SkinnedFolder.SkinnedFolder
                    )

    contentConstructors = ( Document.addDocument
                        , File.addFile
                        , Image.addImage
                        , Link.addLink
                        , Favorite.addFavorite
                        , NewsItem.addNewsItem
                        , SkinnedFolder.addSkinnedFolder
                        )

    ContentInit( 'CMF Default Content'
               , content_types=contentClasses
               , permission=AddPortalContent
               , extra_constructors=contentConstructors
               ).initialize( context )

    profile_registry.registerProfile('default',
                                     'CMFDefault Site',
                                     'Profile for a default CMFSite.',
                                     'profiles/default',
                                     'CMFDefault',
                                     BASE)

    profile_registry.registerProfile('sample_content',
                                     'Sample CMFDefault Content',
                                     'Content for a sample CMFSite.',
                                     'profiles/sample_content',
                                     'CMFDefault',
                                     EXTENSION)

    context.registerClass( Portal.CMFSite
                         , constructors=(factory.addConfiguredSiteForm,
                                         factory.addConfiguredSite)
                         , icon='images/portal.gif'
                         )

    registerDirectory('skins', cmfdefault_globals)
    registerDirectory('help', cmfdefault_globals)

    registerIcon( DefaultWorkflow.DefaultWorkflowDefinition
                , 'images/workflow.gif'
                , cmfdefault_globals
                )

    if 0:   # XXX: comment this out for now
        # make registerHelp work with 2 directories
        help = context.getProductHelp()
        lastRegistered = help.lastRegistered
        context.registerHelp(directory='help', clear=1)
        context.registerHelp(directory='interfaces', clear=1)

        if help.lastRegistered != lastRegistered:
            help.lastRegistered = None
            context.registerHelp(directory='help', clear=1)
            help.lastRegistered = None
            context.registerHelp(directory='interfaces', clear=0)

        context.registerHelpTitle('CMF Default Help')
示例#31
0
def initialize( context ):
    import Document
    initializeProduct(context, this_module, globals(),
                         document_module = Document,
                         document_classes = document_classes,
                         object_classes = object_classes,
                         portal_tools = portal_tools,
                         content_constructors = content_constructors,
                         content_classes = content_classes)

    # Initialise ERP5Form Formulator
    FieldRegistry.registerField(ProxyField.ProxyField,
                                'www/StringField.gif')
    FieldRegistry.registerField(DurationField.DurationField,
                                'www/StringField.gif')
    FieldRegistry.registerField(EditorField.EditorField,
                                'www/TextAreaField.gif')
    FieldRegistry.registerField(FormBox.FormBox,
                                'www/StringField.gif')
    FieldRegistry.registerField(POSBox.POSBox,
                                'www/StringField.gif')
    FieldRegistry.registerField(ListBox.ListBox,
                                'www/StringField.gif')
    FieldRegistry.registerField(ReportBox.ReportBox,
                                'www/StringField.gif')
    FieldRegistry.registerField(PlanningBox.PlanningBox,
                                'www/StringField.gif')
    FieldRegistry.registerField(MatrixBox.MatrixBox,
                                'www/StringField.gif')
    FieldRegistry.registerField(RelationField.RelationStringField,
                                'www/StringField.gif')
    FieldRegistry.registerField(MultiRelationField.MultiRelationStringField,
                                'www/StringField.gif')
    FieldRegistry.registerField(ImageField.ImageField,
                                'www/StringField.gif')
    FieldRegistry.registerField(StandardFields.StringField,
                                'www/StringField.gif')
    FieldRegistry.registerField(StandardFields.CheckBoxField,
                                'www/CheckBoxField.gif')
    FieldRegistry.registerField(StandardFields.IntegerField,
                                'www/IntegerField.gif')
    FieldRegistry.registerField(StandardFields.TextAreaField,
                                'www/TextAreaField.gif')
    FieldRegistry.registerField(StandardFields.RawTextAreaField,
                                'www/TextAreaField.gif')
    FieldRegistry.registerField(StandardFields.LinesField,
                                'www/LinesField.gif')
    FieldRegistry.registerField(StandardFields.ListField,
                                'www/ListField.gif')
    FieldRegistry.registerField(StandardFields.MultiListField,
                                'www/MultiListField.gif')
    FieldRegistry.registerField(ParallelListField.ParallelListField,
                                'www/MultiListField.gif')
    FieldRegistry.registerField(StandardFields.RadioField,
                                'www/RadioField.gif')
    FieldRegistry.registerField(StandardFields.MultiCheckBoxField,
                                'www/MultiCheckBoxField.gif')
    FieldRegistry.registerField(StandardFields.PasswordField,
                                'www/PasswordField.gif')
    FieldRegistry.registerField(StandardFields.EmailField,
                                'www/EmailField.gif')
    FieldRegistry.registerField(StandardFields.PatternField,
                                'www/PatternField.gif')
    FieldRegistry.registerField(StandardFields.FloatField,
                                'www/FloatField.gif')
    FieldRegistry.registerField(StandardFields.DateTimeField,
                                'www/DateTimeField.gif')
    FieldRegistry.registerField(StandardFields.FileField,
                                'www/FileField.gif')
    FieldRegistry.registerField(StandardFields.LinkField,
                                'www/LinkField.gif')
    FieldRegistry.registerField(StandardFields.LabelField,
                                'www/LabelField.gif')
    FieldRegistry.registerField(MultiLinkField.MultiLinkField,
                                'www/LinkField.gif')
    FieldRegistry.registerField(InputButtonField.InputButtonField,
                                'www/StringField.gif')
    FieldRegistry.registerField(OOoChart.OOoChart,
                                'www/StringField.gif')
    FieldRegistry.registerField(CaptchaField.CaptchaField,
                                'www/StringField.gif')

    # some helper fields
    FieldRegistry.registerField(HelperFields.ListTextAreaField)
    FieldRegistry.registerField(HelperFields.MethodField)
    FieldRegistry.registerField(HelperFields.TALESField)

    import HyperLinkField
    FieldRegistry.registerField(HyperLinkField.HyperLinkField,
                                'www/LinkField.gif')

    import VideoField
    FieldRegistry.registerField(VideoField.VideoField,
                                'www/StringField.gif')
    import AudioField
    FieldRegistry.registerField(AudioField.AudioField,
                                'www/StringField.gif')

    # register help for the product
    context.registerHelp()
    # register field help for all fields
    FieldRegistry.registerFieldHelp(context)

    # make Dummy Fields into real fields
    FieldRegistry.initializeFields()

    # do initialization of Form class to make fields addable
    Form.initializeForm(FieldRegistry)
    Form.initializeForm(FieldRegistry, form_class=Report.ERP5Report)

    # Register FSPDFTemplate icon
    registerIcon(PDFTemplate.FSPDFTemplate,
                        'www/PDF.png', globals())
    # Register ProxyField icon
    registerIcon(ProxyField.ProxyField,
                        'www/ProxyField.png', globals())
示例#32
0
文件: __init__.py 项目: goschtl/zope
def initialize(context):
    
    context.registerHelp(directory='help')
    context.registerHelpTitle('DCWorkflow')
    
    registerIcon(DCWorkflow.DCWorkflowDefinition,
                 'images/workflow.gif', globals())
    registerIcon(States.States,
                 'images/state.gif', globals())
    States.StateDefinition.icon = States.States.icon
    registerIcon(Transitions.Transitions,
                 'images/transition.gif', globals())
    Transitions.TransitionDefinition.icon = Transitions.Transitions.icon
    registerIcon(Variables.Variables,
                 'images/variable.gif', globals())
    Variables.VariableDefinition.icon = Variables.Variables.icon
    registerIcon(Worklists.Worklists,
                 'images/worklist.gif', globals())
    Worklists.WorklistDefinition.icon = Worklists.Worklists.icon
    registerIcon(Scripts.Scripts,
                 'images/script.gif', globals())

    profile_registry.registerProfile('revision2',
                                     'CMF Default Workflow [Revision 2]',
                                     'Adds revision 2 of default workflow.',
                                     'profiles/revision2',
                                     'DCWorkflow',
                                     EXTENSION,
                                     for_=ISiteRoot)
示例#33
0
##############################################################################
#
# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
# 
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
# 
##############################################################################
"""
"""

from Products.CMFCore import DirectoryView, utils
import FSPageTemplate

utils.registerIcon(FSPageTemplate.FSPageTemplate,
                   'images/fspt.gif', globals())

DirectoryView.registerDirectory('skins', globals())

cmfdecor_globals=globals()

def initialize(context):
    pass
示例#34
0
def initialize(context):

    from Products.CMFCore.utils import registerIcon

    import DCWorkflow
    import States
    import Transitions
    import Variables
    import Worklists
    import Scripts

    context.registerHelp(directory='help')
    context.registerHelpTitle('DCWorkflow')

    registerIcon(DCWorkflow.DCWorkflowDefinition,
                 'images/workflow.gif', globals())
    registerIcon(States.States,
                 'images/state.gif', globals())
    States.StateDefinition.icon = States.States.icon
    registerIcon(Transitions.Transitions,
                 'images/transition.gif', globals())
    Transitions.TransitionDefinition.icon = Transitions.Transitions.icon
    registerIcon(Variables.Variables,
                 'images/variable.gif', globals())
    Variables.VariableDefinition.icon = Variables.Variables.icon
    registerIcon(Worklists.Worklists,
                 'images/worklist.gif', globals())
    Worklists.WorklistDefinition.icon = Worklists.Worklists.icon
    registerIcon(Scripts.Scripts,
                 'images/script.gif', globals())
示例#35
0
def initialize(context):

    registerIcon(DCWorkflow.DCWorkflowDefinition,
                 'images/workflow.gif', globals())
    registerIcon(States.States,
                 'images/state.gif', globals())
    States.StateDefinition.icon = States.States.icon
    registerIcon(Transitions.Transitions,
                 'images/transition.gif', globals())
    Transitions.TransitionDefinition.icon = Transitions.Transitions.icon
    registerIcon(Variables.Variables,
                 'images/variable.gif', globals())
    Variables.VariableDefinition.icon = Variables.Variables.icon
    registerIcon(Worklists.Worklists,
                 'images/worklist.gif', globals())
    Worklists.WorklistDefinition.icon = Worklists.Worklists.icon
    registerIcon(Scripts.Scripts,
                 'images/script.gif', globals())
示例#36
0
def initialize(context):
    import Document
    initializeProduct(context,
                      this_module,
                      globals(),
                      document_module=Document,
                      document_classes=document_classes,
                      object_classes=object_classes,
                      portal_tools=portal_tools,
                      content_constructors=content_constructors,
                      content_classes=content_classes)

    # Initialise ERP5Form Formulator
    FieldRegistry.registerField(ProxyField.ProxyField, 'www/StringField.gif')
    FieldRegistry.registerField(DurationField.DurationField,
                                'www/StringField.gif')
    FieldRegistry.registerField(EditorField.EditorField,
                                'www/TextAreaField.gif')
    FieldRegistry.registerField(FormBox.FormBox, 'www/StringField.gif')
    FieldRegistry.registerField(POSBox.POSBox, 'www/StringField.gif')
    FieldRegistry.registerField(ListBox.ListBox, 'www/StringField.gif')
    FieldRegistry.registerField(ReportBox.ReportBox, 'www/StringField.gif')
    FieldRegistry.registerField(PlanningBox.PlanningBox, 'www/StringField.gif')
    FieldRegistry.registerField(MatrixBox.MatrixBox, 'www/StringField.gif')
    FieldRegistry.registerField(RelationField.RelationStringField,
                                'www/StringField.gif')
    FieldRegistry.registerField(MultiRelationField.MultiRelationStringField,
                                'www/StringField.gif')
    FieldRegistry.registerField(ImageField.ImageField, 'www/StringField.gif')
    FieldRegistry.registerField(StandardFields.StringField,
                                'www/StringField.gif')
    FieldRegistry.registerField(StandardFields.CheckBoxField,
                                'www/CheckBoxField.gif')
    FieldRegistry.registerField(StandardFields.IntegerField,
                                'www/IntegerField.gif')
    FieldRegistry.registerField(StandardFields.TextAreaField,
                                'www/TextAreaField.gif')
    FieldRegistry.registerField(StandardFields.RawTextAreaField,
                                'www/TextAreaField.gif')
    FieldRegistry.registerField(StandardFields.LinesField,
                                'www/LinesField.gif')
    FieldRegistry.registerField(StandardFields.ListField, 'www/ListField.gif')
    FieldRegistry.registerField(StandardFields.MultiListField,
                                'www/MultiListField.gif')
    FieldRegistry.registerField(ParallelListField.ParallelListField,
                                'www/MultiListField.gif')
    FieldRegistry.registerField(StandardFields.RadioField,
                                'www/RadioField.gif')
    FieldRegistry.registerField(StandardFields.MultiCheckBoxField,
                                'www/MultiCheckBoxField.gif')
    FieldRegistry.registerField(StandardFields.PasswordField,
                                'www/PasswordField.gif')
    FieldRegistry.registerField(StandardFields.EmailField,
                                'www/EmailField.gif')
    FieldRegistry.registerField(StandardFields.PatternField,
                                'www/PatternField.gif')
    FieldRegistry.registerField(StandardFields.FloatField,
                                'www/FloatField.gif')
    FieldRegistry.registerField(StandardFields.DateTimeField,
                                'www/DateTimeField.gif')
    FieldRegistry.registerField(StandardFields.FileField, 'www/FileField.gif')
    FieldRegistry.registerField(StandardFields.LinkField, 'www/LinkField.gif')
    FieldRegistry.registerField(StandardFields.LabelField,
                                'www/LabelField.gif')
    FieldRegistry.registerField(MultiLinkField.MultiLinkField,
                                'www/LinkField.gif')
    FieldRegistry.registerField(InputButtonField.InputButtonField,
                                'www/StringField.gif')
    FieldRegistry.registerField(OOoChart.OOoChart, 'www/StringField.gif')
    FieldRegistry.registerField(CaptchaField.CaptchaField,
                                'www/StringField.gif')

    # some helper fields
    FieldRegistry.registerField(HelperFields.ListTextAreaField)
    FieldRegistry.registerField(HelperFields.MethodField)
    FieldRegistry.registerField(HelperFields.TALESField)

    import HyperLinkField
    FieldRegistry.registerField(HyperLinkField.HyperLinkField,
                                'www/LinkField.gif')

    import VideoField
    FieldRegistry.registerField(VideoField.VideoField, 'www/StringField.gif')
    import AudioField
    FieldRegistry.registerField(AudioField.AudioField, 'www/StringField.gif')
    import GadgetField
    FieldRegistry.registerField(GadgetField.GadgetField, 'www/StringField.gif')

    # register help for the product
    context.registerHelp()
    # register field help for all fields
    FieldRegistry.registerFieldHelp(context)

    # make Dummy Fields into real fields
    FieldRegistry.initializeFields()

    # do initialization of Form class to make fields addable
    Form.initializeForm(FieldRegistry)
    Form.initializeForm(FieldRegistry, form_class=Report.ERP5Report)

    # Register FSPDFTemplate icon
    registerIcon(PDFTemplate.FSPDFTemplate, 'www/PDF.png', globals())
    # Register ProxyField icon
    registerIcon(ProxyField.ProxyField, 'www/ProxyField.png', globals())
示例#37
0
def initialize(context):

    context.registerHelp(directory='help')
    context.registerHelpTitle('DCWorkflow')

    registerIcon(DCWorkflow.DCWorkflowDefinition, 'images/workflow.gif',
                 globals())
    registerIcon(States.States, 'images/state.gif', globals())
    States.StateDefinition.icon = States.States.icon
    registerIcon(Transitions.Transitions, 'images/transition.gif', globals())
    Transitions.TransitionDefinition.icon = Transitions.Transitions.icon
    registerIcon(Variables.Variables, 'images/variable.gif', globals())
    Variables.VariableDefinition.icon = Variables.Variables.icon
    registerIcon(Worklists.Worklists, 'images/worklist.gif', globals())
    Worklists.WorklistDefinition.icon = Worklists.Worklists.icon
    registerIcon(Scripts.Scripts, 'images/script.gif', globals())

    profile_registry.registerProfile('revision2',
                                     'CMF Default Workflow [Revision 2]',
                                     'Adds revision 2 of default workflow.',
                                     'profiles/revision2',
                                     'DCWorkflow',
                                     EXTENSION,
                                     for_=ISiteRoot)
示例#38
0
文件: __init__.py 项目: goschtl/zope
#   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
#   USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
#   ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
#   OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
#   OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
#   SUCH DAMAGE.
# 
# 
# This software consists of contributions made by Digital Creations and
# many individuals on behalf of Digital Creations.  Specific
# attributions are listed in the accompanying credits file.
# 
##############################################################################
"""
"""

from Products.CMFCore import DirectoryView, utils
import FSPageTemplate

utils.registerIcon(FSPageTemplate.FSPageTemplate,
                   'images/fspt.gif', globals())

DirectoryView.registerDirectory('skins', globals())

cmfdecor_globals=globals()

def initialize(context):
    pass
示例#39
0
文件: __init__.py 项目: goschtl/zope
def initialize( context ):

    from Products.CMFCore.utils import ToolInit, registerIcon
    from tool import SetupTool


    ToolInit( 'CMF Setup Tool'
            , tools=[ SetupTool ]
            , product_name='Setup'
            , icon=None
            ).initialize( context )

    registerIcon(  SetupTool, 'www/tool.png', globals() )

    from factory import addConfiguredSiteForm
    from factory import addConfiguredSite

    # Add factory for a site which follows a profile.  We specify
    # meta_type and interfaces because we don't actually register a
    # class here, only a factory.
    context.registerClass( meta_type='Configured CMF Site'
                         , constructors=( addConfiguredSiteForm
                                        , addConfiguredSite
                                        )
                         , permissions=( 'Add CMF Sites', )
                         , interfaces=None
                         )


    profile_registry.registerProfile( 'default'
                                    , 'CMFSetup Default'
                                    , 'Default profile (for testing)'
                                    , 'profiles/default'
                                    , 'CMFSetup'
                                    )

    return # XXX comment out the rest

    # XXX:  This is *all* policy, and belongs in an XML file!

    # Install setup steps and export scripts
    from SetupSteps import installTools
    from SetupSteps import configureCookieCrumbler

    registerSetupStep('installTools', '2004/05/10-01',
                    installTools)

    registerSetupStep('configureCookieCrumbler', '2004/05/10-01',
                    configureCookieCrumbler)

    from CatalogIndexesConfig import configureCatalogIndexes
    from CatalogIndexesConfig import exportCatalogIndexes

    registerSetupStep('configureCatalogIndexes', '2004/05/10-01',
                      configureCatalogIndexes, ('installTools',))
    registerExportScript('exportCatalogIndexes', exportCatalogIndexes)

    from SkeletonBuilder import buildFolderStructure
    from SkeletonBuilder import generateSkeleton

    registerSetupStep('buildFolderStructure', '2004/05/10-01',
                      buildFolderStructure, ( 'installTypes'
                                            , 'configureSkins'
                                            , 'configureWorkflows'
                                            # Because the folder buildout will
                                            # need to know whomever is the
                                            # author of certain content:
                                            , 'installMembershipToolContent'
                                            ))
    registerExportScript('generateSkeleton', generateSkeleton)

    from ActionIconsConfig import configureActionIcons, exportActionIcons
    registerSetupStep('configureActionIcons', '2004/05/10-02',
                      configureActionIcons, ('installTools',))
    registerExportScript('exportActionIcons', exportActionIcons)

    from MembershipConfig import installMembershipToolContent
    from MembershipConfig import exportMembershipToolContent
    registerSetupStep('installMembershipToolContent', '2004/05/10-01',
                      installMembershipToolContent, ('installTools',
                                                     'installTypes'))
    registerExportScript('exportMembershipToolContent',
                         exportMembershipToolContent)

    from MemberDataConfig import configureMemberDataTool
    from MemberDataConfig import exportMemberDataToolConfig
    registerSetupStep('configureMemberDataTool', '2004/05/10-01',
                      configureMemberDataTool, ())
    registerExportScript('exportMemberDataToolConfig',
                         exportMemberDataToolConfig)
示例#40
0
def initialize(context):

    from Products.CMFCore.utils import ToolInit, registerIcon
    from tool import SetupTool

    ToolInit('CMF Setup Tool',
             tools=[SetupTool],
             product_name='Setup',
             icon=None).initialize(context)

    registerIcon(SetupTool, 'www/tool.png', globals())

    from factory import addConfiguredSiteForm
    from factory import addConfiguredSite

    # Add factory for a site which follows a profile.  We specify
    # meta_type and interfaces because we don't actually register a
    # class here, only a factory.
    context.registerClass(meta_type='Configured CMF Site',
                          constructors=(addConfiguredSiteForm,
                                        addConfiguredSite),
                          permissions=('Add CMF Sites', ),
                          interfaces=None)

    profile_registry.registerProfile('default', 'CMFSetup Default',
                                     'Default profile (for testing)',
                                     'profiles/default', 'CMFSetup')

    return  # XXX comment out the rest

    # XXX:  This is *all* policy, and belongs in an XML file!

    # Install setup steps and export scripts
    from SetupSteps import installTools
    from SetupSteps import configureCookieCrumbler

    registerSetupStep('installTools', '2004/05/10-01', installTools)

    registerSetupStep('configureCookieCrumbler', '2004/05/10-01',
                      configureCookieCrumbler)

    from CatalogIndexesConfig import configureCatalogIndexes
    from CatalogIndexesConfig import exportCatalogIndexes

    registerSetupStep('configureCatalogIndexes', '2004/05/10-01',
                      configureCatalogIndexes, ('installTools', ))
    registerExportScript('exportCatalogIndexes', exportCatalogIndexes)

    from SkeletonBuilder import buildFolderStructure
    from SkeletonBuilder import generateSkeleton

    registerSetupStep(
        'buildFolderStructure',
        '2004/05/10-01',
        buildFolderStructure,
        (
            'installTypes',
            'configureSkins',
            'configureWorkflows'
            # Because the folder buildout will
            # need to know whomever is the
            # author of certain content:
            ,
            'installMembershipToolContent'))
    registerExportScript('generateSkeleton', generateSkeleton)

    from ActionIconsConfig import configureActionIcons, exportActionIcons
    registerSetupStep('configureActionIcons', '2004/05/10-02',
                      configureActionIcons, ('installTools', ))
    registerExportScript('exportActionIcons', exportActionIcons)

    from MembershipConfig import installMembershipToolContent
    from MembershipConfig import exportMembershipToolContent
    registerSetupStep('installMembershipToolContent', '2004/05/10-01',
                      installMembershipToolContent,
                      ('installTools', 'installTypes'))
    registerExportScript('exportMembershipToolContent',
                         exportMembershipToolContent)

    from MemberDataConfig import configureMemberDataTool
    from MemberDataConfig import exportMemberDataToolConfig
    registerSetupStep('configureMemberDataTool', '2004/05/10-01',
                      configureMemberDataTool, ())
    registerExportScript('exportMemberDataToolConfig',
                         exportMemberDataToolConfig)
示例#41
0
def initialize(context):
    from Products.CMFCore.utils import ToolInit
    from Products.CMFCore.utils import ContentInit
    from Products.CMFCore.utils import registerIcon
    from Products.CMFDefault.permissions import AddPortalContent

    import DefaultWorkflow
    import DiscussionTool
    import Document
    import factory
    import Favorite
    import File
    import Image
    import Link
    import MembershipTool
    import MetadataTool
    import NewsItem
    import Portal
    import PropertiesTool
    import RegistrationTool
    import SkinnedFolder
    import SyndicationTool

    # Make sure security is initialized
    import DiscussionItem
    import DublinCore
    import utils

    contentConstructors = (Document.addDocument, File.addFile, Image.addImage,
                           Link.addLink, Favorite.addFavorite,
                           NewsItem.addNewsItem,
                           SkinnedFolder.addSkinnedFolder)

    tools = (DiscussionTool.DiscussionTool, MembershipTool.MembershipTool,
             RegistrationTool.RegistrationTool, PropertiesTool.PropertiesTool,
             MetadataTool.MetadataTool, SyndicationTool.SyndicationTool)

    # Register the ID to interface data for those items that don't have their
    # own module
    from Products.CMFCore.utils import registerToolInterface
    from Products.GenericSetup.interfaces import ISetupTool
    registerToolInterface('portal_setup', ISetupTool)
    from Products.MailHost.interfaces import IMailHost
    registerToolInterface('MailHost', IMailHost)

    ToolInit('CMF Default Tool', tools=tools,
             icon='tool.gif').initialize(context)

    # BBB: register oldstyle constructors
    ContentInit('CMF Default Content',
                content_types=(),
                permission=AddPortalContent,
                extra_constructors=contentConstructors,
                visibility=None).initialize(context)

    context.registerClass(Portal.CMFSite,
                          constructors=(factory.addConfiguredSiteForm,
                                        factory.addConfiguredSite),
                          icon='images/portal.gif')

    registerIcon(DefaultWorkflow.DefaultWorkflowDefinition,
                 'images/workflow.gif', globals())

    # make registerHelp work with 2 directories
    help = context.getProductHelp()
    lastRegistered = help.lastRegistered
    context.registerHelp(directory='help', clear=1)
    context.registerHelp(directory='interfaces', clear=1)
    if help.lastRegistered != lastRegistered:
        help.lastRegistered = None
        context.registerHelp(directory='help', clear=1)
        help.lastRegistered = None
        context.registerHelp(directory='interfaces', clear=0)
    context.registerHelpTitle('CMF Default Help')
示例#42
0
文件: __init__.py 项目: goschtl/zope
def initialize(context):
    from Products.CMFCore.utils import ToolInit
    from Products.CMFCore.utils import ContentInit
    from Products.CMFCore.utils import registerIcon
    from Products.CMFDefault.permissions import AddPortalContent

    import DefaultWorkflow
    import DiscussionTool
    import Document
    import factory
    import Favorite
    import File
    import Image
    import Link
    import MembershipTool
    import MetadataTool
    import NewsItem
    import Portal
    import PropertiesTool
    import RegistrationTool
    import SkinnedFolder
    import SyndicationTool

    # Make sure security is initialized
    import DiscussionItem
    import DublinCore
    import utils

    contentConstructors = ( Document.addDocument
                        , File.addFile
                        , Image.addImage
                        , Link.addLink
                        , Favorite.addFavorite
                        , NewsItem.addNewsItem
                        , SkinnedFolder.addSkinnedFolder
                        )

    tools = ( DiscussionTool.DiscussionTool
            , MembershipTool.MembershipTool
            , RegistrationTool.RegistrationTool
            , PropertiesTool.PropertiesTool
            , MetadataTool.MetadataTool
            , SyndicationTool.SyndicationTool
            )

    # Register the ID to interface data for those items that don't have their 
    # own module
    from Products.CMFCore.utils import registerToolInterface
    from Products.GenericSetup.interfaces import ISetupTool
    registerToolInterface('portal_setup', ISetupTool)
    from Products.MailHost.interfaces import IMailHost
    registerToolInterface('MailHost', IMailHost)

    ToolInit( 'CMF Default Tool'
            , tools=tools
            , icon='tool.gif'
            ).initialize( context )

    # BBB: register oldstyle constructors
    ContentInit( 'CMF Default Content'
               , content_types=()
               , permission=AddPortalContent
               , extra_constructors=contentConstructors
               , visibility=None
               ).initialize( context )

    context.registerClass( Portal.CMFSite
                         , constructors=(factory.addConfiguredSiteForm,
                                         factory.addConfiguredSite)
                         , icon='images/portal.gif'
                         )

    registerIcon( DefaultWorkflow.DefaultWorkflowDefinition
                , 'images/workflow.gif'
                , globals()
                )

    # make registerHelp work with 2 directories
    help = context.getProductHelp()
    lastRegistered = help.lastRegistered
    context.registerHelp(directory='help', clear=1)
    context.registerHelp(directory='interfaces', clear=1)
    if help.lastRegistered != lastRegistered:
        help.lastRegistered = None
        context.registerHelp(directory='help', clear=1)
        help.lastRegistered = None
        context.registerHelp(directory='interfaces', clear=0)
    context.registerHelpTitle('CMF Default Help')
示例#43
0
def initialize(context):
    # (DynamicViewTypeInformation factory is created from ZCML)
    cmf_utils.registerIcon(DynamicViewTypeInformation, 'images/typeinfo.gif', globals())
    return