March 15, 2014 , by

A pistachio application is composed of one or more data models.

Configuring an application in Pistachio

To configure an application, we will need to create a data source first. Please see Data Sources for more information. Once, you have created the desired data source, we are ready to build an application. Simply go to the Applications page, and click Add. You will be provided with a form. Give your application a name, select the data source you created, provide a description and click save. The application will be created and an interface to setup your application's data model will be provided.

  • Group Owner - indicates which group of users will have access to use/manage the application.

Creating a Data Model

Once, you create your application, next step would be to add data model(s) to your application. This means, we will setup what fields to display in the application form, and specify how they will be rendered and validated. Lets start by clicking on the “Add New” link for the Data Model. The application will automatically provide you the list of tables available from the data source associated with the Application.

Here we create a data model called “Employee” based on the data table tEmployee using the Employe Database Connection data source. Once, you click save, the data model is created, and a new popup is provided with the list of fields available in the table specified for the Data Model.

Select the fields you want to include in the data model, make sure to select the primary key field in the database to use it as the key field for the model. Next you should see the Data Model configuration screen with more options. As always, you can click on the  ?  icon to get more detailed help at any time.

Configuring Fields

Under fields, you will see a list of fieds, you selected and added to the data table using the earlier popup.
Scan Table – Rescan the table and add new fields, if any added. Re-Order fields – provides interface to reorder fields in which they are presented on the screen. As, you can see each field, we added is assigned a template, display order, and other configuration properties.

Pistachio automatically tries to pick the best template while adding field from the database. The name field was type text, so , the template of type “Text – Single Line” was assigned to the field. Pistachio allows each of these fields properties to be configured extensively. For more information, see Data Model Table Fields

Configuring Permissions

Under the Permissions tab, you can set which group will have what role for this data model. To learn more about Roles/Group, please see User, Groups and Roles

The above configuration indicates that this form will be available for administration Role by Admin group, and for searching and viewing (readonly) by all logged in users, as well as not logged in users.

Creating a Relationship

In Pistachio a relationships can be built between data models by creating a field type of "Relationship". For detailed information see Data Model Relationships.

Configuring Rules

Record Saved Actions

  • Destination After Add - use to specify the page loaded after a user adds a record.
  • Destination After Edit - use to specify the page loaded after the user edits a record.
  • Default Detail View - use to specify whether the Edit or View page should appear when the user clicks on the results row.

Pistachio ships with Rules framework to drive the rendering of fields dynamically using business logic. For example, we might want to show a Other text-box for the user to provide custom Department Name if they select a department called Other. For detailed information see Data Model Rules.