Commit 2595ae93 authored by Julien Muchembled's avatar Julien Muchembled

temp objects:

 * drop filter_content_types parameter of Folder.newContent
 * revert previous patch to ERP5/Document/Domain.py
 * add 'Domain Generator' to allowed content types of 'Base Domain'

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@21596 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2ba10a48
......@@ -108,8 +108,7 @@ class Domain(Predicate, MetaNode, MetaResource):
We need a way to know how deep we are in the domain generation
to prevent infinite recursion XXX not implemented
"""
klass = tmp_domain_generator = self.newContent(
portal_type='Domain Generator', temp_object=1, filter_content_types=0)
klass = tmp_domain_generator = self.newContent(portal_type='Domain Generator', temp_object=1)
script = self.getDomainGeneratorMethodId('')
return tmp_domain_generator.getDomainGeneratorList(depth=depth, klass=klass, script=script, parent=self)
......@@ -118,8 +117,7 @@ class Domain(Predicate, MetaNode, MetaResource):
"""
We generate temp domain here because we must set an aquisition wrapper
"""
domain = self.newContent(id=id, portal_type='Domain',
temp_object=1, filter_content_types=0)
domain = self.newContent(id=id, portal_type='Domain', temp_object=1)
return domain.__of__(self)
def getChildDomainValueList(self, parent = None, **kw):
......
......@@ -10,6 +10,7 @@
</portal_type>
<portal_type id="Base Domain">
<item>Domain</item>
<item>Domain Generator</item>
</portal_type>
<portal_type id="Cache Factory">
<item>Ram Cache</item>
......
847
\ No newline at end of file
848
\ No newline at end of file
......@@ -2,6 +2,7 @@ Alarm Tool | Alarm
Applied Rule | Simulation Movement
Base Category | Category
Base Domain | Domain
Base Domain | Domain Generator
Cache Factory | Distributed Ram Cache
Cache Factory | Ram Cache
Cache Factory | SQL Cache
......
......@@ -111,8 +111,7 @@ class FolderMixIn(ExtensionClass.Base):
def newContent(self, id=None, portal_type=None, id_group=None,
default=None, method=None, immediate_reindex=0,
container=None, created_by_builder=0, activate_kw=None,
is_indexable=None, temp_object=0, reindex_kw=None,
filter_content_types=1, **kw):
is_indexable=None, temp_object=0, reindex_kw=None, **kw):
"""Creates a new content.
This method is public, since TypeInformation.constructInstance will perform
the security check.
......@@ -135,7 +134,7 @@ class FolderMixIn(ExtensionClass.Base):
# XXX This feature is very confusing
# And made the code more difficult to update
portal_type = container.allowedContentTypes()[0].id
elif filter_content_types:
else:
type_info = pt.getTypeInfo(container)
if type_info is not None and not type_info.allowType(portal_type) and \
'portal_trash' not in container.getPhysicalPath():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment