From ADempiere ERP Wiki
Jump to navigationJump to search
Name This user real name is : M.Nasir Aftab
Sourceforge logo.png This user has a Sourceforge account.

ADempiere Package org.compiere.model Classes/Interfaces[edit]




Helping Services

Introduction to Java Language

How to install JDK > Java Development Kit

How to install postgres Database

How to install JRE > Java Runtime Environment

How to ready windows to run Java based applications

How to configure server for ADempiere

How to configure clients for ADempiere

ADempiere code structure

Manage ADempiere tree

How to create new window

How to create new Tab

Create and attach a callout with fields

Create and attach a callout with a button

How to create Dynamic and Static validation lists

How to Create New Product and setting its Price

How to Manage Purchase

How to Manage Sales

Data Model Purchasing[edit]


Data Model Assets[edit]


How to Create / Update Data-Base[edit]

>> Please don't trust below instruction without any confirmation from Community Old Developers >> I always Practice on my Dummy Databases.....

Go to the "C:\Adempiere\utils" folder there will be a batch file "myEnvironment.bat" open it in notepad or textpad or wordpad or any other text file editor in the file, find out where ever the word "xe" is written (it would be on 2 places) change it from "xe" to "xe_NEW" save the file and close

then click on "RUN_DBRestore.bat" batch file it would do some processing and in the end it would have created a new database in your db application named as "xe_NEW" now when ever you will run your ADempiere application, in the 1st screen (of database connectivity) if you provide "xe" as the Database name, it would connect to the older database that you already have and if you provide "xe_NEW" as the Database name, it would connect to the new version of the database. ( But I guess, after updating the source code, it would only let you connect with the new version of the database, not with the older version any more)

Go Depth in ADempiere Code[edit]

ADempiere Deep Look In Code Depth In Code

Debugging in ADempiere[edit]

Download pdf here Debugging.pdf.

How to Create New Project in Eclipse[edit]

How to Create New Project in Eclipse


Relationship in ADempiere[edit]


I am not sure that this is correct document ,you can send me your comments to update it .

Click and Find GUI window initial call of methods[edit]

Click and find >> ClickAndFindBy_Nasir.pdf.

You can send me your comments via mail to update it .

How to Identify Button class Process[edit]

: Click Here.

You can send me your comments via mail to update it .

Assets Data Model and Relationship[edit]

: Data Model and Relationship.

ADempiere Reporting Help[edit]

: Click Here.

You can send me your comments via mail to update it .

Basic of Java Client Servlet Communication[edit]


Persistent Objects PO Class[edit]

PO is a persistent class in ADempiere.It is an abstract class.This persistence object class manages the database and the mapping between the database and the objects. PO class use for three of main functionality ::

  • It use for Transfer of Database
  • It use for calls the Triggers
  • It use for calls the Model Validator

PO Class Implements three interfaces

  • • Serializable (Java Built-in Interface).It is a marker Interface(Interface which have no any method).This interface only use for streaming of object.

The initial concept of object serialization is the ability to read and write objects to byte streams. Serialization involves saving the current state of an object to a stream, and restoring an equivalent object from that stream. Below images describe the Streaming of objects. ObjectInputStream.JPG ObjectStreaming.JPG

  • • Comparator > (Java Built-in Interface) It consist two methods compare() and equals().These methods are implemented by PO. Because PO class implements this interface so it need to override these methods.

Methods > boolean equals(Object obj) and int compare(Object obj1, obj2)

  • • Evaluatee > This is ADempiere Built-in interface. It consist only one method.

Method >public String get_ValueAsString (String variableName).

More About PO >>> PO use for POJO persistence layer that is mostly use for manages persistent objects. Persistent objects integrated with EJB. It is an abstract class that implements (Implements use for inherit with interface in java) three interfaces (Java built-in interface) by names as • Serializable • Comparator • Evaluatee

PO use for main three purposes

1. DB Transfer 2. Calls Trigger / Calls to Procedures 3. Model Validators

Don't Trust Also Explore with your gun shooooot.. -:)

Immutable Objects in Java[edit]

In Java the String class is immutable, so that once it is created a String object cannot be changed. The String class has a number of methods, that appear to modify strings. Since strings are immutable, what these methods really do is create and return a new string that contains the result of the operation.

  • •How to Make a Java Class Immutable

