Posts in Category: tutorials

Tracing Errors in Adempiere and Correcting them!

[divider]

Errors in Setup

The following errors can be faced while Setup and given are the ways to correct them:

  • Application Server or Database Server is the name, URL or IP of your server PC.
  • JNP Port = 1099 error means that a previous service is running. Kill it. Also, since this is the first port that is tested, it could also mean that you have a mismatch between your host name (in the hosts file) and your actual IP address. Fix it in “/etc/hosts” (linux)
  • Database Port = 1521 error can be solved by restarting DB machine.
  • System & Database Passwords are those defined when you setup your Database.
  • Mail Server is optional. RUN_Setup can still finish without it.

[divider]

Java Home Error

The error faced when u click on Test

If you receive the following message:

image001

You should check your java environment variables. Check that the JAVA_HOME system environment variable points to the correct directory. Set the PATH in such case and if everything fails try to install JAVA again. The error should be removed in such case.

[divider]

Web Port Error

If you receive the following message from the installer:

image003

it is likely that you have some other web server running or, if you are using Linux, you need the appropriate privileges.

The default ports are: 80 for http connections and 443 for SSL connections. This message means that the user is not allowed to use the port, likely because it is already used by another application. Change the port to something else. Web Port 8088 and SSL 4443 are recommended. If you are using Linux, remember that ports under 1000 need root privileges. If you are using Oracle database, port 8080 might be used.

[divider]

JNP Port 1099 Error

Another possible error is Server Setup Error JNP Port (Not correct: JNP Port = 1099) OK

The JNP Port = 1099 error can be caused by another process which is already attached to that TCP port. Take a look what process is using this port and so you can take steps to stop it. It can also be caused by a mismatch between your IP address and the entry in your hosts file.

[divider]

JNP Name Not Found Exception

This error is usually related to a DNS problem. It is possible to complete the setup using IP addresses when installing with PostgreSQL. Make sure you have a working DNS environment or add an entry in /etc/hosts(linux) or %SystemRoot%/system32/drivers/etc/hosts(windows).

[divider]

Errors Faced in LinuX

  1. When deploying build on Linux and faced any unknown Exception like some java Jar missing in deployment , re install the JAVA as it is the only way out for the problems with the missing JAR’s .

Such Errors are faced due to discrepancy in JRE and JDK of Java, or only JRE is installed and hence error is coming. ReInstall the JAVA and such errors will be removed.

  1. In case of Software on Linux we need to take care that complete commands must be executed i.e rpm must be executed in case of Linux in rpm files and for further commands Google can be referred.
  2. In case of errors faced in the linux Distro stick to the community for genuine Solutions and remedies.
  3. Before Solving or searching for any error make sure that the environment is correct and all the PATH of the variables are correctly set. This can be achieved by the following commands:
    1. Find JAVA version by the following command in linux or windows

                  i.      java –version

  1. Make sure that the JAVA version is greater than or equal to 1.6.0.45 .
  2. If JAVA version is less than mentioned version , make sure that latest version of Java is installed on client system
  3. Once JAVA is installed if we are still getting the version as 1.5.0 or anything else less than 1.6 we need to do the following:

                            i.      IN WINDOWS

  1. Set the path for the latest version of JAVA by right clicking the My Computer and hence changing the variable.

                          ii.      IN LINUX

  1. Go into the directory of new installed JAVA

[root@localhost /]# cd usr/java/jdk1.6.0_45/

  1. Once u are in directory you need to run the following command

[root@localhost jdk1.6.0_45]# alternatives –config java

  1.  This will provide us with all the options of java installed, if the current java i.e the latest version of JAVA is not shown then do the following:

[root@localhost jdk1.6.0_45]# alternatives –install /usr/bin/java java /usr/java/jdk1.6.0_45/bin/java 2

4.   This will give the following screen to us: Select the new version of JAVA here

[root@localhost jdk1.6.0_45]# alternatives –config java

There are 2 programs which provide ‘java’.

  Selection    Command

———————————————–

*+ 1           /usr/lib/jvm/jre-1.5.0-gcj/bin/java

   2           /usr/java/jdk1.6.0_45/bin/java

 

Enter to keep the current selection[+], or type selection number: 2

 

  1. Run the following commands after wards to set the JAVA_HOME and PATH Variable

[root@localhost jdk1.6.0_45]# alternatives –install /usr/bin/jar jar /usr/java/jdk1.6.0_45/bin/jar 2

 

[root@localhost jdk1.6.0_45]# alternatives –install /usr/bin/javac javac /usr/java/jdk1.6.0_45/bin/javac 2

 

