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): ...@@ -108,8 +108,7 @@ class Domain(Predicate, MetaNode, MetaResource):
We need a way to know how deep we are in the domain generation We need a way to know how deep we are in the domain generation
to prevent infinite recursion XXX not implemented to prevent infinite recursion XXX not implemented
""" """
klass = tmp_domain_generator = self.newContent( klass = tmp_domain_generator = self.newContent(portal_type='Domain Generator', temp_object=1)
portal_type='Domain Generator', temp_object=1, filter_content_types=0)
script = self.getDomainGeneratorMethodId('') script = self.getDomainGeneratorMethodId('')
return tmp_domain_generator.getDomainGeneratorList(depth=depth, klass=klass, script=script, parent=self) return tmp_domain_generator.getDomainGeneratorList(depth=depth, klass=klass, script=script, parent=self)
...@@ -118,8 +117,7 @@ class Domain(Predicate, MetaNode, MetaResource): ...@@ -118,8 +117,7 @@ class Domain(Predicate, MetaNode, MetaResource):
""" """
We generate temp domain here because we must set an aquisition wrapper We generate temp domain here because we must set an aquisition wrapper
""" """
domain = self.newContent(id=id, portal_type='Domain', domain = self.newContent(id=id, portal_type='Domain', temp_object=1)
temp_object=1, filter_content_types=0)
return domain.__of__(self) return domain.__of__(self)
def getChildDomainValueList(self, parent = None, **kw): def getChildDomainValueList(self, parent = None, **kw):
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
</portal_type> </portal_type>
<portal_type id="Base Domain"> <portal_type id="Base Domain">
<item>Domain</item> <item>Domain</item>
<item>Domain Generator</item>
</portal_type> </portal_type>
<portal_type id="Cache Factory"> <portal_type id="Cache Factory">
<item>Ram Cache</item> <item>Ram Cache</item>
......
847 848
\ No newline at end of file \ No newline at end of file
...@@ -2,6 +2,7 @@ Alarm Tool | Alarm ...@@ -2,6 +2,7 @@ Alarm Tool | Alarm
Applied Rule | Simulation Movement Applied Rule | Simulation Movement
Base Category | Category Base Category | Category
Base Domain | Domain Base Domain | Domain
Base Domain | Domain Generator
Cache Factory | Distributed Ram Cache Cache Factory | Distributed Ram Cache
Cache Factory | Ram Cache Cache Factory | Ram Cache
Cache Factory | SQL Cache Cache Factory | SQL Cache
......
...@@ -111,8 +111,7 @@ class FolderMixIn(ExtensionClass.Base): ...@@ -111,8 +111,7 @@ class FolderMixIn(ExtensionClass.Base):
def newContent(self, id=None, portal_type=None, id_group=None, def newContent(self, id=None, portal_type=None, id_group=None,
default=None, method=None, immediate_reindex=0, default=None, method=None, immediate_reindex=0,
container=None, created_by_builder=0, activate_kw=None, container=None, created_by_builder=0, activate_kw=None,
is_indexable=None, temp_object=0, reindex_kw=None, is_indexable=None, temp_object=0, reindex_kw=None, **kw):
filter_content_types=1, **kw):
"""Creates a new content. """Creates a new content.
This method is public, since TypeInformation.constructInstance will perform This method is public, since TypeInformation.constructInstance will perform
the security check. the security check.
...@@ -135,7 +134,7 @@ class FolderMixIn(ExtensionClass.Base): ...@@ -135,7 +134,7 @@ class FolderMixIn(ExtensionClass.Base):
# XXX This feature is very confusing # XXX This feature is very confusing
# And made the code more difficult to update # And made the code more difficult to update
portal_type = container.allowedContentTypes()[0].id portal_type = container.allowedContentTypes()[0].id
elif filter_content_types: else:
type_info = pt.getTypeInfo(container) type_info = pt.getTypeInfo(container)
if type_info is not None and not type_info.allowType(portal_type) and \ if type_info is not None and not type_info.allowType(portal_type) and \
'portal_trash' not in container.getPhysicalPath(): '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