Personal tools
You are here: Home Comunità zopemaster's Home archivio 2009 11 Migration from Quills to standard News Item

Daniele Paganelli


alias mythsmith

  • Blog
  • Feed RSS
    Iscriviti al diario, con il feed RSS (?)
  • Emopiano
    Imporvvisazioni al pianoforte ed alla tastiera (del computer :)
  • Università
    Documenti redatti per/a/con l'Università
  • Programmazione
    La mia limitata biblioteca personale di script, principalmente in Python.
  • Macropost
    Testi molto lunghi, inadatti per il blog.
  • Segnalibri
    I miei segnalibri direttamente da Firefox... quando mi ricordo di aggiornarli!

Sinapsi

  • AGESCI zona di Modena
    (curato da me, si nota? ;-)
  • Magnatune
    Etichetta discografica online. Musica di alta qualità con licenza CreativeCommons. Anteprime gratuite e complete di qualsiasi album... Attenzione: rischi di non uscirne più fuori!!!
  • Conoscere Linux
    Il Linux User Group di Modena, cui sono associato dalla fondazione.
  • Slack.it
    Wiki di un amico...
  • Punto Informatico
    I miei inutili interventi sulla rivista online più antica d'italia...
  • Oblivion999
    Un gruppo metal
  • Laboratorio Caffeina
    Brainstorming sul web e sulle sue tecnologie



Contatti Personali:
  • Jabber: dapa@jabber.org
    Per accedere alla rete Jabber usa Gaim oppure Google Talk
  • Posta: daniele.chioccia.modena1.it
  • OpenWengo: paganoide
  • Perché evito MSN?
 
Document Actions

Migration from Quills to standard News Item

by mythsmith last modified 2010-01-26 11:43 AM

The Quills blogging product for Plone, former Daily Indigest foundation , seems no longer developed. I need to upgrade my Plone installation, so today I converted all my WeblogEntry's to News Item content types. How did I do?

Migration from Quills to standard News Item

Quills blogging for Plone

First of all, I created an old_blog folder where to store migrated content. I intend to create new object keeping old ones as references.

Quills blog post are registered as "WeblogEntry" portal types. So I got all these posts by searching the portal_catalog for portal_type="WeblogEntry".

Once I have this entries list, I can iterate over each element, create a new "News Item" object in the old_blog (context) directory, and fill it with original metadata.

In addition to standard object properties like id, Title, Description, Creation/Effective/ModificationDate, WeblogEntry store its content inside a Text or RawText field. You can verify this by yourself by typing http://...WeblogEntry addrr.../getRawText in a browser. So we now have almost complete access to WeblogEntry data. I will discart Subject (topics) and comments. Not a big loss for me!

Last but not least, the object must be re-indexed in the plone site catalog.

# -*- coding: utf-8 -*-
"""Quills to NewsItem migration script
mythsmith 11/2009"""

request = container.REQUEST
RESPONSE = request.RESPONSE

# List all legacy WeblogEntry objects:
entries=context.portal_catalog.searchResults(
portal_type="WeblogEntry")

for et in entries:
obj=et.getObject()
print obj.id

# Create the newsitem object
context.invokeFactory(
type_name="News Item",
id=obj.id,title=obj.Title())
# Find the new object
nobj = getattr(context,obj.id)
# Set its format, content and description
nobj.setTitle(obj.Title())
nobj.setFormat('text/html')
nobj.setText(obj.getRawText())
nobj.setDescription(obj.Description())
nobj.setModificationDate(obj.modified())
nobj.setEffectiveDate(obj.effective())
nobj.setCreationDate(obj.created())
nobj.indexObject()
return printed

Finally I can uninstall Quills!


hosting
Iniziative che sponsorizziamo:
Scopri altri siti scout!
Sito precedente 5o sito precedente Home ScoutRing Lista dei Siti Sito Casuale Sito successivo 5o sito successivo
Informati e protesta contro il DRM!
Powered by Plone, the Open Source Content Management System