You are here: Home Tech Create Plone Initial Content with Generic Setup

Create Plone Initial Content with Generic Setup

by Chris Shenton last modified Aug 18, 2009 01:12 AM
It seems like it's almost easy but there's too many missing pieces of info. Perhaps this will contribute to the discussion. This is on Plone-3.3rc4.

Initial Content Wanted

I have a site that I want to populate with some initial content: some folders, some pages, some collections. Oh, and I want to have them in the "published" workflow state.

It ain't as easy as it should be

This page describes how to create folders but doesn't address workflow. 

I tried creating a simple page (plone "Document" content type) and then using GenericSetup "diff" to compare what was different from the initial snapshot I took. It was not informative until I enabled the " Treat missing files as empty" checkbox, then it showed nearly everything I needed.

I tried GenericSetup "Export" tab and selected only "Content" but that produced -- repeatably -- corrupted tar.gz files which were useless.

I installed GSXML and can select a content type then Actions -> Export and that works rather well, but it produces XML and Pickle files which are nothing like I find I need for Generic Setup profiles.

Working now: Folder, Document

Here's a file layout you can put under your product's profiles/default/ directory which will create a Folder and a Document with some content. These content items will be named "blog" (Folder) and "page-sample" (Document). The names in the .objects and .preserve file must match the directory and file names containing the information about each. The .preserve file indicates what not to leave alone if it already exists on the site.

structure/.objects

blog,Folder
page-sample,Document

structure/.preserve

blog
page-sample

structure/blog/.properties

[DEFAULT]
title = Blog
description = Much ado about blogging.

structure/page-sample

id: page-sample
title: page sample
description: sample this page
subject: 
relatedItems: 
location: 
language: 
effectiveDate: 2009/08/17 23:16:27.120 GMT-4
expirationDate: None
creation_date: 2009/08/17 23:16:19.956 GMT-4
modification_date: 2009/08/17 23:16:27.120 GMT-4
creators: admin
contributors: 
rights: 
allowDiscussion: False
excludeFromNav: False
presentation: False
tableContents: False
Content-Type: text/html


<h2>I'm a lowly Page</h2>
<p>Some day I hope to be a King.</p>

You can define just the 'title' and 'description' attributes, but it's good to know what attributes you can set.

To be done

How do I set their workflow state to "published" instead of the initial "private" state?

How do I add Collections (Smart Folders)? I can create an .objects entry

blog-collection,Topic

but don't know how or where to specify the criteria (type=Document, Location=blog) that's needed to instantiate this.

Share this: