RadixWare Programmer Guide/Quick Start Guide/Developing an Application on RadixWare Platform

From RadixWiki
Jump to: navigation, search

To get to know the principles of application development on the RadixWare platform, let us create a simple application. Assume that the application to be created will be used to automatize the personnel records management in the company.


The steps of development process are described in the following sections:

Starting RadixWare Designer

To start the development:

  1. Get the working copy of the installed RadixWare version. For this purpose, select the Checkout item from the context menu of the Development | trunk branch in the project tree. At that, the user is asked to select the directory for the working copy.
  2. From the org.radixware/kernel/designer/bin/bin directory, run one of the following files:
  • designer.exe on 32-bit Windows OS
  • designer64.exe on 64-bit Windows OS
  • designer on Linux OS


designer.png


When starting RadixWare Designer, the dev/trunk directory will be automatically opened as a project.

Creating Development Layer

The RadixWare platform comprises only one layer; its URI is org.radixware. For the user developments, the additional layers are used. To add a development layer, perform the following actions:

  1. Select the root node (the "trunk" project) in RadixWare Designer navigation tree.
  2. Click the New object… button (add.png) on RadixWare Designer toolbar or select the New | Layer command of the root node context menu.
  3. In the dialog box that will open, select the Repository value for the Category parameter and the Layer value for the Object type parameter. Then, click the Next button.
  4. Specify the layer parameters:
  • The layer name (one that will be used in the program code; for example, Demo) and its title.
  • Copyright.
  • The languages used for the layer localization (for example, English and Russian).
  • URI of the layer (for example, org.radixware.demo).
  • The base layer (for example, org.radixware).
5. Click the Finish button.

As a result, the created layer will be displayed in RadixWare Designer navigation tree.

Creating DDS Module

The tables, references and other database objects are defined in the modules of the Database Definition Segment (DDS). To create a DDS module, perform the following actions:

  1. Select the DDS of the newly created layer in RadixWare Designer navigation tree.
  2. Click add.png on RadixWare Designer toolbar or select New | Module command of the DDS segment context menu.
  3. In the dialog box that will open, select the Repository value for the Category parameter and the Module value for the Object type parameter. Then, click the Next button.
  4. Select the Create new module option and click Next.
  5. Enter the name of the created module (for example, "Test"), click Finish.

As a result, the created module will be displayed in RadixWare Designer navigation tree. The system will also open the module editor (refer to Module Editor).

Capturing DDS Module

To make the DDS module editable, it must be captured. For this purpose, select the Capture Structure item from the module context menu in RadixWare Designer navigation tree. The captured module will be set to bold.

Creating DDS Definitions

The application being developed uses tree tables in the DB:

  • Employees
  • Departments. Several employees can belong to each department, at that one of the employees is the department head.
  • Locations. Several departments can be located in each office.

The DB structure is described by means of DB diagram visual editor (refer to Diagram).

To open the DB diagram visual editor, double-click the Diagram branch of the created DDS module.

Create the sequences first. These sequences will be used to generate the record identifiers. To create the sequences, perform the following actions:

  1. Select the Add sequence from the context menu of the diagram editor.
  2. In the dialog box that will open, specify the sequence parameters. In this case, it is possible to specify only the sequence name.

For the three tables mentioned above, create three sequences.


Увеличить


Once the sequences are created, add the tables by selecting the Add table item on the context menu. The table definition editor (refer to Table Editor) that will open allows to specify all table properties supported by used DBMS (Oracle). On the Main page, define the table name. On the Columns tab, specify the table columns. For the primary key columns, set the P (Primary Key) flag in the columns list and specify the sequence that will generate the identifier values on the Values page. For the Not Null, set the M (Mandatory) flag in the list of columns.


edit-table-pk.png


Once the tables are created, define the references between them. To create a reference, left-click the child table while holding the Alt key (or two keys Ctrl and Alt), move the mouse pointer to the parent table and release the button. At that, the definition reference editor is opened (refer to References between Tables). For the references being created, specify the fields used for reference in the editor:


new-link.png


As a result, the diagram similar to the one below will be created:


diagram-window-small.png

Committing DDS Module

Once the DDS module was changed, the changes must be committed by selecting the Commit Structure item from the context menu of RadixWare Designer navigation tree. At that, the generated SQL script will be displayed. It creates the sequences, tables and references that were previously defined. During the committing procedure, the SVN Commit operation will be also executed (it commits the changes in the SVN repository).

Creating ADS Module

The ADS module is created similarly to the DDS module:

  1. Select the ADS of the development layer in RadixWare Designer navigation tree.
  2. Click add.png on RadixWare Designer toolbar or select the New | Module command on the context menu of the ADS segment.
  3. In the dialog box that will open, select the Create new module option and specify the module name (for example, "Test").

As a result, the created module will be displayed in RadixWare Designer navigation tree and the system will also open the module editor (refer to Module Editor). In this editor, add the created DDS module to the dependencies of the ADS module being created (click Add (add-anc.png) and in the dialog box that will open, select the Demo::Test module). It must be done to make the table definitions defined in the DDS module available for the ADS module definitions.

Creating Entity Class

The entity classes can be created by one of the following ways:

  • Select the newly created ADS module (Test) in RadixWare Designer navigation tree and click add.png on the toolbar. In the dialog box that will open, select the definition type.
  • Select the type of the definition being created on the New submenu of the ADS module context menu.


For the tables defined previously, create three entity classes: Employee, Department, Location. When creating each class, specify the respective table as a base one.


new-entity-class.png


For the created classes, set the Final flag on the General page (since it is not allowed to create the application classes for the default tables and only application classes can be the children of the entity class).


Moreover, for each created class, define the titles for singular and plural on the Presentation page:


set-entity-title.png

Creating Stored Properties