[root@localhost jdk1.6.0_45]# alternatives –set jar /usr/java/jdk1.6.0_45/bin/jar

 

 [root@localhost jdk1.6.0_45]# alternatives –set javac /usr/java/jdk1.6.0_45/bin/javac 

  1.   If we run java –version now we see the changes in the version and it will give 1.6.0.45.
  2.  In case of all the software which work on JAVA jar files , in case of any error first check the java version and environment variables.
  3. In Order to set Permgen Variable in linux we need to edit the run.sh file and run.conf file .In run.sh file we need to add the following line after the Ipv4 line.
  4. In order to find the IPv4 line , search IPv4 in run.sh file and add the following line after it.

JAVA_OPTS=”$JAVA_OPTS -XX:MaxPermSize=256m”

  1. Once the following line is added in the run.sh file then the Perm Size is increased to 256 MB, which prevents the Out of Memory: Permgen Space error.
  2. In case of Setup screen not shown while deploying build, the root cause of such error is invalid java home. Check the JAVA_HOME variable from the error console and correct it.
  3. Such Error can be found in the error console window, cut copy that path and try running on CMD to find the validity of the path.
  4. In such a case Export the JAVA_HOME again and correct the entry.
  5. Do close all the old Console Windows as they will show the old JAVA_HOME, in order to find out whether or not the JAVA_HOME is changed , open a new console and writeecho JAVA_HOME.
  6. While using the Linux Setup do note that in order to run the files, the specified command must be run to make the command run. For e.g.

sh ./<File Name or Process Name with extension>

  1. While running a JAR File like SyncMan , the following command will be used

Java –jar <Filename.jar>

  1. If faced access errors do make all the files executable in linux which can be done by the following command

chmod 0755 *.sh

 

 

 

 

 

                -Adempiere Support {India Portal}

Read More

Table & Field: Adempiere Customization

The Table and Column Window defines all tables with their columns

 

  • Table (header) definition – Note that the name of most tables is automatically syncronized.
  • Table Name  : AD_Table

image001

  • In Order to create a Table in AD, we need to follow the following steps:-
  1.   Create a table in DB
  2.   Define all the columns and keys (Primary And Foreign ) in DB
  3.   Once Table is declared and defined we need to go login in System Administrator and go to Table and Column and Create New Table
  4.  Keep the same name as in DB and click on Create Columns from DB.
  5.  Columns will be Created and we can check the columns in Columns Tab
  6.  If Columns are not visible do not click on create Columns again, just close the Window and open it again and columns will be present.
  7. The Columns created will be displayed in the columns window here and we need to define any table level references here such that the reference created automatically are overridden in the AD

[divider]

Column Window

Defines the columns of a table.

Note that the name of the column is automatically syncronized.

Table Name  : AD_Column

image003

The Column Window can perform the following things like:-

  • Making Column Mandatory
  • Setting Reference
  • Adding Callouts to field
  • Setting Display Logic and Default Logic and much more as we can see from the fields.

 

The System Element of the column is also defined here and we need to refer to the Table and Column as the Column System Element is set here.

Points to Note in Table & Column

ERROR TYPE 1:

  1. Table Direct used but values not Retrieving in the AD Window.

In Order to retrieve the values we need to select the Column as Identifier.  For the columns we need to show we can select  Identifier as such and it will be displayed in the drop down.

ERROR TYPE 2

  1. When u create window and tab and after performing all the processes trace back to the table and column and allocate the window in the table and column main tab such that we allocate the window to the Table

ERROR TYPE 3

  1. If we fail to define the window in the Table and Column level the following error will be displayed:

Window ID Invalid

And in case of Desktop Client the  Zoom is disabled.To enable the zoom in the existing tables select the window and allocate in the table

 

 

 

                                                                                                                                                                -Adempiere Support {India Portal}

Read More

Java Memory Allocation:Heap Space Error

Introduction and Reason:

image001

java.lang.OutOfMemoryError: Java heap space

Java applications are allowed to use a limited amount of memory. This limit is specified during application startup. To make things more complex, Java memory is separated into two different regions. These regions are called heap space and permgen:

image003

The size of those regions is set during the Java Virtual Machine (JVM) launch by specifying parameters such as -Xmx and -XX:MaxPermSize. If you do not explicitly set the sizes, platform-specific defaults will be used.

So – the “java.lang.OutOfMemoryError: Java heap space” error will be triggered when you try to add more data into the heap space area, but there is not enough room for it.