Make a Java Class Immutable

  • • A Strategy for Defining Immutable Objects

Defining Immutable Objects

  • •Immutable objects First Page

Immutable objects

  • •Immutable objects

Immutable objects

  • • Understanding Instance and Class Members

Instance and Class Members

Enjoy Database Related Tutorial[edit]

  • • How to install Postgres From Youtube

Postgres Installation

  • • How to set the Postgres Database Priviledges.

Postgres Database Priviledges

  • •JDK Installation

How to install the JDK

ADempiere Pure Core Developer Training[edit]

This Training will expert you in core concepts of Adempiere in Developer point of view,After this you can extends/update your newly/existing ADempiere application environment . .

  • Overview of ADempiere.
  • Pre requirements for ADempeire development environments.
  • What is Mercurial ,How to do its configuration and using it handling repositories of ADempiere (checkout code,what is trunk repository etc ).
  • Installation of Development kits, Developments tools and Database?
  • Setup the important path and variables for development environment.
  • Setup of ADempiere in eclipse.
  • ADempiere server configuration (Configuring Tomcat/JBoss on Eclipse).
  • Compile and run ADempiere code using eclipse.
  • Map OOP Concepts in ADempiere.
  • Main Java knowledge that make you to expert in ADempiere.
  • Overview of ADempiere in Developer Point of view.
  • How many Layers exist in ADempiere.
  • ADempiere Packages and its importance (in respect of developer layers and user Layers).
  • Requirement for Extending ADempiere (Extends ADempiere using your own java code).
  • Debugging java Code in ADempeire.
  • Trace bug from java code using eclipse in ADempiere.
  • ADempiere Layers and their classes tree structure.
  • Detail of ADempeire Business Layers, Domain (Model) Layers and UI Layer.
  • Detail about list of point as below ,
    • How to Handle following things
    • Change/set visibility logic for fields
    • Change/set mandatory logic for fields
    • Change the layout (field order) of tabs
    • Change/add validation rules for fields
    • Change/set default values for fields
    • Change/set read only logic for fields
  • Map ADempiere Data Dictionary with Java Code.
  • Overview of below list
    • Application dictionary (How to explore Application Dictionary)
    • Tree & Menu Maintenance
    • Windows, Tabs & Fields
    • Reports, Report Views & Processes
    • Scheduled Tasks
  • Add new Columns and tables in Database.
  • Add new Columns / tables in ADempiere
  • Develop/create ADempiere Model classes.
  • Validation and use of Validation in ADempiere.
  • Overview of Callouts, Process, Validators,Custom forms and Core Classes Engine .
  • How to Develop Model Validator .
  • How to add Validation, pre-processing and post processing loginc for the newly created table like beforeSave, AfterSave,beforeDelete and after Delete ModelValidator .
  • Hierarchy of ADempiere Windows, Tab and Fields.
  • Adding new windows,Tabs,Fields in ADempiere.
  • How to attach validation with a field.
  • What is callouts and its use in ADempiere .
  • Add java code for callouts and attach with a field.
  • How to create new java class and create its binary and add it into existing ADempiere.
  • What is patches, how to create the pathes and add patch(s) in running ADempeire environment (Apply the customizations to your existing ADempiere).
  • Workflow and its use in ADempiere ?
  • How to develop and attach a process with ADempiere ?
  • Write Java code to develop process and calling process from code.
  • Write Java code to add your own logic behinds the tabs, fields?
  • What reporting style use in ADempiere.
  • How to design and attach a report with ADempiere.

