From: <mag...@us...> - 2003-02-21 11:52:27
|
Update of /cvsroot/plone/CMFPlone/skins/plone_3rdParty/CMFWeblog In directory sc8-pr-cvs1:/tmp/cvs-serv27633/skins/plone_3rdParty/CMFWeblog Modified Files: blogEntryConvert.py Log Message: DOS ^M Index: blogEntryConvert.py =================================================================== RCS file: /cvsroot/plone/CMFPlone/skins/plone_3rdParty/CMFWeblog/blogEntryConvert.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** blogEntryConvert.py 28 Oct 2002 23:21:51 -0000 1.2 --- blogEntryConvert.py 21 Feb 2003 11:52:22 -0000 1.3 *************** *** 1,34 **** ! import string ! catalog = context.portal_catalog ! # get all blog entry catalog records ! blogRec = catalog(Type='Blog Entry') ! for blogEntry in blogRec: ! # get entry database object, parent folder, entry source and metadata ! entryObject = blogEntry.getObject() ! entryId = entryObject.getId() ! entryCreated = entryObject.created() ! entryFormat = entryObject.Format() ! parent = entryObject.aq_parent ! src = entryObject.EditableBody() ! wf_state = context.portal_workflow.getInfoFor(entryObject,'review_state','') ! headers = {} ! for data in entryObject.getMetadataHeaders(): ! if not data[0].lower() in ['title', 'subject', 'description,contributors' ! ,'effective_date', 'expiration_date', 'format' ! , 'languag', 'rights']: continue ! headers[data[0].lower()] = data[1] or '' ! #delete old object and create a new weblog entry with old values ! print 'deleting Blog Entry %s' % entryId ! parent.manage_delObjects(entryObject.getId()) ! print 'creating Weblog Entry %s' % entryId ! parent.invokeFactory('Weblog Entry',entryId) ! weblogObject = parent[entryId] ! weblogObject.setDate(entryCreated) ! weblogObject.edit(entryFormat,src) ! weblogObject.editMetadata(**headers) ! if wf_state == 'published': ! context.portal_workflow.doActionFor(weblogObject, 'publish') ! print 'republishing %s' % entryId ! return printed ! ! --- 1,34 ---- ! import string ! catalog = context.portal_catalog ! # get all blog entry catalog records ! blogRec = catalog(Type='Blog Entry') ! for blogEntry in blogRec: ! # get entry database object, parent folder, entry source and metadata ! entryObject = blogEntry.getObject() ! entryId = entryObject.getId() ! entryCreated = entryObject.created() ! entryFormat = entryObject.Format() ! parent = entryObject.aq_parent ! src = entryObject.EditableBody() ! wf_state = context.portal_workflow.getInfoFor(entryObject,'review_state','') ! headers = {} ! for data in entryObject.getMetadataHeaders(): ! if not data[0].lower() in ['title', 'subject', 'description,contributors' ! ,'effective_date', 'expiration_date', 'format' ! , 'languag', 'rights']: continue ! headers[data[0].lower()] = data[1] or '' ! #delete old object and create a new weblog entry with old values ! print 'deleting Blog Entry %s' % entryId ! parent.manage_delObjects(entryObject.getId()) ! print 'creating Weblog Entry %s' % entryId ! parent.invokeFactory('Weblog Entry',entryId) ! weblogObject = parent[entryId] ! weblogObject.setDate(entryCreated) ! weblogObject.edit(entryFormat,src) ! weblogObject.editMetadata(**headers) ! if wf_state == 'published': ! context.portal_workflow.doActionFor(weblogObject, 'publish') ! print 'republishing %s' % entryId ! return printed ! ! |