Note that there might be plenty of physical memory available, but if the heap size limit for this Java program has been hit, the “java.lang.OutOfMemoryError: Java heap space” error is thrown.

Cause of java.lang.OutOfMemoryError

There most common reason for the java.lang.OutOfMemoryError: Java heap space error is simple. You are trying to fit an XXL application into a S-sized Java heap space. That is – the application just requires more Java heap space to operate normally. Other causes for this OutOfMemoryError message are more problematic and are caused by a programming error:

  • Spikes in usage/data volume. The application was designed to handle a certain amount of users or a certain amount of data. Now, when the number of users or the volume of data suddenly spikes, the operation which functioned normally before the spike ceases to respond and triggers the java.lang.OutOfMemoryError: Java heap space error.
  • Memory leaks. A particular type of programming error will lead your application to constantly consume more memory. Every time the leaking functionality of the application is used it leaves some objects behind into the Java heap space. Over time the leaked objects consume all of the available Java heap space and trigger the already familiarjava.lang.OutOfMemoryError: Java heap space error.

 [divider]

The following points are worthy to note on this error:

  1. Once we achieve to the state of heap space error the system wont function further as no memeory is available for the functioning.
  2. The WebUI of Enterprise 2.0 wont even let you login in the client and the desktop client also .
  3. In Order to check the error we need to check the console that will tell us the error.
  4. Once we attain the error we have to close the server and restart it as there is no other way round.

Solution for java.lang.OutOfMemoryError

The first solution should be obvious – when you have ran out of a particular resource, you should increase the availability of such a resource. In our case: when your application does not have enough Java heap space memory to run properly, fixing it is as easy as altering your JVM launch configuration and adding (or increasing if present) the following:

-Xmx1024m

In order to increase the memory in Enterprise 2.0 you need to follow the following steps:

  1. Increase the Heap Space memory in E2, You have to change the Xmx variables in following files:
  2. Open in notepad and search Xmx and Edit.
  3. AdempiereEnv open in notepad and edit
  4. AdempiereEnv.properties

[divider]

These 2 files are placed in Ossagho folder when u extract the build.

  1. Run.bat – Right click and edit the file
  2. While editing the file keep the Xms and Xmx in proportion i.e if we double the mimimum we also have to double the maximum limit .
  3. The default values are Xms – 64M and Xmx – 512M , and we can increase them to any values till RAM supports changes.
  4. Some sample values which can be feeded are:

i.      Xms 128M                     Xmx 1024M

ii.      Xms 192M                     Xmx 1536M

  1. Once we change the values in both the files we need to run silentSetup of Adempiere which will reflect all the values in the E2 Server and all changes are enforced.
  2. Restart the server and we will notice that console shows updated Values.

 

 

                                                                                                                        -Adempiere Support {India Portal}

Read More

CUSTOMIZING ADEMPIERE 3.6

In Order to customize Adempiere we need to have the following tools with us.

  • Eclipse (Any Version for JAVA)
  • Google Chrome(Or Any Browser)
  • Advance Java J2EE Knowledge

Once we have all the basic requirements we need to know how to Debug the Eclipse.

If You still don’t know how to debug the Eclipse you can Refer to the ‘How to Debug Eclipse’ Document and get familiar with Debugging.

When we are past all these we are ready to Customize Adempiere Completely i.e make its our own.

[divider]

Modify the SYSTEM PASSWORD

In the Eclipse Code find the Class ConfigurationData.java and edit the following line

 

Line 303:    setDatabaseSystemPassword(“system”);

 

Here the method which is called in setDatabaseSystemPassword in which we need to set the DB Password and which is the Default System Password here. Here we Set the Password as System.

[divider]

Also if u need to change any other field which is shown during Setup of Adempiere you can change the Default Values here like:

 

  setDatabaseSystemPassword(“system”);

  setDatabaseServer(hostName);

  setDatabaseUser(“adempiere”);

  setDatabasePassword(“adempiere”);

[divider]

Modify the KEY DIALOG VALUES

If we need to modify the Key Dialog Values we need to modify the KeyStoreMgt.java class in Adempiere.

 

String o = mgt.organizationUnit != null   ? mgt.organizationUnit:OSSAGHO”;

String l = mgt.location != null    ? mgt.location : “Ludhiana”;

String s = mgt.state != null    ? mgt.state  : “Punjab”;

String c = mgt.country!=null ?mgt.country:      System.getProperty(“user.country”);

