View source | Discuss this page | Page history | Printable version    | Latest revision

WizardNewFields/User guide

(Field behaviour)
(How to create new fields)
 
(10 intermediate revisions not shown)
Line 1: Line 1:
=Users manual=
=Users manual=
==Purpose of the module==
==Purpose of the module==
-
One of the most common development activities in Openbravo is to create a new tab which allows the user to add, modify and delete new information into the database, or to add additional fields to existing tabs. Following Openbravo's Model Driven Development, these processes require the user to create Application Dictionary components for each tab and field he wants to add. The creation of these objects can sometimes be difficult, as lots of properties need to be specified, and some concepts that need to be taken into account, such as Modularity Naming Rules, can be complicated to some non-advanced users.
+
One of the most common development activities in Openbravo is to create a new tab which allows the user to add, modify and delete new information, or to add additional fields to existing tabs. Following Openbravo's Model Driven Development, these processes require the user to create Application Dictionary components for each tab and field he wants to add. The creation of these objects can sometimes be difficult, as lots of properties need to be specified, and some concepts that need to be taken into account, such as Modularity Naming Rules, can be complicated to some non-advanced users.
Moreover, these processes also require the user to add database physical objects (tables and columns) which correspond to the added tabs and fields. These objects are normally created directly through the Database Management System, and not through Openbravo, and this involves an additional step that can also be very difficult to non-advanced users.
Moreover, these processes also require the user to add database physical objects (tables and columns) which correspond to the added tabs and fields. These objects are normally created directly through the Database Management System, and not through Openbravo, and this involves an additional step that can also be very difficult to non-advanced users.
Line 15: Line 15:
==High level summary of the whole process==
==High level summary of the whole process==
-
All the functionalities which the Easy Extensible Attributes module provides can be accessed through one single window: the Easy Extensible Attributes window, which can be found in General Setup/Application.
+
All the functionalities which the Easy Extensible Attributes module provides can be accessed through two different windows: the Easy Extensible Attributes window, which can be found in General Setup/Application, or the Easy Extensible Attributes for developers, which can be found in Application Dictionary.
 +
 
 +
You should use the first window if you are a user which doesn't want to be bothered by advanced development concepts such as modularity. The second window is designed for developers, and allows you to specify a development module in which the new Application Dictionary will be added (the first one automatically creates a customization module, and adds the objects there).
The process the user needs to follow to create or to extend new tabs has several steps. This is a short description of every one of them:
The process the user needs to follow to create or to extend new tabs has several steps. This is a short description of every one of them:
-
* '''Create or specify the module to extend''': The new objects will be created inside a module which needs to be created by the user. The next section in this user manual will cover this topic
 
* '''Create a new record in the Easy Extendable attributes window''': In this record, you specify whether you want to create a new tab, or extend an existing tab. If you want to create a new tab, you need to provide some additional information.
* '''Create a new record in the Easy Extendable attributes window''': In this record, you specify whether you want to create a new tab, or extend an existing tab. If you want to create a new tab, you need to provide some additional information.
* '''Create new records in the Field tab of the Easy Extendable Attributes window''': In this tab, you need to create a new record for each additional field you want to create.
* '''Create new records in the Field tab of the Easy Extendable Attributes window''': In this tab, you need to create a new record for each additional field you want to create.
-
* '''Apply the changes to the Application Dictionary''': This process is called from a button in the Easy Extensible Attributes window, in the "Window" tab, and creates all the objects in the Application Dictionary and all the physical database objects.
+
* '''Apply the changes to the Application Dictionary''': This process is called from a button in the Easy Extensible Attributes window, in the "Window" tab, and creates all the objects in the Application Dictionary.
* '''Rebuild the system''': This final step involves recompiling the application and restarting tomcat. This can also be called directly from the Easy Extensible Attributes window.
* '''Rebuild the system''': This final step involves recompiling the application and restarting tomcat. This can also be called directly from the Easy Extensible Attributes window.
These are the steps you need to follow to create the tabs and fields. In the subsequent sections of this guide we will explain each one more in detail.
These are the steps you need to follow to create the tabs and fields. In the subsequent sections of this guide we will explain each one more in detail.
-
==Initial requirement: Creating a module==
 
