A Step-by-Step Guide to Starting a new Database Publishing Project
  4D cross platform software application development

 

  1. Planning the structure of your database
  2. How to create a new database
  3. The Form Design Wizard - designing your data entry forms
  4. Getting data into your database - Import it, or add it manually
  5. Managing the List Views - viewing lists of your data
  6. Publishing Your Data - the fun part!

Planning the structure of your database

The first thing you need to do is decide on how you're going to structure your database. If you are not familiar with databases and how they work, please read our Database 101 tutorial before you start. If you're not sure what fields, tables, and records are, this is definitely recommended reading!

Read the Table Structure Tutorial to find out about the tables in CatBase and work out the best way to set yours up.

Once you've decided on the structure of your data, you're ready to set it up.

How to create a new database

The procedure for creating a new database is slightly different depending on whether you are using CatBase Single-User or the Multi-User version.

In addition to starting a new project from scratch, you can use one of our example databases as a starting point. You can find them on our Starter Projects page.

CatBase Single-User Versions

There are two ways to create a new database:

  1. If CatBase is already running, choose Create a new Database from the File menu, or
  2. As you start CatBase up, hold down the Alt/Option key on your keyboard. Keep holding it down until the Open Data File dialogue appears, then click on the New … button.
  3. Choose a suitable location to store your database, such as a project folder or your Documents folder.
  4. Enter a name for the database into the Save As: box 
  5. Click the Save button
  6. Go to the next step.

CatBase Multi-User

  1. If CatBase is already running, Quit.
  2. Start CatBase on your server, but hold down the Alt/Option key on your keyboard as 4D Server starts up
  3. Keep holding the key down until the Open Data File dialogue appears, then click on the New … button

You'll then see a Create a data file … dialogue with a default database name displayed:

Create a new data file

  1. The default name for the new data file is the CatBase program name, which isn't very useful. Change the name to something more meaningful to your project.
  2. Make sure that the new data file is going to be saved into a suitable folder - eg your Applications->CatBase folder (Mac) or your Documents->CatBase Files folder (Windows).
  3. Click the Save button

Adding Tables

After your new database has been created, you'll see a page inviting you to set up a table.

  1. Click on the link to go to the Table and Field Setup page.
  2. Click the Add a new Table button
  3. Enter a name for your new table and click OK
  4. You'll then see a dialogue asking you for a name for the Key Field. Every table has a Key field. This is main identifier for each record, such as the product name, part number, person's last name, etc. Enter the name for the new table's Key Field and click OK.
  5. Your new table is created.
  6. You can then add fields and set up other options for the table, such as a keyboard shortcut and scripts to run when a new record is created or saved. For detailed information about fields, see the Field Properties tutorial.

Relations

CatBase is a relational database, allowing you to set up many-to-many or many-to-one relationships between the tables. To manage these relations, click on the Manage Relations sub-tab. Here's an example of a newly set up database with two tables -Products and Parts:

Manage relations

In this example, we want to create a many-to-many relationship between Parts and Products: each Product can have any number of Parts and each Part can belong to multiple Products.

  1. Drag and drop the Products table onto the layout area
  2. Drag and drop the Parts table onto the layout area
  3. Drag and drop the Parts table onto the Products table. Your design should now look something like this:

relations

The double-ended arrow indicates that the Parts table is linked via the RelatedRecordNumber field to the RecordNumber field in the Products table. (Note - normally, you don't need to be concerned about the technicalities of how these relationships work - CatBase will handle the details for you.)

Click the Save button when you're happy with the table relations setup.

The Form Design Wizard

Having set up some tables and fields, you need to be able to enter and view the data. That's done via the data entry forms, and you will need to add the fields and other objects that you want to use to your data entry forms. The Form Design Wizard is essentially a drawing program which enables you to place fields and other objects – such as lists of related data – onto a form that you'll use to enter, view, and modify your data. Click here to see the Form Design Wizard Tutorial.

Getting Data Into Your Database

OK - you've set up your database. Now you need to get your data into it. You can either import data from another source, such as a spreadsheet or another database, or you can add data manually.

Importing Data

You can import data from various sources, such as:

  • CSV (comma-delimited) file
  • Tab-delimited text file
  • Excel Spreadsheets (.xls or .xlsx format)
  • Another type of spreadsheet (by saving it as a CSV or Tab-delimited file)
  • An ODBC-compliant database such as MySql or SqlServer (CatBase Data Chameleon Edition)
  • An XML file

See the Importing Data Tutorial for more details, and the Importing Data from a Spreadsheet tutorial for a detailed description of importing spreadsheet data.

Adding Data Manually

To enter data:

  1. Select the table that you want to enter data for from the top row of tabs
  2. Click on the New Record button in the row of buttons at the top of the page
  3. You might find it helpful to look at the CatBase Interface tutorial and the Entering Data Tutorial.

Managing the List Views

When you select any of your data tables in the top row of tabs, you'll see a list of the records in that table (note - this list might show all the records, or some of them, depending on how you previously viewed that table.)

Initially, this list contains just one column: the Key Field from that table. You can add additional columns, rearrange them, and resize them.

To add a new column

  1. Right-click (Windows) or Ctrl-click (Mac) anywhere on the list, except in the header area. A popup menu appears:
  2. Choose Add a Column from the popup list
  3. Choose the column you want to add from the popup list in the next dialogue
  4. If the field you want to add doesn't appear in the list, that means it is already in the list view!
  5. Click OK
  6. The new column is added

To reposition a column

  1. To reposition a column, click on the column header and drag it left or right, then drop it where you want it to go

To resize a column

  1. To resize a column, click on the dividing line and drag left or right (like a spreadsheet)

Saving the list settings

If you want to save the current setup of the list view, right-click on the list and choose Save the column settings for this view. in future when you go to this table, the list will appear just as it currently does.

Publishing Your Data

Finally ... the fun part!! The final step is to tell CatBase how you want to publish your data: What you want to publish; how you want it sorted; how you want each part of it styled; whether you want to publish pictures, and so on. This is all managed through the use of Style Sheets.

There are three types of Style Sheets in CatBase:

  • Character Styls: These specify the fonts, styles, etc. and relate directly to Character Styles in QuarkXPress and InDesign.
  • Paragraph Styles: These specify options such as paragraph spacing, indenting, etc. and they relate directly to the Paragraph Styles in your page layout or word processing program.
  • Publishing Stylesheets: These are unique to CatBase. They tell CatBase what data you want to publish, how you want it organised, and which Paragraph Style Sheets and/or Character Style Sheets to apply to each part of the data.

Please see the following Tutorials for more detailed info:

Any questions?

If you have any questions about the topics discussed here. or are not sure how to proceed, please contact us.