Learn the Java Language: Table of Contents[edit]

  • Overview:
    • • Strengths of the Java programming language.
    • • Understand what is Java
    • • Overview about the different versions and editions of Java.
    • • The history of Java.
    • • Purpose of the Java Virtual Machine.
  • Language Basics (Introduction and Basic Concepts):
    • • Variables
    • • Create a simple starter program in Java
    • • Primitive Data Types
    • • Arrays
    • • Operators
      • •Assignment, Arithmetic, and Unary Operators
      • •Equality, Relational, and Conditional Operators
    • • Expressions, Statements, and Blocks
    • • Control Flow Statements
    • • The if and if-else Statements
    • • The switch Statement
    • • The while and do-while Statements
    • • The for Statement
    • • Branching Statements
  • Classes and Objects:
    • • Classes
    • • Declaring Classes
    • • Declaring Member Variables
    • • Defining Methods
    • • Providing Constructors for Your Classes
    • • Passing Information to a Method or a Constructor
    • • Objects
    • • Creating Objects
    • • Using Objects
    • • More on Classes
    • • Returning a Value from a Method
    • • Using the this Keyword
    • • Controlling Access to Members of a Class
    • • Understanding Instance and Class Members
    • • Initializing Fields
    • • Nested Classes
    • • Inner Class Example
    • • Enum Types
  • Interfaces and Inheritance:
    • • Interfaces
    • • Defining an Interface
    • • Implementing an Interface
    • • Using an Interface as a Type
    • • Rewriting Interfaces
    • • Inheritance
    • • Overriding and Hiding Methods
    • • Polymorphism
    • • Hiding Fields
    • • Using the Keyword super
    • • Object as a Superclass
    • • Writing Final Classes and Methods
    • • Abstract Methods and Classes
    • • Encapsulation
  • Numbers and Strings
    • • Numbers
    • • The Numbers Classes
    • • Formatting Numeric Print Output
    • • Beyond Basic Arithmetic
    • • Summary of Numbers
    • • Questions and Exercises: Numbers
    • • Characters
    • • Strings
    • • Converting Between Numbers and Strings
    • • Manipulating Characters in a String
    • • Comparing Strings and Portions of Strings
    • • The StringBuilder Class
  • Generics:
    • • Introduction
    • • Generic Types
    • • Generic Methods and Constructors
    • • Type Inference
    • • Bounded Type Parameters
    • • Subtyping
    • • Wildcards
    • • Type Erasure
    • • Using Non-Reifiable Parameters with Varargs Methods0
  • Collections:
    • • List
    • • Arraylist
    • • Vector
    • • Hash-map
    • • Hashtable
    • • Queue
    • • Stack
    • • Iterator
  • Data Structure:
    • • Linked List (Single, Double)
    • • Queue
    • • Stack
    • • Sorting
    • • Recursion

ADempiere Database Export / Import[edit]

I am not much familiar with Postgres -:) . But as much as I can > I am providing you some useful information from youtube,www,irc and from this page. You can export the ADempiere Database Manually. All your information that is used to export the database lies in myEnvironment.bat file. To export the database RUN_DBExport.bat file use. First Line of RUN_DBExport.bat i.e. @if (%ADEMPIERE_HOME%) == () (CALL myEnvironment.bat Server) else (CALL %ADEMPIERE_HOME%\utils\myEnvironment.bat Server) Use to include the myEnvironment.bat file into RUN_DBExport.bat .You can change export file path from default data folder to other folder / dick by modify myDBcopy.bat bat file. RUN_DBExport.bat also include myDBcopy.bat to create the copy of Database and its jar files. myDBcopy.bat generates the three files during creation of backup. File with name of ExpDat.dmp use for export purpose also. %ADEMPIERE_HOME%\data\ExpDat.dmp %ADEMPIERE_HOME%\data\ExpDat.log %ADEMPIERE_HOME%\data\ExpDat.jar

To Import the Datbase just run the RUN_DBRestore.bat by double click on it.This file take database dump from %ADEMPIERE_HOME%\data\ExpDat.dmp Directory .Again for Restore the Database it use the myEnvironment.bat file to get the database user name ,password and other information . You can see many call statements that is use to include a bat file into another bat file.

Create and Apply ADempiere scheduled Database backup script[edit]

How to create a bat file ….. Go on run and write edit and path and then file name with that you want to create the bat file ….. Save this file ….. And insert the below lines for creation of backup …. c & cd C:\Program Files\PostgreSQL\8.4\bin & pg_dumpall.exe -h localhost -p 5432 -U postgres -v -f "C:\postgres_backup.sql" C:\postgres_backup.sql show is the path where you backup file with mentioned name will save … C:\Program Files\PostgreSQL\8.4\bin text shows the bin directory of your installed Postgres Database.


After all of this you will attach this bat file with your Window scheduler ….. From control panel click for schedule tasks and click for wizard and attach that bat file with schedule setup other tasks related to scheduling <When you want to take backup>…..

