当前位置: 首页>>代码示例>>Python>>正文


Python DirectoryView.registerDirectory方法代码示例

本文整理汇总了Python中Products.CMFCore.DirectoryView.registerDirectory方法的典型用法代码示例。如果您正苦于以下问题:Python DirectoryView.registerDirectory方法的具体用法?Python DirectoryView.registerDirectory怎么用?Python DirectoryView.registerDirectory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Products.CMFCore.DirectoryView的用法示例。


在下文中一共展示了DirectoryView.registerDirectory方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: initialize

# 需要导入模块: from Products.CMFCore import DirectoryView [as 别名]
# 或者: from Products.CMFCore.DirectoryView import registerDirectory [as 别名]
def initialize(context):
    import Warenkorb
    import SimpleProduct
    import DefaultProduct

    # Register skin directory
    DirectoryView.registerDirectory("skins", globals())

    content_types, constructors, ftis = process_types(listTypes(PROJECTNAME), PROJECTNAME)

    utils.ContentInit(
        PROJECTNAME + " Warenkorb",
        content_types=content_types,
        permission=ADD_CONTENT_PERMISSION,
        extra_constructors=constructors,
        fti=ftis,
    ).initialize(context)

    utils.ContentInit(
        PROJECTNAME + " Simple Product",
        content_types=content_types,
        permission=ADD_CONTENT_PERMISSION,
        extra_constructors=constructors,
        fti=ftis,
    ).initialize(context)

    utils.ContentInit(
        PROJECTNAME + " Default Product",
        content_types=content_types,
        permission=ADD_CONTENT_PERMISSION,
        extra_constructors=constructors,
        fti=ftis,
    ).initialize(context)
开发者ID:a25kk,项目名称:hotclubnews,代码行数:35,代码来源:__init__.py

示例2: initialize

# 需要导入模块: from Products.CMFCore import DirectoryView [as 别名]
# 或者: from Products.CMFCore.DirectoryView import registerDirectory [as 别名]
def initialize(context):
    """Initializer called when used as a Zope 2 product.
    """
    import easyshop.search.content
    
    # Register skin directory
    DirectoryView.registerDirectory('skins', globals())
开发者ID:Easyshop,项目名称:Easyshop,代码行数:9,代码来源:__init__.py

示例3: initialize

# 需要导入模块: from Products.CMFCore import DirectoryView [as 别名]
# 或者: from Products.CMFCore.DirectoryView import registerDirectory [as 别名]
def initialize(context):
    """Initializer called when used as a Zope 2 product."""

    # Register Plone skins directory
    from Products.CMFCore import DirectoryView
    GLOBALS = globals()
    DirectoryView.registerDirectory('skins', GLOBALS)
开发者ID:jcu-eresearch,项目名称:nrbc.recentitems,代码行数:9,代码来源:__init__.py

示例4: initialize

# 需要导入模块: from Products.CMFCore import DirectoryView [as 别名]
# 或者: from Products.CMFCore.DirectoryView import registerDirectory [as 别名]
def initialize(context):
    """
    
    """
    from Products.CMFCore import DirectoryView

    # This is required.
    # For some reason you cannot register a skin
    # directory for a non-theme product through
    # zcml
    DirectoryView.registerDirectory('skins', globals())
开发者ID:uwosh,项目名称:uwosh.themebase,代码行数:13,代码来源:__init__.py

示例5: initialize

# 需要导入模块: from Products.CMFCore import DirectoryView [as 别名]
# 或者: from Products.CMFCore.DirectoryView import registerDirectory [as 别名]
def initialize(context):
    """Initializer called when used as a Zope 2 product.
    """
    DirectoryView.registerDirectory('skins', globals())
    
    # register profile
    profile_registry.registerProfile(
        name         = 'default',
        title        = 'EasyShopSkins',
        description  = 'Skinsfolder for EasyShop for Plone 2.5',
        path         = 'profiles/default',
        product      = 'EasyShopSkins',
        profile_type = EXTENSION,
        for_         = IPloneSiteRoot)
开发者ID:Easyshop,项目名称:Easyshop,代码行数:16,代码来源:__init__.py