Here as shown in the class we have line no 292,293,294,295 on KeyStoreMgt.java such as when we need to change the default values of the Key Store Dialog we need to change the Default values of Adempiere as stated in the Blue Above. Her o stands for Organization , l for location , s for state , c for country.

 

Once u perform changes in it, and u save you can check the changes by deploying the build .While Deployment  we can check the changes that are effected in Key Store Dialog and Setup Form.

 

 

 

                                                                        -Adempiere Support {India Portal}

Read More

HOW TO PERFORM DEBUGGING IN ENTERPRISE 2.0 – WEB UI

Debugging allows you to run a program interactively while watching the source code and the variables during the execution.

By breakpoints in the source code you specify where the execution of the program should stop. To stop the execution only if a field is read or modified, you can specify watchpoints .

Breakpoints and watch points can be summarized as stop points.

Once the program is stopped you can investigate variables, change their content, etc.

[divider]

Now once the environment is set up in Adempiere we need to start the Product in Debug Mode of Desktop UI. In order to do that you must follow the following steps:-

  • Right Click on the Project and select the Debug As and Debug on Server which has Tomcat already selected.

image001

  • When we have entered the Debug Mode, the First Class that comes up is Adempiere Class.
  • In Case of WEB UI it goes to Web UI Servlet.java which is the class for zk Web UI
  • Then the Login Page Opens Up, now in Order to debug we need to apply debug points which signify that the compiler needs to stop here while processing the code and wait for the user confirmation such that the code stops at that point.
  • We can Apply Debug points by double clicking on the code such that the Debug Point is created and once in Debug Mode the compiler will stop there.
  • Eclipse provides buttons in the toolbar for controlling the execution of the program you are debugging. Typically it is easier to use the corresponding keys to control this execution.
  • You can use the F5, F6, F7 and F8 key to step through your coding. The meaning of these keys is explained in the following table.

 

Table 1. Debugging key bindings / shortcuts

Key Description
F5 Executes the currently selected line and goes to the next line in your program. If the selected line is a method call the debugger steps into the associated code.
F6 F6 steps over the call, i.e. it executes a method without stepping into it in the debugger.
F7 F7 steps out to the caller of the currently executed method. This finishes the execution of the current method and returns to the caller of this method.
F8 F8 tells the Eclipse debugger to resume the execution of the program code until is reaches the next breakpoint or watch point.
  • The following picture displays the buttons and their related keyboard shortcuts.

image003

 

  • The call stack shows the parts of the program which are currently executed and how they relate to each other. The current stack is displayed in the Debug view.

image004

  • Changing variable assignments in the debugger

The Variables view allows you to change the values assigned to your variable at runtime. This is depicted in the following screenshot.

image006

  • Now when we enter in Debugging Mode some classes need to be remembered in order to debug the code. For Instance we need to start with the Generic Class
  • Start by applying debug mode in the Web UI Servlet.java Class in the Init() such that the compiler stops in the method and Debug Mode is present.
  • Once in the class u can use F5, F6, F7 and F8 key to step through your coding and go through the flow.

 

For Different Processes and Windows we need to have multiple processes or classes such that when we need to Debug the process we call that Class.

The index for such is as Follows:-

Class in Eclipse Process
MInOut.javaMInOutLine.java Material Receipt, Shipment(Customer), Vendor Return, Customer Return,
MOrder.javaMOrderLine.java Purchase Order  &  Sales Order,
MInvoice.javaMInvoiceLine.java

MInvoiceTax.java

Invoice (Vendor) and Customer (Invoice) 

For Calculating Invoice Tax.

BPartner.java Business Partner in Adempiere
ALogin.java Login Class For Adempiere  such that while in case of change of login page or anything else in Login
AMenu.java To change the Menu Entries we need to change the class when we need to add entry in the Adempiere ERP.
WCreateFromWindow.java To make Menus in WEBUI and add buttons.
WCreateBatchSerialInoutLine.javaWCreateInventorySerialInOutLine.java Create batches in WebUI and edit and add CodeCreate Inventory Batches in Physical Inv and Internal Use Inventory
AbstractADWindowPanel.java Debug this Class for adding buttons and defining where buttons go on click.
Product.java To Add Products such and define parameters in it.
MInventory.javaMInventoryLine.java Inventory Management such that,  Inventory and line Qty are Managed
MRMALine.java Processing Returns such that , both Customer RMA and Vendor RMA are created here.
MPayment.javaMPaymentAllocate.java To Process Payments,  and to Allocate Payments to the InvoicesAllocate Payments , to the Invoices

 

  • If u need to debug these Processes u need to Apply Debug Points in the respective classes such that to change code there.
  • If u need to search any class in Eclipse u need to use the combination of Ctrl+Shift+T and enter the class name.
  • Use * with the name to increase your search criteria.
  • If u need to skip Debug points u can use the Button on the top of eclipse which looks like this    image008
  • Until unless u release this button the Debug won’t work.
  • Some Classes here as different from Desktop UI such that, in batch module in case of Desktop we have VCreateBatchSerialInOutLine.java while in case of Window we have WCreateBatchSerialInOutLine.java due to difference of frameworks.

 

 

