How To Modularize The Location Selector
Languages: |
TemplateThis sub-template doesn't display properly when not included. Please see Template:Languages for the complete version. UsageThis template is designed to simplify Template:Languages, by allowing a simpler syntax for adding new languages. Each language is included by calling this template with the following parameters:
This template should not be used anywhere except in the Languages template. </noinclude> | Translate this article... |
Objective
The objective of this article is to show you how to modify and modularize the Location Selector.
Recommended articles
Before reading this guide, it is necessary to have a proper understanding of Openbravo's Modularity concept and how to create and package a module,
as we take the knowledge from these articles as a given in this guide.
In case you are working with configuration scripts or templates on a regular basis, the following link to an article might be of interest to you, since it describes how to create a configuration script.
Execution Steps
The steps needed to change and modularize the Location Selector are as follows:
- Define your own Module and export it. The module folder will be then be generated, for example:
- Create the source folder for the Module we just created previously. For our example it should look like this:
- Copy the original files of the Location Selector into the newly created folder. When copying the files, maintain the original file names. The original files are located at:
-
Modify the following files to make them part of your package:
Location_Search_data.xsql:Change the defined package to: "com.openbravo.support.locationexample.info"
Location.java:
Change the package to: "com.openbravo.support.locationexample.info" Change the following mappings to use the new mappings: org/openbravo/erpCommon/info/Location_FS -> com/openbravo/support/locationexample/info/Location_FS org/openbravo/erpCommon/info/Location_F1 -> com/openbravo/support/locationexample/info/Location_F1 org/openbravo/erpCommon/info/Location_F2 -> com/openbravo/support/locationexample/info/Location_F2
After that you can apply all the changes you want to do. In our example we have just changed the labels for the fields.
modules/com.openbravo.support.locationexample/
src/com/openbravo/support/locationexample/info/
src/org/openbravo/erpCommon/info/Location
|
- Define a new template module and mark it as In Development. You can use the template we used to deactivate the Trigger: In the Tables and Columns window, find the column which you want to use with the Locator Selector we have created and change the "Reference Searchkey" combo to use this new reference. In the example we have done it in the C_Bpartner_location table, in the c_location_Id column.
-
Compile the application with:
ant smartbuild
- Restart tomcat and use the column to check that the new reference is working with the new changes.
Result
Following screenshot shows the results of our changes: |