Docs
  • Getting Started
  • Overview
    • Understanding
      • User-Interface
      • Shortcuts
    • Getting Started
      • Creating A New Application
      • Adding Basic Structure using Class Designer
      • Creating a link to the TIVITY File Class
      • Setting Rights
      • Creating Queries
      • Building The Layout
        • Creating an App Page
        • Creating an Object Page
        • Creating a List Item Layout
  • Building an Application
    • Application Setup
      • General
      • Documentation
      • License Management
      • Publishing the Application
      • Advanced Settings
        • Document-MailEditor
    • Data
      • Sources
      • Data Modelling
        • Class
        • Field
        • Action
        • Link
      • Query Data
        • Get Started with Query Designer
        • Common
        • Fields
        • Conditions
        • Default Values
        • Preview
      • Roles & Permissions
        • Rights Designer
      • Access Control Lists (ACL)
    • Views
      • Design UI
        • Page Types
        • Fields and Links
        • Layout Controls
          • Actions
          • Panels
          • Sections
          • Lists
          • Input
        • Layout Templates
      • Document Templates
        • Get started with Template Designer
        • Expressions in Templates
    • Execution
      • Functions
      • Workflows
        • Control Types
      • Trigger
      • Scripting
        • Accessing the Script Designer
        • Using the Script Designer
        • Commonly used Actions
        • Reference: Actions
          • Math
          • System
          • Date
          • Collection
          • LogicalOperators
          • Web
          • Structure
          • Constants
          • Converters
          • Commands
          • Text
          • PDF
          • Operators
          • PowerPoint
          • QR-/Barcode
          • Messaging
          • Cells
          • Xml
          • Admin
          • Integrations
    • Expressions
      • Expressions in Expressions
      • Expressions in Condition Values
  • Administration
    • Platform
    • Workspace
    • Security
    • Platform Setup
  • Extensibility and Integration
    • REST API
    • Source Adapter
      • Getting Started
      • Source Adapter Interface
      • RESTful Adapter Service
  • Adapter Portfolio
    • MongoDB Adapter
  • Platform Features
    • Enterprise Search
      • Integration into an App
      • General Settings
    • Templates
    • Tagging
      • Getting Started
      • Manage Tags
      • Settings
      • Usage
        • Tag filter
        • Tag panel
    • DMS Setup
Powered by GitBook
On this page
  • Creating a new Class
  • Common Tab
  • Mapping Tab
  • Fields & Action Tab
  • Adding New Fields to a Class
  • Common Tab
  • Mapping Tab
  • Title
  • Notes
  • Priority
  • CreatedOn
  • DueDate
  • IsCompleted
  • ModifiedOn
  • CreatedBy
  • Owner
  • ModifiedBy
  • Save class
  • Write structure

Was this helpful?

  1. Overview
  2. Getting Started

Adding Basic Structure using Class Designer

Creating new classes and adding fields to it using the Class Designer.

PreviousCreating A New ApplicationNextCreating a link to the TIVITY File Class

Last updated 3 years ago

Was this helpful?

The first step in building every application is to create a structure in the Class Designer.

For in-depth documentation about data modelling, you can also check out the Data Modelling page.

Creating a new Class

To add a new class, while still being in the Config Mode of your application, click on Classes, then in the next window click on New Class.

We can now configure our new class in the new window.

Common Tab

Choose a unique name for both the Key and Name fields, for example, "MyToDo". Under Class Type, we also need to check the Is Independent and Auto-Save checkboxes. We will refer to this class as the To Do Class in this tuitorial.

When Auto-Save is checked, user changes are saved automatically.

Key is the name we use to this specific class on the TIVITY platform.

Name is what is displayed to the user.

Mapping Tab

The Key in the Mapping Tab represents the name of the table in the database.

It is important that the key with the table name does not already exist in the database. Otherwise you will get errors. See chapter: Write structure.

For this tutorial, no changes are required in the Advanced Tab or the Permissions Tab, so we can move on directly to the Fields & Actions Tab.

Fields & Action Tab

As its name suggests, this tab allows us to create new fields and actions. Some fields and actions are already present by default.

Adding New Fields to a Class

To start adding a field to our class, type your field name in the Add new field text box and press Enter.

Common Tab

Each field has a Key, an Internal Key, and a Name. They also have a Data Type to describe what kind of data is present in the field and a Control Type to define what kind of Control to use for data input.

