Changeset 1250 in products
- Timestamp:
- Aug 18, 2009 4:09:29 PM (15 years ago)
- Location:
- quintagroup.transmogrifier.simpleblog2quills/branches/without_image_move/quintagroup/transmogrifier/simpleblog2quills
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
quintagroup.transmogrifier.simpleblog2quills/branches/without_image_move/quintagroup/transmogrifier/simpleblog2quills/cleaner.py
r1249 r1250 5 5 from collective.transmogrifier.interfaces import ISection 6 6 7 from Acquisition import aq_inner, aq_parent 7 from zExceptions import BadRequest 8 from Acquisition import aq_inner, aq_parent, aq_base 8 9 from Products.CMFCore import utils 9 10 … … 30 31 """ 31 32 entry = aq_inner(entry) 32 ids = entry.contentValues() 33 ids = entry.contentIds() 34 parent = aq_parent(entry) 33 35 34 log.info('Moving from %s BlogEntry next object: %s' % (entry.getId(), ids)) 35 copy_data = entry.manage_cutObjects(ids) 36 parent = aq_parent(entry) 37 # xxx: next method call raises exception 38 parent.manage_pasteObjects(copy_data) 36 log.info('Moving from %s BlogEntry next objects: %s' % ('/'.join(entry.getPhysicalPath()), ids)) 37 for obj_id in ids: 38 obj = entry._getOb(obj_id) 39 entry._delObject(obj_id, suppress_events=True) 40 obj = aq_base(obj) 41 new_id = self.generateId(parent, obj_id) 42 if new_id != obj_id: 43 log.info('Changing id from %s to %s' % (obj_id, new_id)) 44 obj._setId(new_id) 45 try: 46 parent._setObject(new_id, obj, set_owner=0, suppress_events=True) 47 except BadRequest, e: 48 log.error(e) 49 50 def generateId(self, folder, id_): 51 c = 1 52 existing = folder.objectIds() 53 new_id = id_ 54 while True: 55 if id_ in existing: 56 id_ = new_id + str(c) 57 c += 1 58 else: 59 return new_id 39 60 40 61 def getNotEmptyEntries(self): -
quintagroup.transmogrifier.simpleblog2quills/branches/without_image_move/quintagroup/transmogrifier/simpleblog2quills/export.cfg
r1249 r1250 1 1 [transmogrifier] 2 2 pipeline = 3 #blogentrycleaner3 blogentrycleaner 4 4 sitewalker 5 5 condition … … 14 14 EXPORTING 15 15 16 # this section isn't ready17 16 [blogentrycleaner] 18 17 blueprint = quintagroup.transmogrifier.simpleblog2quills.blogentrycleaner … … 36 35 [propertiesexporter] 37 36 blueprint = quintagroup.transmogrifier.propertiesexporter 38 exclude = title 37 exclude = 38 title 39 layout 39 40 40 41 [commentsexporter]
Note: See TracChangeset
for help on using the changeset viewer.