-
This module creates Application Dictionary and database physical objects. As you know, the correct way to create these objects is to use a module which will contain them. Therefore, the main requirement to use this module is to have your own customization module.
 
-
 
-
You can choose to create the module manually through the application, or you can use the built-in tool to do so.
 
-
 
-
Creating the module manually has the advantage that you can choose your own name, javapackage, dbprefix, ... However, if you do it this way you must make sure that you create the module correctly. This means that you must make sure that:
 
-
* The module has a defined database prefix.
 
-
* The module has a defined datapackage.
 
-
* The module has the "Translation required" setting set as "yes".
 
-
* The module is set as "In Development"
 
-
 
-
If you want to use the built-in tool, you just have to select the "Create standard module" checkbox that appears just beside the Module menu, in the Easy Extensible Attributes window.
 
-
 
-
[[Image:createmodule.png]]
 
-
Specially for new users, it's recommended to use the built-in tool to create the module.
 
==First step: create a new tab or specify an existing tab==
==First step: create a new tab or specify an existing tab==
Line 76: Line 62:
If you select one of the field templates, the name and the field type of the field will be automatically set up for you.
If you select one of the field templates, the name and the field type of the field will be automatically set up for you.
 +
The basic options in a field are:
 +
* Name, description, help: basic information about the field
 +
* Field type: the kind of data this field will contain, which in turn influences how it will be shown in the window
 +
* Column size: the size of the data this field will store
 +