-By Adempiere Support {India Portal}

Read More

Dashboard Management

Adempiere has very good mechanism to show a glimpse of overall enterprise performance at single location through dashboard concept. Using dashboard, user can see all the required information in one place. Following is the screenshot of the Dashboard:

image001

With the help of Dashboards, we can show the user whatever he wants from the System and hence can fulfil the user Requests about anything. For e.g. if a user want to know which are the new joined Business Partners we can make a Bar Chart and then we can completely scale the data as present.

Here it shows the Invoice Gross Revenue and Service Requests Status which on double click shows the respective menus and hence shows the data related to that performance parameter.

While we create the dialler for the process, which will show the status of the new added customers

image003

[divider]

Creating Dashboard in Adempiere

  1. In Order to create Dashboard Elements we need to follow the steps as mentioned below:
    1. Open the Performance Goal Window found in System Admin and enter the data as follows:

image005

Here enter Name of the Dashboard widget and color schema should be selected as “Green (50) – Yellow (100) – Red”.

  1. Select the Role and User if you want to specify this or restrict this dashboard modification to a particular user.
  2. Select the Measure from the Measure check box. If not defined we can define the Measure with the Performance Measure Window.

image007

  1. Select Measure Calculation and select the measure here.

image009

  1. Add SQL Query in the Performance Measure Calculation, which retrieves the data to be shown in the actual widget. i.e For e.g  if we want to view only the Number of Customers which are new then we need to use the SQL select query and this will select all the customers.
  2. Select the Measure Scope and Measure Display in the Window in point 1 and select the month and year in the Measure Window.
  3. Once you define the Measure Goal completely , the dial board will be visible .
  4. In Order to display the Grid with data in it , we need to create record in it which can be done as follows:

image011            5. Here add the Grid Name and Select the Goal and window to be linked with the Grid which will be                      displayed on the dashboard.

 

The Dashboard will be created hence, and we will get the desired dashboard widgets on the Dashboard. The look and feel can be changed once dialler is displayed.

 

 

 

 

 

-Adempiere Support {India Portal}

Read More

Window, Tab & Field – Adempiere

The Window Tab defines each window in the system. The default flag indicates that this window should be used as the default Zoom windows for the tables in this window.

Table Name: AD_Window

image001

Here we will define the new Window and create tabs later like the following:

Description : Tab definition within a window holds fields

Help : The Tab Tab defines each Tab within a Window. Each Tab contains a discrete selection of fields. Note that the display and read only logic is evaluated when loading the window.

Table Name  : AD_Tab

image003

  1. While defining TAB define the table, and create fields in the tab come to field sequence and arrange the sequence of fields.

Table Name  : AD_Field

image005

If we wanna change the name of fields we can  do it from here .

2. The Field Tab defines the Fields displayed within a tab. Changes made to the Field Tab become visible after restart due to caching. If the Sequence is negative, the record are ordered descending. Note that the name, description and help is automatically synchronized if centrally maintained.

Table Name  : AD_Field

image007

Points to Note in creating Window, Tab & Field

 

  1. Create Window , Tab & Field and then in Tab Window define the table allotted with the tab and then create Fields.
  2. ReArrange Fields from the Field Sequence and edit any fields if needed modification on the Window level.
  3. Edit the name of the fields and modify the spaces and Alignment of the field.

 

Points to Note in Defining Window, Tab & Field:

ERROR TYPE 1

  1. When u create window and tab and after performing all the processes trace back to the table and column and allocate the window in the table and column main tab such that we allocate the window to the Table

 

ERROR TYPE 2

 

  1. If we fail to define the window in the Table and Column level the following error will be displayed:

Window ID Invalid

And in case of Desktop Client the  Zoom is disabled.To enable the zoom in the existing tables select the window and allocate in the table

 

ERROR TYPE 3

  1. The Reference can be defined on 2 phases in Adempiere
  2. Table level
  3. Window Level

