== Convertire un contenttype in un altro == Per convertire un contenttype in un altro contentype: - creare uno script in zmi N.B.: lo script seguente prende PloneExFile come source_contenttype (caso particolare per vecchio plone2.5.5 che usa RelStorage) {{{ from Products.PythonScripts.standard import html_quote request = container.REQUEST response = request.response source_contenttype = 'PloneExFile' target_contenttype = 'File' source_folder = context.home.verbali destination_folder = source_folder.esportare items = source_folder.listFolderContents( contentFilter={"portal_type": source_contenttype}) for item in items: id = item.getId() title = item.Title() description = item.Description() service = destination_folder.invokeFactory(target_contenttype, id, title=title, description=description) obj=destination_folder[id] obj.setFile(item.getFile()) print 'fatto' return printed }}} {{{ Se si migrano file da un plone < 4.x: 1) dopo aver importato lo .zexp in plone4 2) apriamo la cartella migrata, si ottiene un errore (....azzzz) 2) dalla root del portale @@migrate-btrees 3) clear and rebuild del catalog 4) @@blob-file-migration (converte in blob) }}}