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


Python PortalFolder.PortalFolder类代码示例

本文整理汇总了Python中Products.CMFCore.PortalFolder.PortalFolder的典型用法代码示例。如果您正苦于以下问题:Python PortalFolder类的具体用法?Python PortalFolder怎么用?Python PortalFolder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: _makeFolder

def _makeFolder(id, site_folder=False):
    from Products.CMFCore.PortalFolder import PortalFolder
    from Products.CMFCore.TypesTool import TypesTool
    from Products.CMFCore.tests.base.dummy import DummyType

    class _TypeInfo(DummyType):
        def _getId(self):
            return self._id
        def constructInstance(self, container, id, *args, **kw):
            portal_type = self._getId()
            if portal_type == TEST_FOLDER:
                content = PortalFolder(id)
            elif portal_type == TEST_CONTENT:
                content = _makeItem()
                content._setId(id)
            elif portal_type == TEST_INI_AWARE:
                content = _makeINIAware(id)
            elif portal_type == TEST_CSV_AWARE:
                content = _makeCSVAware(id)
            else:
                raise ValueError, 'Ugh'
            content.portal_type = portal_type
            container._setObject(id, content)
            return container._getOb(id)

    folder = PortalFolder(id)
    folder.portal_type = TEST_FOLDER
    if site_folder:
        tool = folder.portal_types = TypesTool()
        tool._setObject(TEST_CSV_AWARE, _TypeInfo(TEST_CSV_AWARE))
        tool._setObject(TEST_INI_AWARE, _TypeInfo(TEST_INI_AWARE))
        tool._setObject(TEST_CONTENT, _TypeInfo(TEST_CONTENT))
        tool._setObject(TEST_FOLDER, _TypeInfo(TEST_FOLDER))

    return folder
开发者ID:goschtl,项目名称:zope,代码行数:35,代码来源:test_content.py

示例2: manage_beforeDelete

 def manage_beforeDelete(self, item, container):
     " Remove self from the workflow and catalog. "
     # We don't call PortalContent.manage_beforeDelete because
     #  it deals with talkbacks which are subobjects...
     # Remove self from catalog
     if aq_base(container) is not aq_base(self):
         self.unindexObject()
     # Then recurse in the children (ObjectManager)
     PortalFolder.manage_beforeDelete(self, item, container)
开发者ID:BackupTheBerlios,项目名称:plonenewsletter,代码行数:9,代码来源:Publication.py

示例3: constructInstance

 def constructInstance(self, container, id, *args, **kw):
     portal_type = self._getId()
     if portal_type == TEST_FOLDER:
         content = PortalFolder(id)
     elif portal_type == TEST_CONTENT:
         content = _makeItem()
         content._setId(id)
     elif portal_type == TEST_INI_AWARE:
         content = _makeINIAware(id)
     elif portal_type == TEST_CSV_AWARE:
         content = _makeCSVAware(id)
     else:
         raise ValueError, 'Ugh'
     content.portal_type = portal_type
     container._setObject(id, content)
     return container._getOb(id)
开发者ID:goschtl,项目名称:zope,代码行数:16,代码来源:test_content.py

示例4: getSyndicatableContent

 def getSyndicatableContent(self, obj):
     """
     An interface for allowing folderish items to implement an equivalent of PortalFolder.contentValues()
     """
     if hasattr(obj, 'synContentValues'):
         values = obj.synContentValues()
     else:
         values = PortalFolder.contentValues(obj)
     return values
开发者ID:goschtl,项目名称:zope,代码行数:9,代码来源:SyndicationTool.py

示例5: _ensurePath

def _ensurePath( site, path ):
    """
        Ensure that 'path' exists within 'site';  return the folder
        at the end of 'path'.
    """
    if not path:
        return site

    if type( path ) is type( '' ):
        path = string.split( path, '/' )

    base = site

    for element in path:

        if element not in base.objectIds():
            folder = PortalFolder( element )
            folder._added_by_FT = 1
            base._setOb( element, folder )
    
        base = base._getOb( element )

    return base
开发者ID:goschtl,项目名称:zope,代码行数:23,代码来源:scaffolding.py

示例6: _checkId

 def _checkId(self, id, allow_dup=0):
     PortalFolder._checkId(self, id, allow_dup)
     BTreeFolder2Base._checkId(self, id, allow_dup)
开发者ID:eaudeweb,项目名称:naaya,代码行数:3,代码来源:CMFBTreeFolder.py

示例7: __init__

 def __init__(self, id, title=''):
     PortalFolder.__init__(self, id, title)
     BTreeFolder2Base.__init__(self, id)
开发者ID:eaudeweb,项目名称:naaya,代码行数:3,代码来源:CMFBTreeFolder.py

示例8: manage_beforeDelete

 def manage_beforeDelete(self, item, container):
     """ Remove self from the workflow and catalog. """
 	if aq_base(container) is not aq_base(self):
         self.unindexObject()
     PortalFolder.manage_beforeDelete(self, item, container)
开发者ID:BackupTheBerlios,项目名称:plonenewsletter,代码行数:5,代码来源:Newsletter.py

示例9: manage_afterAdd

 def manage_afterAdd(self, item, container):
      """ Add self to the workflow and catalog. """
      PortalFolder.manage_afterAdd(self, item, container)
      PortalContent.manage_afterAdd(self, item, container)
开发者ID:BackupTheBerlios,项目名称:plonenewsletter,代码行数:4,代码来源:Newsletter.py

示例10: manage_afterAdd

 def manage_afterAdd(self, item, container):
     " Add self to the workflow and catalog. "
     # Recurse in the children (ObjectManager)
     PortalFolder.manage_afterAdd(self, item, container)
     # Add self to workflow and catalog
     PortalContent.manage_afterAdd(self, item, container)
开发者ID:BackupTheBerlios,项目名称:plonenewsletter,代码行数:6,代码来源:Publication.py


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