[zopeorg-checkins] CVS: Products/ZopeOrg-NV/Extensions - NZOMigrate.py:1.32 synchronizeSkeleton.py:1.30
Sidnei da Silva
sidnei at x3ng.com.br
Mon Jun 16 16:32:43 EDT 2003
Update of /cvs-zopeorg/Products/ZopeOrg-NV/Extensions
In directory cvs.zope.org:/tmp/cvs-serv14099/Extensions
Modified Files:
NZOMigrate.py synchronizeSkeleton.py
Log Message:
Improving migration and skeleton sync
=== Products/ZopeOrg-NV/Extensions/NZOMigrate.py 1.31 => 1.32 ===
assignees=assignees)
except WorkflowException:
pass # Leave as is. Probably pending.
-
+
new_status = issue.status().split('_')[0]
transcript = issue.get_transcript()
@@ -381,7 +381,7 @@
udb = None
if new_uid != uid:
while p is not None:
- if hasattr(p, 'acl_users'):
+ if hasattr(aq_base(p), 'acl_users'):
acl_users = getattr(p, 'acl_users')
try:
user = acl_users.getUserById(new_uid).__of__(acl_users)
@@ -391,7 +391,7 @@
# Found the right database.
udb = acl_users.getPhysicalPath()[1:]
break
- p = aq_parent(aq_inner(p))
+ p = aq_parent(aq_inner(p))
if udb is not None:
ob.changeOwnership(user)
#log('Changed ownership of %s from %s!%s to %s!%s.\n' %
@@ -1141,6 +1141,7 @@
dest = self._dest
ignore = self._ignore_path
source_id = source.getId()
+ p_cat = getToolByName(dest, 'portal_catalog')
if hasattr(source, 'objectIds') and \
hasattr(source, 'getPhysicalPath'):
path = source.getPhysicalPath()
@@ -1151,6 +1152,9 @@
oids.remove('acl_users')
oids.insert(0, 'acl_users')
for oid in oids:
+ if oid in p_cat.schema() or oid in p_cat.indexes():
+ self.log('Oid %s at %s conflicts with catalog schema or index name.\n' % (oid, '/'.join(path)))
+ continue
obj_path = list(path[:])
obj_path.append(oid)
obj_url = '/'.join(obj_path)
@@ -1201,7 +1205,7 @@
# maybe-not-object. eg: we acquired the 'view' method
self.log('New object is invalid. Probably acquired by mistake. %r.\n' % new_obj)
continue
-
+
if new_obj is None:
self.log('Invalid object found when migrating: %s.\n' % obj_url)
continue
=== Products/ZopeOrg-NV/Extensions/synchronizeSkeleton.py 1.29 => 1.30 ===
, comment=''
)
obj.reindexObject()
+ elif f_ext == '.cl':
+ container_obj.invokeFactory(id=f_name, type_name='Content List')
+ obj = getattr(container_obj, f_name)
+ from Products.CMFContentList.tests.test_getput import FakeRequest, FakeResponse
+ obj.PUT(FakeRequest({'BODY':f_data}), FakeResponse())
+ wf_tool = getattr(container_obj, 'portal_workflow')
+ wf_objs = wf_tool.getWorkflowsFor(obj)
+ for wf_obj in wf_objs:
+ wf_obj.setReviewStateOf(ob=obj
+ , review_state='published'
+ , action='publish'
+ , comment=''
+ )
+ obj.reindexObject()
def _getProps( path ):
More information about the zopeorg-checkins
mailing list