Import contents & keywords with generic setup

Ecrit le 17 Nov 2009

I really like generic setup to build plone instance.

But, I was not able to do some things like setup contents (folders for structure, documents to make some example pages, …), keywords and portlets.

Note: The default import structure step of Plone doesn’t do enought things for me, and I find it hard to use. So I have contributed to some third part modules:

CSVReplicata

csvreplicata first give you a way to import/export content within the csv file format. So you can import/export atcontent types (and more) with it. I have added a csvimportStep to be able to use it with genericsetup:

def importcsvStep(context):
    """This step give you a way to import content in your website with
    csvreplicata.

    How it works:
    read replicata.cfg file to load configuration

    read replicata.csv and call csvreplicata with the config.

    Config:
    [replicable_types]
    #List schemata for each types you want to import
    #Folder : default, categorization, dates, ownership, settings
    #News Item : default

    Document: default

    [settings]
    #list here every csv settings that will be given to replicator.importcsv
    encoding:utf-8
    delimiter:,
    stringdelimiter:"
    datetimeformat:%d/%m/%Y
    wf_transition = publish
    conflict_winner:SERVER

    """

So you just have to drop replicata.csv and replicata.cfg files in your profile to be able to import contents in your Plone site. An other way of doing, is to create the content with Plone, then export it, and save the file in your profile.

PloneKeywordManager

I have done the same with PloneKeywordManager. There is a new import step named ‘keywords’. It reads a ‘keywords.txt’ file in the current profile, it creates a document called ‘keywords’. The file must have one keyword per line. It is simple and it works.

Note: To use this you need to use the svn collective trunk version at the moment but they will be released soon.

Portlet ?

Now I m trying to make the same thing with portlets but I don’t have any idea how to do this. If any one has ideas about this, please mail me, I would be glade to implement it !