Sample data create and import: Difference between revisions

From OpenPetra Wiki
Jump to navigation Jump to search
Line 28: Line 28:
  nant generateDemodata
  nant generateDemodata


This should create csv files containing sample data in the directory <code>demodata\generated<code>: "People.csv","Addresses.csv","Organisations.csv".
This should create csv files containing sample data in the directory <code>demodata\generated</code>: "People.csv","Addresses.csv","Organisations.csv".


=== Running Sample Data Constructor ===
=== Running Sample Data Constructor ===


The Sample Data Constructor assembles the raw data, and saves it onto the Petra Server. It requires raw sample data files ("People.csv","Addresses.csv","Organisations.csv") to be in the directory <code>demodata\generated<code>.  
The Sample Data Constructor assembles the raw data, and saves it onto the Petra Server. It requires raw sample data files ("People.csv","Addresses.csv","Organisations.csv") to be in the directory <code>demodata\generated</code>.  


To run the Sample Data Constructor, run:
To run the Sample Data Constructor, run:

Revision as of 07:32, 25 November 2011

Overview

Goal: creating sample data for the database.

The sample data should have

  • many donors
  • many recipients
  • many donations

Data creation and import is done in a two step process:

alt This diagram shows the data flow of created sample data from benedata benerator into the sample data constructor and the into OpenPetra Server

  1. The 3rd-party data creation tool databene benerator creates raw data (names, addresses, phone numbers...)
  2. The OpenPetra SampleDataConstructor-tool is specifically built to take this data, assemble, and import it into OpenPetra

Related Bugtracking-Issues

Running Sample Data Constructor

Creation of raw sample data and assembling this into the database are two separate steps which can be executed with nant:

Creating Raw Sample Data

The following assumes that databene benerator is installed and functioning (see below on how to do this). If it is not installed, you may skip this step if you already have working sample data csv-files.

Creating Raw Sample Data with Benerator

To start the generation of data, run:

nant generateDemodata

This should create csv files containing sample data in the directory demodata\generated: "People.csv","Addresses.csv","Organisations.csv".

Running Sample Data Constructor

The Sample Data Constructor assembles the raw data, and saves it onto the Petra Server. It requires raw sample data files ("People.csv","Addresses.csv","Organisations.csv") to be in the directory demodata\generated.

To run the Sample Data Constructor, run:

nant importDemodata

After having run the sample data constructor, you can access the created data from the OpenPetra Client.

Current State

  • names and addresses are created, and assembled
  • putting these into the OpenPetra database is in progress (hopefully nearly finished)
  • creating donations is not done yet

Steps:

  1. create raw data as csv files (sufficiently complete!) -- done
  2. import and put together raw data in SampleDataConstructor (for creating relationships) -- nearly done
  3. connect to petra server from temporary program, assemble data as OpenPetra TDS, save -- in progress

Additionally:

  1. create nant job to import data

Installing third party software

Currently the only external software used is Benedata Benerator for creation of the raw data, but this in turn requires the java runtime enviroment.

Java

  • Required: Java Runtime Environment only

Abridged Instructions

PATH = ....; "C:\Program Files (x86)\Java\jre6\bin"

  • Give it a quick test by opening a new command prompt / terminal and typing:

java -version

Example output:

java version "1.6.0_25"
Java(TM) SE Runtime Environment (build 1.6.0_25-b06)
Java HotSpot(TM) Client VM (build 20.0-b11, mixed mode, sharing)

Databene Benerator


  • Download the Benerator distribution from SourceForge
  • Unzip into Program files (e.g. C:\Program Files\databene-benerator-0.7.1)
  • nant should pick that version up, otherwise you need to add to your OpenPetra.build.config:
<property name="external.Benerator" value="${OP::GetFileInProgramDirectory('/databene-benerator-0.7.1/bin/benerator.bat')}"/>

See also