image009

 

  1. Here reference can be over rided that is defined in the table level, such  that we can use it to retrieve the values of table in extreme cases:
  2. For e.g we can see such an example of extreme case in which reference overwrite is helpful:

In case of Visitor Management we have defined doors which are used by the visitor for the entry and exit . We have used 2 columns for entry door and exit door and we need to show in both, the data stored in Door Master Entrance Door.

If we take 2 columns Entrance Door ID and Exit Door ID in the table and use Table Direct to retrieve the data then the data will be definitely retrieved but we will face errors while Model Class Generation as the complier will try to find the table Exit Door. Hence we need to modify the Reference Type set on the Table Level.

 

  1. For Such cases we need to override the reference and use in Window Tab and Field and select the reference as ‘Table’ and define the reference here.

 

 

ERROR TYPE 4

  1. While making a Tab Read Only we need to tick on the tick box on the Tab Field which is like this

image011

As Seen here we have 2 tick boxes Read Only and Insert Record on the Tab Level.

Now when we click on Read Only and save the record we will notice the fact that the insert

Record is automatically disabled and even if we uncheck the read only the Insert record still  remains disabled here .

Even if we open the window tab and field again and uncheck and check again the Insert Record remains disabled.

We need to manually tick the Insert Record again in order to make the record work such

the record insertion is enabled in the tab.
 

 

 

 

 

 

 

                                                                                                                                                                -Adempiere Support {India Portal}

Read More

Creating Window GUI in Eclipse

WindowBuilder – is a powerful and easy to use bi-directional Java GUI Designer

WindowBuilder is composed of SWT Designer and Swing Designer and makes it very easy to create Java GUI applications without spending a lot of time writing code. Use the WYSIWYG visual designer and layout tools to create simple forms to complex windows; the Java code will be generated for you. Easily add controls using drag-and-drop, add event handlers to your controls, change various properties of controls using a property editor, internationalize your app and much more.

WindowBuilder is built as a plug-in to Eclipse and the various Eclipse-based IDEs (RAD, RSA, MyEclipse, JBuilder, etc.). The plug-in builds an abstract syntax tree (AST) to navigate the source code and uses GEF to display and manage the visual presentation.

Generated code doesn’t require any additional custom libraries to compile and run: all of the generated code can be used without having WindowBuilder Pro installed. WindowBuilder Pro can read and write almost any format and reverse-engineer most hand-written Java GUI code. It also supports free-form code editing (make changes anywhere…not just in special areas) and most user re-factorings (you can move, rename and subdivide methods without a problem).

image001

 

[divider]

 

How to Enable GUI  i.e  JFrame and JWindow :

In Order to enable the Window Builder in Eclipse we will do the following steps:-

  1. Go to the Following link : http://www.eclipse.org/windowbuilder/download.php
  2. Copy the appropriate update site link according to the version of Eclipse you are using and copy the link URL.
  3. Once you have the Link URL paste it in the Eclipse.
  4. For pasting the URL open the following in the Help Menu.

image003

 

 

5. Click the Install New Software in Eclipse , and paste the link as follows.

image005

 

6. Click on Add Button and paste the URL there , give a suitable name to the link and save the link.

7. Once u add the link select the link from the drop down and you will get the repositories ready to be downloaded.

image007

 

8. Check all features to be installed in the “Install” dialog

9. Click the “Next” button

10. Accept the license terms and allow the software to Install itself on the Eclipse.

11. Once the Installation Completes we are good to go with the window building, Eclipse will demand a restart of the IDE.

12. After Restarting the IDE , go to New u will notice the following

image009

13. A new entry will be added named Window Builder, Click on the Application Window here and a new Application                            Window

14. Click on the Application Window and click Finish to create a new GUI and provide the Swing App with a Name.

15. Click on the Design tab to note the Design and Source tab for the code

image011                    16. Choose the Absolute Layout before selecting any elements and then add labels or text fields by click and leave on                            the form.

17. For Testing click either on the GUI and select ‘Test/Preview’ to check GUI

18. If we want to run the code, right click on the code and select the run from Java Application.

19. The GUI will be running with the changes here.

 

 

 

 

 

 

                                                                                                                                                -Adempiere Support {India Portal}

 

 

Read More

HOW TO PERFORM DEBUGGING IN ENTERPRISE 2.0 – DESKTOP UI

Debugging allows you to run a program interactively while watching the source code and the variables during the execution.

By breakpoints in the source code you specify where the execution of the program should stop. To stop the execution only if a field is read or modified, you can specify watchpoints .

Breakpoints and watchpoints can be summarized as stop points.

