Commit ff86adcc authored by Aurel's avatar Aurel

use and propagate reindex_kw


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@16125 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 44ea0c4c
...@@ -77,7 +77,7 @@ class FolderMixIn(ExtensionClass.Base): ...@@ -77,7 +77,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, **kw): is_indexable=None, temp_object=0, reindex_kw=None, **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.
...@@ -113,6 +113,7 @@ class FolderMixIn(ExtensionClass.Base): ...@@ -113,6 +113,7 @@ class FolderMixIn(ExtensionClass.Base):
id=new_id, id=new_id,
created_by_builder=created_by_builder, created_by_builder=created_by_builder,
activate_kw=activate_kw, activate_kw=activate_kw,
reindex_kw=reindex_kw,
is_indexable=is_indexable is_indexable=is_indexable
) # **kw) removed due to CMF bug ) # **kw) removed due to CMF bug
# TODO :the **kw makes it impossible to create content not based on # TODO :the **kw makes it impossible to create content not based on
...@@ -589,6 +590,10 @@ class Folder( CopyContainer, CMFBTreeFolder, Base, FolderMixIn, WebDAVFolder): ...@@ -589,6 +590,10 @@ class Folder( CopyContainer, CMFBTreeFolder, Base, FolderMixIn, WebDAVFolder):
if activate_kw is None: if activate_kw is None:
activate_kw = {} activate_kw = {}
reindex_kw = self.getDefaultReindexParametersDict()
if reindex_kw is not None:
kw.update(reindex_kw)
group_id_list = [] group_id_list = []
if kw.get("group_id", "") not in ('', None): if kw.get("group_id", "") not in ('', None):
group_id_list.append(kw.get("group_id", "")) group_id_list.append(kw.get("group_id", ""))
......
...@@ -330,10 +330,12 @@ class DocumentConstructor(Method): ...@@ -330,10 +330,12 @@ class DocumentConstructor(Method):
self.klass = klass self.klass = klass
def __call__(self, folder, id, REQUEST=None, def __call__(self, folder, id, REQUEST=None,
activate_kw=None, is_indexable=None, **kw): activate_kw=None, is_indexable=None, reindex_kw=None, **kw):
o = self.klass(id) o = self.klass(id)
if activate_kw is not None: if activate_kw is not None:
o.__of__(folder).setDefaultActivateParameters(**activate_kw) o.__of__(folder).setDefaultActivateParameters(**activate_kw)
if reindex_kw is not None:
o.__of__(folder).setDefaultReindexParameters(**reindex_kw)
if is_indexable is not None: if is_indexable is not None:
o.isIndexable = is_indexable o.isIndexable = is_indexable
folder._setObject(id, o) folder._setObject(id, o)
......
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