Attention

This document was written for an old version of Plone, Plone 2.5.x, and was last updated 898 days ago.

To learn how to upgrade to the current version of Plone, read the upgrade manual.

Using gsxml to fill your site with test data

by steveyken last modified Dec 06, 2009 09:27 PM
When developing a plone site, its often useful to populate it with data in order to test it in a 'real' environment. Some sites contain complex data dependencies, which can take a long time to set up. This how-to describes one way of using gsxml to quickly refresh a site by deleteing and importing fresh data.

 

Introduction

Creating a good 'publicly' viewable set of test content data in plone can be time-consuming and extremely detailed. Using GSXML you can take away the pain of recreating test data each time and simply import your Plone or custom content from a tar archive file or set of xml files.

 

You can also create several different sets of test data. Enabling you to have a 'preview' set to populate in your public test site for clients to see and your 'development' test data that covers a lot more...

 

Before you get started below, you'll need to download and install GSXML from here

and follow the installation procedure it describes. The project homepage has detailed instructions for how to do this.

 

In one site that we recently prepared, we had a data with a lot of references.

 

Background

GSXML makes heavy use of the component architecture in Zope3. The Marshall products transforms objects into a xml representations and Generic Setup governs the export/import process. GSXML wraps components from both of these products together to generate a simple import/export process for Archetype-based content. Its works out of the box for the default plone types and can easily be extended to work with your own content types (see below).

 

 

Exporting your data

 

Plone content

 

Custom content

 

Which archetypes fields does it work for?

The standard References and Images as well as the other standard archetype fields work ok and we also have it working fine with archetypes using FileStorage fields. The file saved along with the xml and imported as required.

 

But in the days of Zope3 development, support for annotations and marker interfaces is necessary. These features haven't been developed yet (its only up to alpha 0.4.1) but I'm assured it is planned.

 

 

 

 

  • Pre-amble
  • Pre-requisits: gsxml installed
  • Creating test data
  • Exporting data
  • Importing data for testing
  • Appendix 1: Marking custom archetype content as

Contribute

Something wrong or out of date? Anybody can edit or create a new article in the knowledge base. Simply create an account on this site, log in, and click the Edit button to contribute.