The table columns can be accessed from the ADS definitions and used as a stored properties of entity classes. To create such property:

  • Select New | Column-Based Property item from the context menu of entity class in RadixWare Designer navigation tree.
  • Or select the entity class in the navigation tree, click add.png on the toolbar and in the dialog box that will open, select Category: Properties and property groups, Object type: Column-Based Property.


After that the dialog box for creating the stored property will open. Select the Create column property and specify the property name and the respective table column. For the entity classes created earlier, create the following properties:

  • For Department: id, name, locationId.
  • For Employee: id, fullName, email, salary, departmentId, managerId.
  • For Location: id, streetAddress, postalCode, city.

Creating Reference Properties

To define the parent entity instance by the instance of child entity, the property of the "parent reference" type is used. To create such property, in the dialog box for creating the stored property, select Create parent reference property and specify the used references between the tables.


For the application being developed the following properties are required:

  • For Employee: department.
  • For Dept: manager and location.

Specify the titles for all properties. For this purpose, in the property definition editor (refer to Property Editor) on the Presentation page, set the Define flag and enter the headers in the supported languages.

Editing Entity Classes

In order that the title of entity class instances are correctly displayed in the RadixWare Explorer, specify the instance title formatting method in the definitions of entity classes. For this purpose, on the Object title format page (the Presentation page of the entity class editor, refer to Entity Class Editor), specify the set of object properties that must be displayed in the title and their format. For example, specify the following for the Department class:

  • Property: name, Format: {0}.
  • Property: location, Format: in {0}.


in the RadixWare Explorer, the department titles will be displayed as follows: Software development department in Magnitogorsk, where "Software development department" - is the department title, "Magnitogorsk" - its location.

Creating Editor Presentations

The method of editing the entity class instances is described in editor presentation (refer to Editor Presentations). To create the class editor presentation, select the New | Editor presentation item on the context menu of the Presentations | Editor presentations class branch in RadixWare Designer navigation tree and in the dialog box that will open, specify the presentation name. After that, the presentation editor will open.


To describe a simple editor presentation, perform the following:

  1. Set the Use default model flag as the presentation being created does not contain any specific logic.
  2. Create the editor presentation page. For this purpose, select the New | Editor page item on the context menu of the Editor pages branch in the navigation tree.
  3. In the editor of presentation page, specify the properties available for editing (all properties except for the primary keys).


Create editor presentation for each entity class. They can have any names, for example - "Default".

Creating Selector Presentations

The method of displaying the list of entity class instances is described in selector presentation (refer to Selector Presentations). To create the class selector presentation, select the New | Selector presentation item on the context menu of the Presentations | Selector presentations class branch in the navigation tree and in the dialog box that will open, specify the presentation name. After that, the presentation editor will open.

To describe a simple editor presentation, perform the following:

  1. On the General page, set the created editor presentation for editing the entity class instance as well as creating new instances.
  2. Set the Use default model flag.
  3. On the Selector columns page, add the class properties as columns that will be displayed in the list.

Create selector presentation for each entity class. They can have any names, for example - "Default".

Editing Reference Property

To enable the user to specify the reference property value in RadixWare Explorer (for example, select the location for the department being created), specify the used selector presentation. For this purpose, in the editor of reference property definition (refer to Property Editor) on the Presentation | Parent ref page, unset the Inherit parent selector flag and select the required selector presentation from the Parent selector presentation list. For example, for the location property of the Department class, specify the Demo::Test::Location:Default presentation.

Creating Root Branch

To make the created presentations available from RadixWare Explorer, they must be published in the branch (item of RadixWare Explorer navigation tree). To create the branch, select the New | Paragraph item on the context menu of ADS module in RadixWare Designer navigation tree and in the dialog box that will open, specify the branch title (for example, "HR"). After that, the branch definition editor will open (refer to Branches).

For the created branch:

  • Specify the branch header.
  • Set the Root flag.
  • Add the created selector presentations as child elements of branch. For this purpose, select the New | Entity class reference item on the context menu of the subbranch of the Children branch in RadixWare Designer navigation tree and in the dialog box that will open, specify the required selector presentation.

Creating Child Navigation Items

If the company has a great number of employees, using selector in the Employees branch is not convenient. To facilitate the employees management, it is possible to create the additional navigation items that will display when inserting the department or location into the tree.

To add the navigation item containing the list of employees of the same department, select the New | Child Reference item from the context menu of the Children branch of the Department entity class editor presentation. In the master that will open, specify the used reference between the tables (Demo::Test::Employee=>Department (deptId=>deptId)) and presentation of the Employee entity class selector.

To add the navigation item containing the list of departments with the same location, select the New | Child Reference item from the context menu of the Children branch of Location entity class editor presentation. In the master that will open, specify the used reference between the tables (Demo::Test::Department=>Location (locationId=>locationId)) and presentation of the Department entity class.

The RadixWare Explorer with the created child navigation items will look as follows:

explorer-child-items.png

Creating Additional Pages of Editor Presentation

Using the created child navigation items can be not always convenient, as to use them the item must be inserted into the tree. For the fast access to the list of employees working in the same department, this list can be displayed on an independent page of editor. For this purpose:

  1. Define the header for the Main page of the Demo::Test::Department:Default editor presentation (for example, "General").
  2. Create one more page for the same editor presentation (for example, "Employees"). In the editor of this page, set the Page type to Container and specify the created child navigation item Demo::Test::Department:Default:Employee in the Embedded explorer item parameter.

container-page.png

The editor with the created page will look as follows:

explorer-container-page.png

Committing changes in SVN

To commit the performed changes in the SVN repository, select the Subversion | Commit… item from the context menu of the project root branch in RadixWare Designer navigation tree. In the dialog box that will open, enter the description of changes.