示例6: initialize

# 需要导入模块: from Products.CMFCore import DirectoryView [as 别名]
# 或者: from Products.CMFCore.DirectoryView import registerDirectory [as 别名]
def initialize(context):
    """Initializer called when used as a Zope 2 product.

    This is referenced from configure.zcml. Regstrations as a "Zope 2 product"
    is necessary for GenericSetup profiles to work, for example.

    Here, we call the Archetypes machinery to register our content types
    with Zope and the CMF.
    """

    # Register Plone skins directory
    from Products.CMFCore import DirectoryView
    GLOBALS = globals()
    DirectoryView.registerDirectory('skins', GLOBALS)

    # Retrieve the content types that have been registered with Archetypes
    # This happens when the content type is imported and the registerType()
    # call in the content type's module is invoked. Actually, this happens
    # during ZCML processing, but we do it here again to be explicit. Of
    # course, even if we import the module several times, it is only run
    # once.

    content_types, constructors, ftis = atapi.process_types(
        atapi.listTypes(config.PROJECTNAME),
        config.PROJECTNAME)

    # Now initialize all these content types. The initialization process takes
    # care of registering low-level Zope 2 factories, including the relevant
    # add-permission. These are listed in config.py. We use different
    # permissions for each content type to allow maximum flexibility of who
    # can add which content types, where. The roles are set up in rolemap.xml
    # in the GenericSetup profile.

    for atype, constructor in zip(content_types, constructors):
        utils.ContentInit('%s: %s' % (config.PROJECTNAME, atype.portal_type),
            content_types      = (atype,),
            permission         = config.ADD_PERMISSIONS[atype.portal_type],
            extra_constructors = (constructor,),
            ).initialize(context)
开发者ID:jcu-eresearch,项目名称:nrbc.literature,代码行数:41,代码来源:__init__.py

示例7: initialize

# 需要导入模块: from Products.CMFCore import DirectoryView [as 别名]
# 或者: from Products.CMFCore.DirectoryView import registerDirectory [as 别名]
def initialize(context):
    """initialize product (called by zope)"""

    import VwireLens
    import config
    import setuphandlers
    from Products.Archetypes.atapi import process_types
    from Products.Archetypes.atapi import listTypes
    from Products.CMFCore import utils 
    from Products.CMFCore import DirectoryView

    DirectoryView.registerDirectory('skins', config.product_globals)

    content_types, constructors, ftis = process_types(
        listTypes(config.PROJECTNAME),
        config.PROJECTNAME)

    utils.ContentInit(
	"%s Content" % config.PROJECTNAME,
        content_types      = content_types,
        permission         = config.ADD_CONTENT_PERMISSIONS['VwireLens'],
        extra_constructors = constructors,
        fti                = ftis,
        ).initialize(context)
开发者ID:DrDanPrice,项目名称:Vwire,代码行数:26,代码来源:__init__.py

示例8: globals

# 需要导入模块: from Products.CMFCore import DirectoryView [as 别名]
# 或者: from Products.CMFCore.DirectoryView import registerDirectory [as 别名]
from Products.CMFCore import utils, DirectoryView
from Products.Archetypes.atapi import *
from Products.Archetypes import listTypes

ADD_CONTENT_PERMISSION = """Add FAQ content"""
PROJECTNAME = "FAQ"

product_globals = globals()

DirectoryView.registerDirectory("skins", product_globals)
DirectoryView.registerDirectory("skins/faq", product_globals)


def initialize(context):
    ##Import Types here to register them (were removed by pyflake check!)
    import FAQ
    import FAQQuestion

    content_types, constructors, ftis = process_types(listTypes(PROJECTNAME), PROJECTNAME)

    utils.ContentInit(
        PROJECTNAME + " Content",
        content_types=content_types,
        permission=ADD_CONTENT_PERMISSION,
        extra_constructors=constructors,
        fti=ftis,
    ).initialize(context)
开发者ID:dtgit,项目名称:dtedu,代码行数:29,代码来源:__init__.py

示例9: initialize