Once the program is stopped you can investigate variables, change their content, etc.

[divider]

Now Once the environment is set up in Adempiere we need to Start the Product in Debug Mode of Desktop UI. In order to do that you must follow the following steps:-

image001

  • Click on the Debug Mode and select the Debug Configuration already made by us at time of setting up Desktop Environment.
  • When we have entered the Debug Mode, the First Class that comes up is Adempiere Class.
  • Then the Login Page Opens Up, now in Order to Debug we need to apply debug points which signify that the compiler needs to stop here while processing the code and wait for the user confirmation such that the code stops at that point.
  • We can Apply Debug points by double clicking on the code such that the Debug Point is created and once in Debug Mode the compiler will stop there.
  • Eclipse provides buttons in the toolbar for controlling the execution of the program you are debugging. Typically it is easier to use the corresponding keys to control this execution.
  • You can use the F5, F6, F7 and F8 key to step through your coding. The meaning of these keys is explained in the following table.

 [divider]

 

Table 1. Debugging key bindings / shortcuts

Key Description
F5 Executes the currently selected line and goes to the next line in your program. If the selected line is a method call the debugger steps into the associated code.
F6 F6 steps over the call, i.e. it executes a method without stepping into it in the debugger.
F7 F7 steps out to the caller of the currently executed method. This finishes the execution of the current method and returns to the caller of this method.
F8 F8 tells the Eclipse debugger to resume the execution of the program code until is reaches the next breakpoint or watch point.
  • The following picture displays the buttons and their related keyboard shortcuts.

image003

  • The call stack shows the parts of the program which are currently executed and how they relate to each other. The current stack is displayed in the Debug view .

image004

  • Changing variable assignments in the debugger

The Variables view allows you to change the values assigned to your variable at runtime. This is depicted in the following screenshot.

image006

  • Now when we enter in Debugging Mode some classes need to be remembered in order to debug the code. For Instance we need to start with the Generic Class
  • Start by applying debug mode in the ALogin.JAVA Class in the jbInit() such that the compiler stops in the method and Debug Mode is present.
  • Once in the class u can use F5, F6, F7 and F8 key to step through your coding and go through the flow.

 

For Different Processes and Windows we need to have multiple processes or classes such that when we need to Debug the process we call that Class.

The index for such is as Follows:-

Class in Eclipse Process
MInOut.java

MInOutLine.java

Material Receipt, Shipment(Customer), Vendor Return, Customer Return,
MOrder.java

MOrderLine.java

Purchase Order  &  Sales Order,
MInvoice.java

MInvoiceLine.java

MInvoiceTax.java

Invoice (Vendor) and Customer (Invoice)

For Calculating Invoice Tax.

BPartner.java Business Partner in Adempiere
ALogin.java Login Class For Adempiere  such that while in case of change of login page or anything else in Login
AMenu.java To change the Menu Entries we need to change the class when we need to add entry in the Adempiere ERP.
Product.java To Add Products such and define parameters in it.
VCreateBatchSeraialInOutLine.java

VCreateInventorySerialInOutLine.java

Create Batches in Adempiere, and edit the features in Batch Management
MInventory.java

MInventoryLine.java

Inventory Management such that,  Inventory and line Qty are Managed
MRMALine.java Processing Returns such that , both Customer RMA and Vendor RMA are created here.
MPayment.java

MpaymentAllocate.java

To Process Payments,  and to Allocate Payments to the Invoices

 

  • If u need to debug these Processes u need to Apply Debug Points in the respective classes such that to change code there.
  • If u need to search any class in Eclipse u need to use the combination of Ctrl+Shift+T and enter the class name.
  • Use * with the name to increase your search criteria.
  • If u need to skip Debug points u can use the Button on the top of eclipse which looks like thisimage008
  • Until unless u release this button the Debug Won’t work.

 

 

 

-By Adempiere Support {India Portal}

Read More

WORKING WITH JASPER REPORTS –(IREPORT 5.0.1)

Jasper Report is an open source java reporting engine, is Java based and doesn’t have its own expression syntax.

As JasperReports is a Java class library, and is not meant for end users, but rather is targeted towards Java developers , hence we use IReport for users who need to add reporting capabilities to their applications.

[divider]

Report Definition file structure (jrxml):-

Jasper design file –jrxml- contains the following elements:
<jasperReport>: the root element.
<title>: its contents are printed only once at the beginning of the report
<pageHeader> – its contents are printed at the beginning of every page in the report.
<detail> – contains the body of the report, repeated by n number of results
<pageFooter> – its contents are printed at the bottom of every page in the report.
<band> – defines a report section, all of the above elements contain a band element as its only child element.

[divider]

Only the root element is mandatory, the rest of elements are optional.

JasperReport works in a way similar to a compiler and an interpreter. See fig. 3.1. The user design a report coding it in XML in agreement to tags and attributes defined in a file called jasperreports.dtd (part of JasperReports). Using XML a user define the entire report, describing where place texts, images, lines, rectangles, how to retrive data, how to make certain calculations to show subtotals, etc…

image001

 

Fig.3.1: How JasperReports works.

This XML source file must be compiled in order to produce a real report. The compiled version of the source is named “jasper file” (it ends with .jasper). A jasper file is a compiled report source.
When we have a jasper file, we need another thing in order to produce a report: we need data. This is not always true. In some cases We could want to generate a report that don’t shows dynamic data, but i.e. only static text, but this can be reduced to a report that has only an empty record. To supply this records to the jasper engine we need to present it using a special jasperreports specific interface named JRDataSource. A datasource + a jasper file = a print. A print can then be exported in many formats like PDF, HTML, XML, XLS, CVS, etc… The export will be done using special classes the implement specific exporters. 

 

3.2 Compilation end export of reports
For a newbie, design and create the jasper file is the hardest work. When you have designed and compiled your jasper file, you can use the JasperReport library to dinamycally fill your report in several enviroments like a web application (using i.e. java servlet, but I have succesfully used JasperReports for generating PDF reports calling it from a PHP script…).
Jasper make available a special viewer to display a report preview, designed for swing based traditional java applications.

image003

Fig.3.2: JasperReports can easily integrated in a Web application as in a java swing based program.

3.3 Our first very simple report
iReport provide to jasper reports users a visual interface to build reports, generate jasper files and test prints. iReport born as development tool, but it can be used as an office tool to retrieve and print data stored in a database, without pass through another application.

image004

Fig.3.3: How JasperReports works.

iReport can read and modify both jasper XML and jasper files. Trought jasperreports, it’s able to compile XML to jasper files and “run reports” to fill it using several types of JRDataSource and export the result to PDF,HTML,XLS,CSV,…

 [divider]

Points to Note in Different Types of Jasper Reports :-

  1. All fields need to be inside the band in which it is defined such that no field or label is observed with a red triangle on it. In such case report will not get compiled.
  2. Do take care of the band in Jasper Report such that Page Footer repeats on every Page while summary comes only on the end of  the report.
  3.  SQL Queries used in the IReport must be first tested on the SQL Server edition or any 3rd party Application and query shouldn’t be straight forward feeded to report.
  4. SQL Query copied in IReport should be free of Commented Code and semicolons as these will lead to non compilation of query.
  5. Just enter the column name in System Element and press Enter, the System will automatically correct the case of the name and copy this name to your report parameter.
  6. Do not give spaces in Report Name or in Parameters, as this will lead to Process Error null, or Could not find Report Error at runtime.
  7. While using Parameters in SQL in IReport, make sure while using like operator , insert “!” in the Parameter before the name.
  8. While working with subreports, provide a path which is dynamic such that when u change the location of the report the subreport doesn’t stops functioning

-Try Providing the path of WAR file such that , when u need to change u just need to change the Address of Server in the same format as defined in Report and Process

If the need of ever hiding the Parameters Arises, i.e. hardcoding them from the front, u can follow the changes and the parameter wont be displayed on running of report.

image006

  • Make the name of Parameter Blank by Just inserting a space in the name or Add the name and use Display logic
  • In the Display Logic Field, add a check of the Parameter which can not be null like Organization which will hide the field too.
  • Organization or any parameter will be used with ‘=’ sign in Display Logic and ‘is null wont work in Enterprise version’.
  • Using the current modification we can segregate many reports into one and just place a single jrxml file in the WAR and create multiple menus or even a single menu and use list parameter in it.

 [divider]

  1. CROSSTAB REPORTS
    • The crosstab must be placed in Summary Only as then only the report will Compile, Placing the Report in any other band will lead to error.
    • In case of report while getting Sub Totals and Grand Totals , just add the variable in the crosstab and change the Calculation Type to  ‘ Sum ’
    • While Creating Crosstab if all the variables are not added, we need to add them later once the crosstab is created by adding them in measures section.
    • Once added in Measures Section we just need to drag and drop the fields in the report such that it automatically gets arranged.

 

 

 

                                                                                                                                                                                                       -By Adempiere Support {India Portal}

Read More