Marker Interface in Java[edit]

In Java the interfaces without any methods are known as marker interfaces. Examples Of marker interfaces > Clonable,Serializable, SingleThreadModel, Event listener. E.g. Suppose you want to persist (save) the state of an object then you have to implement the Serializable interface otherwise the compiler will throw an error. Marker Interfaces are implemented by the classes or their super classes in order to add some functionality.

  • •For more Detail Visit Below Links

Marker Interface

  • • Marker Interface Pattern

Marker Interface Pattern

  • • Forum Discussion on Marker Interface



Sometimes a person needs to work on big projects. Suppose project is java based and consist on many .java classes. It consist of classes that are dependent on other classes, they are situated in multiple directories and the output file must go into multiple directories too, you have various projects build routes for different application as in adempiere also,so at the moment need for coordinating all of this manually or using some other build utility which doesn’t do what you want it to so many hours are spent changing directories and compiling individual file and so on…. No imagine if there was a tool that could alleviate the stress and hassle you are experiencing..Aha >> this tool called ANT

    • Ant is the ubiquitous build tool in Java environments
    • And is implemented in Java
    • Ant is an Open Source App
    • It is maintained by Apache
    • It is portable
    • Ant is cross platform
    • Ant is well suited to a large number of automation and scripting tasks
    • Ant is not a programming language
*From ant what you can do ?
    • Using ant you can get source code from different version control
    • And can package compiled code and resource
    • Ant can use for unit testing
    • Using ant you can compile source code

Extends / Uses[edit]

How to use UML extends and uses

Talking Image[edit]

ADempiere Dictionary Tab Detail [2].

ADempiere Developer Forum Volume-1[edit]

Click Here to see the pdf file.

ADempiere Developer Forum Volume-2[edit]

Click Here to see Volume-2 file.

ADempiere Developer Forum Volume-3[edit]

Click Here to see Volume-3 file.

ADempiere Developer Forum Volume-4[edit]

Click Here to see Volume-4 file.

Concept of Singleton Using Java[edit]

package com.apps.sms.DAO; /**

* @author nasir aftab 
* Created on June 02, 2011, 10:10:13 AM

import java.sql.*; public class DBConnection {

   private Connection con;
   static private DBConnection _instance = null;
       Connection getDBConnection(){
           con = java.sql.DriverManager.getConnection("jdbc:odbc:FSMS");
       }catch(Exception ex){
       return con;
   static public DBConnection getInstance() {
     if(null == _instance) {
        _instance = new DBConnection();
     return _instance;


Android Architecture Heading[edit]


Android Architecture Detailed[edit]


Web client to server Authentication mechanisms[edit]

  • •HTTPS Client Authentication
  • •Form Based Authentication
  • •HTTP Digest Authentication
  • •HTTP Basic Authentication

Basic Setup for Android Apps Development[edit]

  • • Step 1: Install the JDK (Java Platform)
  • • Step 2: Setup the PATH variables for JAVA
  • • Step 3: Install Your IDE of Choice (Downloaded Eclipse and Unzip)
  • • Step 4: Download and Install the Android SDK of Choice (Download it from Android Developer Official site)
  • • Step 5: Install the Android ADT for Eclipse
  • • Step 6: Create an Android Virtual Device (AVD)

Important Android Component (Main Component)[edit]

Before Start development on Android OS you should learn about main components

  • Activity:It represents the presentation layer of an Android application, e.g. a screen which the user sees. Any Android application can consist many activities,All the activities can communicate with each other at run time.
  • Service:It use to perform the background process,Service perform the background tasks without User-Interface (UI).Service and Activity can communicate with each.
  • Intent:Intent use for Communication among the Activities and Service .It use asynchronous messages which allow the application to request functionality from other services or activities.
  • Resource:Externalization of strings (like labels etc) and graphics (images etc),Resources use as xml formate to save the strings data,you can attach different languages containing different languages formate to show on application UI . . .
  • Notification:A Notification can be of any type like light, dialogue,sound,icon,string. notification example as incoming message,incoming mail sound etc
  • Broadcast Receiver:Its listen the external intents,external intents that are out of your application,ex when your phone's bluetooth get on,when you receive messages/calls etc .