# 需要导入模块: from Products.CMFCore import DirectoryView [as 别名]
# 或者: from Products.CMFCore.DirectoryView import registerDirectory [as 别名]
import logging
logger = logging.getLogger('BungeniHelpCenter')
logger.info('Installing Product')

import os, os.path
from Globals import package_home
from Products.CMFCore import utils as cmfutils
from Products.CMFCore import permissions as cmfpermissions
from Products.CMFCore import DirectoryView
from Products.CMFPlone.utils import ToolInit
from Products.Archetypes.atapi import *
from Products.Archetypes import listTypes
from Products.Archetypes.utils import capitalize
from config import *

DirectoryView.registerDirectory('skins', product_globals)
DirectoryView.registerDirectory('skins/bungeni_help_center',
                                    product_globals)

from Products.CMFPlone.interfaces import IPloneSiteRoot
from Products.GenericSetup import EXTENSION, profile_registry
import monkeypatch

def initialize(context):
    ##code-section custom-init-top #fill in your manual code here
    ##/code-section custom-init-top

    # imports packages and types for registration
    import content
    import interfaces
开发者ID:BenoitTalbot,项目名称:bungeni-portal,代码行数:32,代码来源:__init__.py

示例10: Copyright

# 需要导入模块: from Products.CMFCore import DirectoryView [as 别名]
# 或者: from Products.CMFCore.DirectoryView import registerDirectory [as 别名]
# Copyright (c) 2004-2006 by BlueDynamics Alliance - Klein & Partner KEG, Austria
#
# BSD-like licence, see LICENCE.txt
#
import os
from Globals import package_home
from Products.CMFCore import utils as cmfutils
from Products.CMFCore import DirectoryView

from Products.Archetypes.atapi import *
from Products.Archetypes.utils import capitalize
from Products.ATVocabularyManager.config import *
from Products.ATVocabularyManager.namedvocabulary import NamedVocabulary

DirectoryView.registerDirectory(SKINS_DIR, GLOBALS)
DirectoryView.registerDirectory(os.path.join(SKINS_DIR, 'ATVocabularyManager'),
                                GLOBALS)