* Field size: the length of the field which is shown in the window, measured in columns (1, 2 or 5)
The Show Details check activates several additional options for the field:
The Show Details check activates several additional options for the field:
Line 82: Line 73:
===Data behaviour===
===Data behaviour===
-
* '''Default value''': This is the default value for the field. This default value will be used both in the physical database column, and in the column defined in the application dictionary.
+
* '''Default value''': This is the default value for the field. This default value will be used both in the column defined in the application dictionary.
* '''Mandatory''': Whether the field is mandatory or not (that is, if the user is required to set a value for it).
* '''Mandatory''': Whether the field is mandatory or not (that is, if the user is required to set a value for it).
* '''Read only''': Whether the user can modify the field's value, or instead he can only read it.
* '''Read only''': Whether the user can modify the field's value, or instead he can only read it.
Line 97: Line 88:
-
'''Important note''': Every tab you create needs an identifier field. This means that one of your fields must have the "Is" property checked.
+
'''Important note''': Every tab you create needs an identifier field. This means that one of your fields must have the "Used as record identifier" property checked.
==Applying the changes to the Application Dictionary==
==Applying the changes to the Application Dictionary==
Line 119: Line 110:
==How to remove created objects==
==How to remove created objects==
-
After you've run the "Apply changes to application dictionary" process, the objects have been created in the database. If, for some reason, you want to remove them, there is a way. The records in both the "Window" tab and the "Field" tab of the Easy Extensible Attributes window have an '''Active''' property. If you uncheck this property, and click again on the "Apply changes to application dictionary" button, the related objects will be removed from the database. If you check the property and run the process again, the objects will be recreated.
+
After you've run the "Apply changes to application dictionary" process, the objects have been created in the Application Dictionary. If, for some reason, you want to remove them, there is a way. The records in both the "Window" tab and the "Field" tab of the Easy Extensible Attributes window have an '''Active''' property. If you uncheck this property, and click again on the "Apply changes to application dictionary" button, the related objects will be removed from the Application Dictionary. If you check the property and run the process again, the objects will be recreated.

Latest revision as of 11:19, 20 May 2010

Contents

Users manual

Purpose of the module

One of the most common development activities in Openbravo is to create a new tab which allows the user to add, modify and delete new information, or to add additional fields to existing tabs. Following Openbravo's Model Driven Development, these processes require the user to create Application Dictionary components for each tab and field he wants to add. The creation of these objects can sometimes be difficult, as lots of properties need to be specified, and some concepts that need to be taken into account, such as Modularity Naming Rules, can be complicated to some non-advanced users.

Moreover, these processes also require the user to add database physical objects (tables and columns) which correspond to the added tabs and fields. These objects are normally created directly through the Database Management System, and not through Openbravo, and this involves an additional step that can also be very difficult to non-advanced users.

The main purpose of this module is to centrallize all the information which is needed for these two common processes, and to greatly simplify the whole process. This module will therefore allow the user to:

And after that, it will:

High level summary of the whole process

All the functionalities which the Easy Extensible Attributes module provides can be accessed through two different windows: the Easy Extensible Attributes window, which can be found in General Setup/Application, or the Easy Extensible Attributes for developers, which can be found in Application Dictionary.

You should use the first window if you are a user which doesn't want to be bothered by advanced development concepts such as modularity. The second window is designed for developers, and allows you to specify a development module in which the new Application Dictionary will be added (the first one automatically creates a customization module, and adds the objects there).

The process the user needs to follow to create or to extend new tabs has several steps. This is a short description of every one of them:

These are the steps you need to follow to create the tabs and fields. In the subsequent sections of this guide we will explain each one more in detail.


First step: create a new tab or specify an existing tab

The first main step in the process is to create a new entry in the Easy Extensible Attributes window. In this record, you specify:

If you choose to extend a tab, you will need to specify the existing tab you want to extend:

ExtendTab.png

and after selecting the correct tab, you are done with this step, and you can continue with the next one.

If instead you want to create a new tab, you need to provide a little bit more information:

NewTab.png

How to create new fields

Once you have created a new record in the Window tab of the Easy Extensible Attributes module (either to create a new tab, or to extend an existing tab), the next step is to specify the new fields you want to create.

To do this, you need to create one record in the "Fields" tab for every field you want to add to the tab.

Newfields.png

You can follow two main paths when creating a field:

If you select one of the field templates, the name and the field type of the field will be automatically set up for you. The basic options in a field are:

The Show Details check activates several additional options for the field:

Newfieldsact.png

Data behaviour

Field behaviour


Important note: Every tab you create needs an identifier field. This means that one of your fields must have the "Used as record identifier" property checked.

Applying the changes to the Application Dictionary

After you've created one record for every field you want to create, you are ready to apply the changes to the Application Dictionary. To do this, return to the "Window" tab in the Easy Extensible Attributes window, and click on the "Apply changes to the Application Dictionary" button.

Applychanges.png

This process will create the new application dictionary objects and database physical objects according to the information you provided in the previous steps.

Rebuilding the system

After the changes were applied to the application dictionary, the system needs to be rebuilt. This can be done directly also in the "Window" tab of the Easy Extensible Attributes window, by clicking in the "Rebuild system" button.

Rebuildsystem.png

After you have rebuilt the system, and restarted Tomcat, the modifications you've made should be fully available in your system (the fields you've added and/or your new tabs should be available in Openbravo).

Basically, at this point, you're done!

How to change an already created object

After you've run the "Apply changes to application dictionary" process, the objects have been created in the database. However, you can still modify them. If you want to do it, you can just modify any property in the "Window" or "Field" tabs in the Easy Extensible Attributes window, and click on the "Apply changes to application dictionary" button again. The objects will be updated to reflect your changes.

How to remove created objects

After you've run the "Apply changes to application dictionary" process, the objects have been created in the Application Dictionary. If, for some reason, you want to remove them, there is a way. The records in both the "Window" tab and the "Field" tab of the Easy Extensible Attributes window have an Active property. If you uncheck this property, and click again on the "Apply changes to application dictionary" button, the related objects will be removed from the Application Dictionary. If you check the property and run the process again, the objects will be recreated.