本文整理汇总了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
示例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)
示例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)
示例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
示例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
示例6: _checkId
def _checkId(self, id, allow_dup=0):
PortalFolder._checkId(self, id, allow_dup)
BTreeFolder2Base._checkId(self, id, allow_dup)
示例7: __init__
def __init__(self, id, title=''):
PortalFolder.__init__(self, id, title)
BTreeFolder2Base.__init__(self, id)
示例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)
示例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)
示例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)