def initialize(context):
    ##Import Types here to register them
    import types
    import tools
    import utils

    content_types, constructors, ftis = process_types(listTypes(PROJECTNAME),
                                                      PROJECTNAME)

    cmfutils.ToolInit( PROJECTNAME+' Tools',
                tools = [tools.VocabularyLibrary],
                icon='tool.gif'
开发者ID:hermancaldara,项目名称:buildout_portal_iff_plone3,代码行数:33,代码来源:__init__.py

示例11: initialize

# 需要导入模块: from Products.CMFCore import DirectoryView [as 别名]
# 或者: from Products.CMFCore.DirectoryView import registerDirectory [as 别名]
    CustomizationPolicy = None

from Globals import package_home
from Products.CMFCore import utils as cmfutils
from Products.CMFCore import CMFCorePermissions
from Products.CMFCore import DirectoryView
from Products.CMFPlone.utils import ToolInit
from Products.Archetypes.atapi import *
from Products.Archetypes import listTypes
from Products.Archetypes.utils import capitalize

import os, os.path

from Products.SERPROSCWorkflow.config import *

DirectoryView.registerDirectory('skins', product_globals)
DirectoryView.registerDirectory('skins/SERPROSCWorkflow',
                                    product_globals)

##code-section custom-init-head #fill in your manual code here
##/code-section custom-init-head


def initialize(context):
    ##code-section custom-init-top #fill in your manual code here
    ##/code-section custom-init-top

    # imports packages and types for registration
    import content

开发者ID:cislgov,项目名称:cisl.portal.plone25,代码行数:31,代码来源:__init__.py

示例12: MessageFactory

# 需要导入模块: from Products.CMFCore import DirectoryView [as 别名]
# 或者: from Products.CMFCore.DirectoryView import registerDirectory [as 别名]
#Archetypes
from Products.Archetypes.public import *
from Products.Archetypes import listTypes
from Products.Archetypes.utils import capitalize

from zope.i18nmessageid import MessageFactory

ssMessageFactory = MessageFactory('signupsheet')

import os, os.path, sys, content

# Get configuration data, permissions
from Products.SignupSheet.config import *

# Register skin directories so they can be added to portal_skins
DirectoryView.registerDirectory('skins', product_globals)
DirectoryView.registerDirectory('skins/SignupSheet', product_globals)
DirectoryView.registerDirectory('skins/Registrant', product_globals)

def initialize(context):

    # Import the type, which results in registerType() being called
    from content import signupsheet, registrant

    # initialize the content, including types and add permissions
    content_types, constructors, ftis = process_types(
        listTypes(PROJECTNAME),
        PROJECTNAME)

    utils.ContentInit(
        PROJECTNAME + ' Content',
开发者ID:a-pasquale,项目名称:Products.SignupSheet,代码行数:33,代码来源:__init__.py

示例13: initialize

# 需要导入模块: from Products.CMFCore import DirectoryView [as 别名]
# 或者: from Products.CMFCore.DirectoryView import registerDirectory [as 别名]
from Products.Archetypes.public import process_types, listTypes

# Products imports
import config
from Products.PloneArticle.pafti import PloneArticleFactoryTypeInformation
from Products.PloneArticle.pafti import manage_addPAFTIForm
from Products.PloneArticle.pafti import DynamicAllowedContentFTI
from Products.PloneArticle.pafti import manage_addDVTFTIForm

from Products.PloneArticle import content, proxy
from Products.PloneArticle import tool

from Products.PloneArticle import migration

# Register skin directories so they can be added to portal_skins
DirectoryView.registerDirectory('skins', config.GLOBALS)


def initialize(context):
    # Setup migrations
    migration.executeMigrations()
    migration.registerMigrations()

    # optional demo content
    if config.INSTALL_EXAMPLES:
        import examples

    # register the fti
    context.registerClass(
        PloneArticleFactoryTypeInformation,
        permission=ManagePortal,
开发者ID:RedTurtle,项目名称:Products.PloneArticle,代码行数:33,代码来源:__init__.py

示例14: globals

# 需要导入模块: from Products.CMFCore import DirectoryView [as 别名]
# 或者: from Products.CMFCore.DirectoryView import registerDirectory [as 别名]
# -*- extra stuff goes here -*- 
from Products.Archetypes.public import *
from Products.Archetypes import listTypes
from Products.CMFCore import permissions, utils as cmf_utils, DirectoryView

from config import PROJECTNAME, SKINS_DIR
from sys import modules
this_module = modules[ __name__ ]
import utils

ADD_CONTENT_PERMISSION = permissions.AddPortalContent
DirectoryView.registerDirectory(SKINS_DIR, globals())

def initialize(context):
    """ Initializer called when used as a Zope 2 product.
    """
    import contents

    content_types, constructors, ftis = process_types(
        listTypes(PROJECTNAME),
        PROJECTNAME
    )

    allTypes = zip(content_types, constructors)

    for atype, constructor in allTypes:
        kind = "%s: %s" % (PROJECTNAME, atype.archetype_name)
        cmf_utils.ContentInit(
            kind,
            content_types      = (atype,),
            permission         = ADD_CONTENT_PERMISSION,
开发者ID:vwc,项目名称:fv,代码行数:33,代码来源:__init__.py

示例15: MessageFactory

# 需要导入模块: from Products.CMFCore import DirectoryView [as 别名]
# 或者: from Products.CMFCore.DirectoryView import registerDirectory [as 别名]
## CMF imports

from Products.CMFCore.utils import ContentInit
from Products.CMFCore import permissions, DirectoryView
from Products.CMFCore.utils import registerIcon

from zope.i18nmessageid import MessageFactory

PloneGazetteFactory = MessageFactory("plonegazette")

## App imports
from config import PROJECTNAME
from config import product_globals

DirectoryView.registerDirectory("skins", product_globals)
DirectoryView.registerDirectory("skins/PloneGazette", product_globals)


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,
开发者ID:RedTurtle,项目名称:TurtledGazette,代码行数:32,代码来源:__init__.py


注:本文中的Products.CMFCore.DirectoryView.registerDirectory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。