Mapping Tab

Settings on this tab are used to configure the mapping from our field to the database. Once again we need to define a Key.

Data Type and Length describe the type of data and its size respectively when stored inside the database.

Assigning a value of -1 to Length instructs the database to use the maximum length for the data type specified.

Finally, the Is identity checkbox indicates whether the database should auto increment the value of the field, and Is nullable indicates if this field can be null.

We will be adding the following fields to our class :

Title

The first field we are going to add to our class is the "Title" field which will store the title of the task.

In the Common Tab :

In the Mapping Tab

Notes

The "Notes" field will store notes that we can attach to our tasks.

In the Common Tab :

In the Mapping Tab

Priority

In the "Priority" field, we will store the priority of the task. This time we want our field to have only 3 possible options: "Normal", "Medium" and "High". To achieve this, we will set the Data Source Type as Options and list our possible values.

We also want to use a slider to set the priority of the task, so we set the Control Type to Slider.

We also want our task item to have a default priority "Normal" when created, so in the Advanced Tab, we set the Default Mode to "Creation" and the Default Expression to "Normal"

In the Common Tab :

In the Mapping Tab

In the Advanced Tab

CreatedOn

The CreatedOn is a special field which the platform automatically detects it and is automatically set to the corresponding date and time when an object is created.

Make sure to spell "CreatedOn" correctly for this feature to work!

We also do not want anyone to modify this field, so we check the Is Read Only checkbox in the Advanced Tab.

In the Common Tab :

In the Mapping Tab

In the Advanced Tab

DueDate

The "DueDate" field will allow the user to input a due date for the task using the Calendar control.

In the Common Tab :

In the Mapping Tab

IsCompleted

The is completed field will indicate whether the task is completed or not.

In the Common Tab :

In the Mapping Tab

In the Real Field

ModifiedOn

ModifiedOn is a special field that is automatically detected by the platform and is automatically set to the date and time when an object is modified.

We also want that field to be read-only.

In the Common Tab :

In the Mapping Tab

In the Advanced Tab

CreatedBy

CreatedBy is a special field that is automatically detected by the platform and is automatically set to the unique identifier of the current user when an object is created.

This field is set to read-only.

In the Common Tab :

In the Option Source :

In the Mapping Tab

In the Advanced Tab

Owner

For this tab we want the user to be able to assign ownership of the task by picking any user in the workspace. The TIVITY platform has a predefined implementation for this kind of operation called a Controller.

For this field, we use the "Combo Box" Control Type, and to populate it with users of the workspace, we set the Data Source Type as Controller and the Data Source Controller as OfficeUserIdSourceController

When created, we also want the default owner to be the current user if no one user been specified. To achieve we, we go head to the Advanced Tab and set the Default Mode to Creation and the Default Expression to {CurrentUser.Id}

In the Common Tab :

In the Mapping Tab

In the Advanced Tab

ModifiedBy

ModifiedBy is a special field that is automatically detected by the platform and is automatically set to the unique identifier of the current user when an object is modified.

This field is set to read-only.

In the Common Tab :

In the Mapping Tab

In the Advanced Tab

Save class

Now having created all the fields, we can save our class by clicking on the Save button.

TIVITY will validate all fields and give out warnings if any errors are present in the class.

Write structure

Now a physical structure of the newly created and configured class must be created. For example, in the case of an SQL database, a table is created in the database as a data source in which the instances of this class can later be stored.

The action to create the structure is located in the upper right corner of the designer. Open the menu there and select the action Write Structure.

The action Read Structure executes the reverse way. The structure is transferred from the data source and the classes are updated or created in the Designer. For example, in SQL database as data source changes of a table (new column added) is transferred to the class model.

If a newly created class already exists or fields are duplicated, a validation error occurs.

Title
Note
Priority
CreatedOn
DueDate
IsCompleted
ModifiedOn
CreatedBy
Owner
ModifiedBy
Data Modelling
Creating a new class
MyToDos Class Common Tab
MyToDos Class Mapping Tab
Adding New Fields to a Class
Title Field Properties
Notes Field Properties
Priority Slider, with predefined options
Priority Field Properties
CreatedOn Field Properties
DueDate Field Properties
IsCompleted Field Properties
ModifiedOn
CreatedBy Field Properties
Owner Field Properties
ModifiedBy Field Properties
Saving the class
Class designer
Structure validation error