Indian States/Technical Documentation
Contents |
Overview
This article will explain the technical description how to proceed in order to create the Indian States Module.
Module Creation
On usual step need to create a module for the Indian States.
- Login with the username/password as Openbravo/openbravo
- Click on Application Dictionary Menu
- Then click on Module sub-menu of Application Dictionary
- Click on Create a New Record button and specify the following settings.
-
Field Name Supply the proportionate value Client : System Organization : * Active : click on the check box to make it as (available) tick mark Name : Indian States Java Package : org.openbravo.localization.india.referencedata.states Version : 1.0.0 Version Label : V 1.0.0 Type : Module In development : click on the check box and make it as tick mark (active). Description : To create the Indian States in Openbravo ERP Has reference data : Make a tick mark / put flag for the check box Reference Data Description : This module has reference data of country region and city. License Type : Openbravo public license. License text : Openbravo Public License
Dependency Tab
Go to Dependency Tab and check whether the core module has been included or not. Specify that this module dependent on core module by creating a new record if the core module is not included.
DB Prefix Tab
On DB Prefix Tab there is no creation of business data or table for this module. The core module already has table for country and regions to feed the data into the Openbravo ERP Application. So there will not be any new table creation to prefix the word were it is specified in this tab.
Data Package Tab
Next go to Data Package Tab for this module. For newly defined tables are linked to this module through the Data Package. The generated business object for the new table will use the Java Package which is defined in the Data Package Tab. But there will not have any new table creation so it is an optional to specify the data package name.
Data Feed - Indian States
- Expand the General Setup menu by clicking on it.
- Further expand the Application directory by click on it.
- Click on Country Region and City menu. Here it will list out almost all the countries in a grid view.
- Select the India country from the list.
- Check whether the has region check box is active. If it is not active do the click on it(place the tick mark) to enable the Region and save. After that only it is possible to enter the states of India in Region Tab.
- And also specify the Region Name as State. [Refer the screenshot below].
- Now click on Region Tab which is under Country Tab.
- Click on Create a New Record button to add new Region / State for India.
- For example,Give the value in Name field as Andra Pradesh and in Search Key field as AP.
Dataset for Indian States
Find below the steps to create the Dataset for this module:
- Expand the Application Dictionary menu.
- Click on Dataset menu and create a new record for the Indian States module.
- Fill up the Dataset form using the below mentioned values.
-
Field value for the field Client : System Organization : * Active : make it flagged/put a tick mark Module : select the value from the drop down Indian States - 1.0.0 Search Key : Indian States Name : Indian States Data Access Level : System Only
-
- Before assigning the tables to Dataset. Please execute the below query in sqldeveloper or postgres IDE to find the C_country_Id for "INDIA". After executing the below query the result of c_country_id would be 208 for the below query.
-
select * from c_country where countrycode like 'IN%';
-
- Navigate to Table Tab and create 2 new records for the dataset.
- One table called C_Country and another table called C_Region it look likes as given below.
- Fill up the form by using below values for the Table Name: "C_Country"
-
Field value for the field Dataset : Indian States Table : C_Country Active : Default it is flagged. Leave as it is Module : Indian States -1.0.0 SQL Where Clause : c_country_id=208 Include All Columns : Remove the flag or tick mark (Note: Need to add the individual columns for this table using Column Tab) Exclude Audit Info : Mark it as flagged or put tick mark for this check box - Fill up the form by using below values for the Table Name: "C_Region"
-
Field value for the field Dataset : Indian States Table : C_Region Active : Default it is flagged. Leave as it is Module : Indian States -1.0.0 SQL Where Clause : c_country_id=208 Include All Columns : Mark it as flagged or put tick mark for this check box Exclude Audit Info : Mark it as flagged or put tick mark for this check box - Please find below the screenshot - 1 for the above settings.
- Select the "C_Country" table from the table grid view and navigate to Column Tab.
- Click on create a new record button for the above table. You need to select three columns for this table.
- Those columns are:(1)Name, (2)CountryCode, and (3)HasRegion
- Fill up the following values in the form. [Refer screenshot - 2]
-
Field value for the field Column 1: Dataset Table : C_Country Column : Name Active : It has benn flagged. Leave as it is Module : Indian States - 1.0.0 Column 2: Dataset Table : C_Country Column : CountryCode Active : It has benn flagged. Leave as it is Module : Indian States - 1.0.0 Column 3: Dataset Table : C_Country Column : HasRegion Active : It has benn flagged. Leave as it is Module : Indian States - 1.0.0
-
- One table called C_Country and another table called C_Region it look likes as given below.
- Finally navigate to Dataset Tab of Indian States and Click on Export Reference Data button to export the data.
Exporting Module
Exporting a module creates a directory under Openbravo ERP root directory for the newly created module called Indian States. This will generate the appropriate XML files for the finished module.
Note: The module that are flagged / tick marked for the check box In Development field are only exported otherwise it will not be exported.
Step to Export the database
- Using command line:
- Open the command window / shell and navigate to the Openbravo ERP development path.
- execute the following command by specifying the module parameter :
ant export.database -Dmodule="org.openbravo.localization.india.referencedata.states"
- Using Eclipse:
- Right click on the build.xml file and navigate to Run As option and click on Ant Build Option.
- An Edit Configuration window will appear from that select the ant task called export.database.
- Specify the parameter -Dmodule=”org.openbravo.localization.india.referencedata.states” in Main tab from the window.
- Finally click on Run button.
Once you exported the Indian States module successfully, it will be reflected in the eclipse under the root package of modules folder. Please refer the screen shot that how the folder / package structure is reflected in eclipse.
Packaging "Indian States" module
This section explain how to package the module and distribute it through the central repository or sending it to an interested party directly.
To package a module, execute the ant task called package.module -Dmodule=modulename, where modulename is the Java package name of the module.
- Using command line:
ant package.module -Dmodule=”org.openbravo.localization.india.referencedata.states"
- Using Eclipse:
- Right click on the build.xml file and navigate to Run As option and click on Ant Build Option.
- An Edit Configuration window will appear from that select the ant task called package.module.
- Specify the parameter -Dmodule=”org.openbravo.localization.india.referencedata.states” in Main tab from the window.
- Finally click on Run button.
The output of the package.module using Eclipse:
ant package.module -Dmodule=o org.openbravo.localization.india.referencedata.states Buildfile: build.xml package.module: [echo] Validating Module... [validateModules] 0 [main] WARN SystemValidation - Validation successfull no warnings or errors obx.export.database: obx.export.config.script: BUILD SUCCESSFUL
On successful completion of packaging process a new obx file is created in the directory in which this ant task was executed. The name of the obx file would be oorg.openbravo.localization.india.referencedata.states -1.0.0.obx.