CampMaster Plug-in Guide

From DataSplice

Jump to: navigation, search

The CampMaster Plug-in supports authoring database tables in DataSplice to track custom information that is not currently handled by an existing system. Unlike the default DataSplice views where a SQL statement is provided to describe the data from an existing database to be displayed, CampMaster views allow the administrator to define the fields that should be available in a view and automatically constructs a table in the database to store data.

Contents

Installation

Installation of the plug-in is very simple, and is the same process as the other DataSplice plug-ins. Extract the contents of the CampMaster plug-in zip file into the root of the DataSplice installation. Upgrades work the same way; just unzip the contents of the distribution package and overwrite the old files. This will not affect any of the configuration files or other local settings.

Note that CampMaster only has server-side components. There is no need to install anything for the client applications accessing the system.

Configuration

The CampMaster Plug-in options are available through the Server Settings section of the Administration Client:

CampMaster Plugin Options.png

The two available settings are:

Connection Profile
Specifies the ADO.NET plug-in database profile to use for the tables managed by the plug-in.
CampMaster supports both Oracle and SQL Server backend databases.
The user account associated with the profile must have full privileges in the database because the plug-in must be able to create, alter, and drop tables and other schema.
Table Prefix
Each table managed by the plug-in will use this prefix in the table name. This is useful to distinguish CampMaster plug-in tables from other tables that are available, as well as to manage data from multiple instances in the same backend database (DEV_, TEST_, PROD_, etc.)

Creating Views

New CampMaster views are created by selecting the SimpleTableSource backend in the create view dialog:

CampMaster Create New View.png

This will create a table in the database named <Prefix><ViewName>.

Once the view has been created you'll notice that the Basic Options are the same as for other views, except the Connection Profile Name and Base SQL Select options are not available.

CampMaster View Field Settings.png

Fields

The Fields section supports defining the underlying schema of the data in the view.

Note that views are automatically created with a GUID field named ID that is used for the primary key. This allows for a consistent mechanism for identifying records and relating data together. The primary key behavior cannot be changed.

Each entry in the fields collection has the following settings:

Relationships

The Relationships section describes how the records in multiple CampMaster views relates to each other. Relationships are defined in the target view of the relationship. For instance, with a parent/child relationship the relationship entry is defined in the child view, not the parent.

CampMaster View Relationships.png

Each item in the list has the following settings:

Calculated Fields

Calculated fields support having field data that is the result of a subquery or join into another table. In general, the same results can be achieved by creating virtual fields and using the appropriate expression as the field default. However, this mechanism can perform poorly because it results in many requests being sent to the database. Using Calculated Fields allows the subqueries to be processed as a single statement by the database.

CampMaster Calculated Fields.png

The following settings are defined for each calculated field:

Raw Calculated Fields

When the Raw type is specified it works slightly differently than the other calculated types that refer to views and fields maintained by the CampMaster Plug-in. Fields of this type are inserted in the SELECT SQL statement as follows:

( select <Target Field> from <Target View> where <Query Expression> ) <Field Name>

Because the names are not managed by the plug-in the amount of validation that is performed is fairly minimal. In general it will construct the SQL statement with the values specified and directly pass it to the database - any issues will need to be debugged by looking at the returned database error statement.

Note that the statement is performed using the ADO.NET connection profile specified in the plug-in options. This means the associated user must have access to the tables in question, and often an explicit schema or database name is needed in the Target View'.

Managing Data

After the basic schema for the view has been defined, the view configuration is the same as any other type of DataSplice view. The edit permissions, field settings, queries and relationships, and other settings should be defined to achieve the desired functionality. The View Administration section of the administration guide has extensive details about these configuration options.

The Insert, Update, and Delete Record events typically do not need to be overridden as when dealing with external database, save for validating user input. The default action in these events will automatically generate the appropriate SQL statement to modify the data, and will validate the uniqueness and null constraints defined in the field settings.

Database Updates

When the fields for a view are modified and the changes committed to the server, the plug-in will attempt to rebuild the underlying table. Depending on how the data is defined, certain modifications might fail, or if there is a very large amount of existing data the operation might take a long time to complete.

Any operation that deletes data (deleting a view or removing fields from it) will immediately process the change on the database, and there is no mechanism for undoing the changes. Database backup procedures are highly recommended so data can be restored if necessary.

Database updates are performed in an all or nothing fashion, where a temporary table with the new schema is created first, the data from the old table is copied to the new table, and finally the old version dropped and the new table is renamed. Any errors during the process will abort the update and leave the original table unmodified.

The most likely issue will be adding new fields that do not allow null values, which will fail if there are records in the table. This can be accomplished by addition the field without the null constraint, manually setting a default value for the existing records, and then selecting the Field Not Null setting.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox