ESI Contributions in Global payroll for India

Common wisdom
Employee State Insurance (ESI) is a type of insurance scheme that addresses Indian employees whose gross wage is INR 15000 or lesser. Employee contributes 1.75% and Employer contributs 4.75 of the monthly gross wage.

Common questions

Question 1: When an employee receives an increment, can the Employer stop ESI deductions and contributions from that month onwards?

The answer is “No”. In the scheme of ESI, the whole financial year is split into two blocks – April to September and October to March.

When an employee has contributed to ESI atleast once in a block, the employee must continue to contribute to ESI for the rest of the block. Lets say, someone receives an increment, from 1-June onwards, that bumps their ESI gross from 14000 to 17000. Since the employee has contributed to ESI in April and May, he/she must continue to contribute to ESI until September.

Question 2: In that case, what is the wage based on which ESI should be calculated?

There is a common misconception that when ESI gross for an employee exceeds 15000 (the limit set by govt and revised from time to time), ESI deductions should be based on the limit. No, ESI should be deducted on the actual ESI gross regardless of the limit.

Going back to the example above, the employee’s ESI deduction in June will be 1.75% of 17000 and not 1.75% of 15000.

How is this handled in PeopleSoft’s Global Payroll for India?

ESI deduction is based on Generation control ESI GC ENROLL, which is based on ESI FM ENROLL GC. I have re-produced the formula and left a few comments also.

Lines 5 through 36 handle block 1, while lines 37 and later handle block 2.

Look out for AC[ESI_FYTDA] on line 27. Anytime that accumulator is greater than zero, the generation control turns true.

Similarly, look out for the historical rule HR[ESI HR 2ND SEG]. The historical rule computes total of ESI deductions made in block 2 (October to March). Anytime it turns out non-zero, the generation control is set to true.


IF AC[ESI GROSS WAGES] > 0 THEN

IF ( AR[ESI AR ENROLLMENT] = 1 AND FM[AGE60 FM] = 1 AND VR[ESI VR EFF STATUS] = 'A' ) THEN /* If enrolled in ESI and Aged < 60 */

IF FM[ESI FM 1ST SEG] = 1 THEN /* In block 1 - Period  b/w 1st April and 30th Sep*/

IF FM[ESI FM 1ST MTH SEG] = 1 THEN

IF AC[ESI GROSS WAGES] < VR[ESI VR GROSS CHECK] THEN /* ESI Gross Check = 15000*/

1 >> FM[ESI FM ENROLL GC]

ENDIF

ELSE

IF SY[LAST HIRE DT] >= SY[PERIOD BEGIN DATE] THEN /*New hire and first payroll*/

IF ( AC[ESI GROSS WAGES] < VR[ESI VR GROSS CHECK] ) THEN

1 >> FM[ESI FM ENROLL GC]

ENDIF

ELSE

IF ( AC[ESI GROSS WAGES] < VR[ESI VR GROSS CHECK] OR AC[ESI_FYTDA] > 0 ) THEN

1 >> FM[ESI FM ENROLL GC]

ENDIF

ENDIF

ENDIF

ELSE /* In block 2 - Period Begins after 30th Sep*/

IF FM[ESI FM 1ST MTH SEG] = 1 THEN

IF AC[ESI GROSS WAGES] < VR[ESI VR GROSS CHECK] THEN

1 >> FM[ESI FM ENROLL GC]

ENDIF

ELSE

IF SY[LAST HIRE DT] >= SY[PERIOD BEGIN DATE] THEN /* New hire and first payroll*/

IF ( AC[ESI GROSS WAGES] < VR[ESI VR GROSS CHECK] ) THEN

1 >> FM[ESI FM ENROLL GC]

ENDIF

ELSE

HR[ESI HR 2ND SEG] >> VR[GP TEMP001 NUM] /* Historical rule to identify ESI deductions in Block 2*/

IF ( AC[ESI GROSS WAGES] < VR[ESI VR GROSS CHECK] OR VR[ESI TOT2ND SEG VAL] > 0 ) THEN

1 >> FM[ESI FM ENROLL GC]

ENDIF

ENDIF

ENDIF

ENDIF

ENDIF

ELSE

0 >> FM[ESI FM ENROLL GC]

ENDIF

Sending emails from Openbravo workflows

Sometime ago, Openbravo made that big leap by integrating their wonderful ERP with a workflow engine. The Workflow Engine of choice was Activiti. You can download the module from here. Refer to the wiki page for more background.

The integration module available on forge is based on Activiti 5.8.

Its a world of goodness – Openbravo and Activiti together. Once you and your customers start experiencing the results, there is no going back. Workflows will climb their way up from a distantly relevant “Nice to Have” to an enriching “That’s easy, lets have that” position in your scheme of ERP implementation.

While discussing Openbravo workflows for an organization, a customer asked “Can I have an email sent at this point in the flow?”. Activiti makes it easy to send out emails through email tasks. There are a number of articles on the internet, so I am not delving into email tasks now.

They are an organization that have their email hosted on a google domain. For example, if the emails were sent out using gmail, the activiti.cfg.xml would look like this:

<property name=”mailServerPort” value=”587″ />
<property name=”mailServerHost” value=”tls://smtp.gmail.com:587″ />
<property name=”mailServerDefaultFrom” value=”sender@gmail.com” />
<property name=”mailServerUsername” value=”sender” />
<property name=”mailServerPassword” value=”*******” />
<property name=”mailServerUseTLS” value=”true” />

They are an organization that have their email hosted on a google domain.

When the workflow was fired, Activiti produced error messages and it was evident that it didn’t like the TLS part of config. It turns out that Activiti 5.8 doesn’t support useTLS parameter.

TLS is addressed in this patch. We applied the patch on top of Activiti 5.8 thats shipped with the integration module and that did the trick for us, and now emails go out from Openbravo.

Optimus HCM – Leave approval workflow

Optmius HCM, the Human Capital Management solution from Fugo, is built on the Openbravo ERP framework. Leave approval process is workflow enabled using Openbravo-Activiti integration module.

Watch the screencast from here

Oracle Database 12cR1 Installation on RHEL 6

Oracle Installation  of 12cR1 method’s are clearly indicated below. Each and every step is crucial to perform a error free setup. The following Installation is performed on a RHEL 6 64 Bit OS. The software Binaries vary from 32 and 64 Bit, be sure to download the correct software binaries.The files shown below are those for 64 Bit Linux OS on RHEL 6. Download only the first two files for installing Database Software.

linuxamd64_12c_database_1of2.zip
linuxamd64_12c_database_2of2.zip

Let’s get started with the Installation, there are two major parts of any Oracle Database Installation.

  1. Operating System Settings
  2. Oracle Database Installation

Let’s start with each one of them,

1. Operating System Settings

All settings indicated here are to be performed after RHEL 6 64 Bit OS Installations

  • Ensure hostname and IP are set up properly, you will need to do the check same after Linux 64 Bit Installation.
[root@rhel1 ~]# more /etc/hosts
127.0.0.1 localhost
192.168.1.10 rhel1
192.168.1.11 rhel2
[root@rhel1 ~]# ifconfig -a | grep 192
 inet addr:192.168.1.12 Bcast:192.168.1.255 Mask:255.255.255.0
[root@rhel1 ~]# more /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=rhel1
GATEWAY=192.168.1.1
  • Disable Firewall Settings : Firewall Settings can cause network issues while communicating with Applications.

[root@rhel1 ~]# service iptables save
[root@rhel1 ~]# service iptables stop
[root@rhel1 ~]# chkconfig iptables off
[root@rhel1 ~]# service network restart

Kernel Settings : Kernel Settings are of utmost importance to configure system wide configurable memory and allowable Port Ranges

fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500
  • Ensure the /etc/sysctl.conf settings are setup fine, the following command should not throw any error’s
[root@rhel1 ~]# sysctl -p
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500
  • Create Users,Groups & Folder Structures
[root@rhel1 ~]# groupadd -g 54321 oinstall
[root@rhel1 ~]# groupadd -g 54322 dba
[root@rhel1 ~]# groupadd -g 54323 oper
[root@rhel1 ~]# useradd -u 54321 -g oinstall -G dba,oper oracle
[root@rhel1 ~]# passwd oracle
[root@rhel1 ~]# mkdir -p /u01/app/oracle/product/11.2.0/db_1
[root@rhel1 ~]# mkdir -p /u01/softwares
[root@rhel1 ~]# chown -R oracle:oinstall /u01
[root@rhel1 ~]# chmod -R 775 /u01
  • Add the following Entries to /etc/security/limits.conf
more /etc/security/limits.conf
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft stack 10240
oracle hard stack 32768
  • Change Settings in /etc/security/limits.d/90-nproc.conf and /etc/selinux/config as shown below
/etc/security/limits.d/90-nproc.conf

# Comment the following Line
* soft nproc 1024

# Include the following Line
* - nproc 16384

/etc/selinux/config
SELINUX=permissive
  • Transfer the Oracle Database Media files linuxamd64_12c_database_1of2.zip and  linuxamd64_12c_database_1of2.zip to /u01/softwares

Mount the RHEL 6 64 bit CD or you can mount the ISO image

[root@rhel1 ~]# mkdir -p /media/rhel6iso
[root@rhel1 ~]# mount -o loop /u01/softwares/rhel_6.2_x86_64_disc_1.iso /media/rhel6iso
[root@rhel1 ~]# df -h
The df -h output shows you that the ISO media for RHEL6 64bit ISO has been mounter

The df -h output shows you that the ISO media for RHEL6 64bit ISO has been mounted

  • Transfer ( using sftp, ftp in bin mode,scp,filezilla, etc.. ) Oracle Database Media files p10404530_112030_Linux-x86-64_1of7.zip and p10404530_112030_Linux-x86-64_2of7.zip to /u01/softwares. Mount the RHEL 6 64 bit CD or you can mount the ISO image
[root@rhel1 ~]# mkdir -p /media/rhel6iso
[root@rhel1 ~]# mount -o loop /u01/softwares/rhel_6.2_x86_64_disc_1.iso /media/rhel6iso
[root@rhel1 ~]# df -h
----------The df -h output shows you that the ISO media for RHEL6 64bit ISO has been mounter
[root@rhel1 ]# cd /media/rhel6iso/Packages
[root@rhel1 Packages]# touch /u01/softwares/rpm_inst.sh
[root@rhel1 Packages]# echo "cd /media/rhel6iso/Packages" > /u01/softwares/rpm_inst.sh
[root@rhel1 Packages]# ls -l | awk '{ print $9 }' | grep binutils > /tmp/rpm_inst.sh
[root@rhel1 Packages]# ls -l | awk '{ print $9 }' | grep compat-libcap1 >> /tmp/rpm_inst.sh
[root@rhel1 Packages]# ls -l | awk '{ print $9 }' | grep compat-libstdc++-33 >> /tmp/rpm_inst.sh
[root@rhel1 Packages]# ls -l | awk '{ print $9 }' | grep compat-libstdc++-33.i686 >> /tmp/rpm_inst.sh
[root@rhel1 Packages]# ls -l | awk '{ print $9 }' | grep gcc >> /tmp/rpm_inst.sh
[root@rhel1 Packages]# ls -l | awk '{ print $9 }' | grep gcc-c++ >> /tmp/rpm_inst.sh
[root@rhel1 Packages]# ls -l | awk '{ print $9 }' | grep glibc >> /tmp/rpm_inst.sh
[root@rhel1 Packages]# ls -l | awk '{ print $9 }' | grep glibc.i686 >> /tmp/rpm_inst.sh
[root@rhel1 Packages]# ls -l | awk '{ print $9 }' | grep glibc-devel >> /tmp/rpm_inst.sh
[root@rhel1 Packages]# ls -l | awk '{ print $9 }' | grep glibc-devel.i686 >> /tmp/rpm_inst.sh
[root@rhel1 Packages]# ls -l | awk '{ print $9 }' | grep ksh >> /tmp/rpm_inst.sh
[root@rhel1 Packages]# ls -l | awk '{ print $9 }' | grep libgcc >> /tmp/rpm_inst.sh
[root@rhel1 Packages]# ls -l | awk '{ print $9 }' | grep libgcc.i686 >> /tmp/rpm_inst.sh
[root@rhel1 Packages]# ls -l | awk '{ print $9 }' | grep libstdc++ >> /tmp/rpm_inst.sh
[root@rhel1 Packages]# ls -l | awk '{ print $9 }' | grep libstdc++.i686 >> /tmp/rpm_inst.sh
[root@rhel1 Packages]# ls -l | awk '{ print $9 }' | grep libstdc++-devel >> /tmp/rpm_inst.sh
[root@rhel1 Packages]# ls -l | awk '{ print $9 }' | grep libstdc++-devel.i686 >> /tmp/rpm_inst.sh
[root@rhel1 Packages]# ls -l | awk '{ print $9 }' | grep libaio >> /tmp/rpm_inst.sh
[root@rhel1 Packages]# ls -l | awk '{ print $9 }' | grep libaio.i686 >> /tmp/rpm_inst.sh
[root@rhel1 Packages]# ls -l | awk '{ print $9 }' | grep libaio-devel >> /tmp/rpm_inst.sh
[root@rhel1 Packages]# ls -l | awk '{ print $9 }' | grep libaio-devel.i686 >> /tmp/rpm_inst.sh
[root@rhel1 Packages]# ls -l | awk '{ print $9 }' | grep libXext >> /tmp/rpm_inst.sh
[root@rhel1 Packages]# ls -l | awk '{ print $9 }' | grep libXext.i686 >> /tmp/rpm_inst.sh
[root@rhel1 Packages]# ls -l | awk '{ print $9 }' | grep libXtst >> /tmp/rpm_inst.sh
[root@rhel1 Packages]# ls -l | awk '{ print $9 }' | grep libXtst.i686 >> /tmp/rpm_inst.sh
[root@rhel1 Packages]# ls -l | awk '{ print $9 }' | grep libX11 >> /tmp/rpm_inst.sh
[root@rhel1 Packages]# ls -l | awk '{ print $9 }' | grep libX11.i686 >> /tmp/rpm_inst.sh
[root@rhel1 Packages]# ls -l | awk '{ print $9 }' | grep libXau >> /tmp/rpm_inst.sh
[root@rhel1 Packages]# ls -l | awk '{ print $9 }' | grep libXau.i686 >> /tmp/rpm_inst.sh
[root@rhel1 Packages]# ls -l | awk '{ print $9 }' | grep libxcb >> /tmp/rpm_inst.sh
[root@rhel1 Packages]# ls -l | awk '{ print $9 }' | grep libxcb.i686 >> /tmp/rpm_inst.sh
[root@rhel1 Packages]# ls -l | awk '{ print $9 }' | grep libXi >> /tmp/rpm_inst.sh
[root@rhel1 Packages]# ls -l | awk '{ print $9 }' | grep libXi.i686 >> /tmp/rpm_inst.sh
[root@rhel1 Packages]# ls -l | awk '{ print $9 }' | grep make >> /tmp/rpm_inst.sh
[root@rhel1 Packages]# ls -l | awk '{ print $9 }' | grep sysstat >> /tmp/rpm_inst.sh
[root@rhel1 Packages]# ls -l | awk '{ print $9 }' | grep unixODBC >> /tmp/rpm_inst.sh
[root@rhel1 Packages]# ls -l | awk '{ print $9 }' | grep unixODBC-devel >> /tmp/rpm_inst.sh
[root@rhel1 Packages]# chmod +x /u01/softwares/rpm_inst.sh
-------- Use vi Editor and include rpm -ivh at the beginning of every line (except first line) using esc :s/^/rpm -ivh /g
[root@rhel1 Packages]# sh /u01/softwares/rpm_inst.sh
-------- Rerun the script about 6 times or so that all dependency rpms will be installed

2. Oracle Database Installation

  • Login as Oracle User and set the Environment Variables in  /home/oracle/.bash_profile
-- Add the following Entries to .bash_profile
# Oracle Settings
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_HOSTNAME=ol6-121.localdomain
export ORACLE_UNQNAME=cdb12c
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.1.0/db_1
export ORACLE_SID=cdb12c
export PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
-- Change Parameter Settings in Database Software area
-- /u01/softwares/database/stage/cvu/cv/admin
CV_ASSUME_DISTID=OEL4
to
CV_ASSUME_DISTID=OEL6
More information see metalink [ID 1304727.1]
  •  Create Database using dbca, use the GUI to set up all parameters for Database Creation, the Listener should be running at this time otherwise use netca to create the Listener.
oracle@rhel1 ]# cd /u01/softwares/database
[oracle@rhel1 database]# ./runInstaller
--
-- Complete the Installation and run the root scripts at the end
--
[root@rhel1 ~]# /u01/app/oraInventory/orainstRoot.sh
[root@rhel1 ~]# /u01/app/oracle/product/11.2.0/db_1/root.sh
  • In case you are directlly working on the server Set “xhost +” as root user and start working from oracle user.
  • In case you are working from a Ubuntu client, login to oracle as “ssh -X oracle@192.168.1.10
  • In case you are connecting to oracle user from a Windows PC to the Serve through putty, install Xmanager Software and export DISPLAY=<IP_of _your_PC>:0.0 and start XManager in the Start Tray
  • Start Installation of Oracle with software only option ( You will need to run a couple of scripts as root user at the End of the Installation )

That brings to the End of Oracle Software Installation & Database Creation.

abhilash@M6600:~$ ssh -X oracle@192.168.1.10
oracle@192.168.1.10's password:
Last login: Sat Jul 13 20:15:48 2013 from 192.168.1.7
[oracle@rhel1 ~]$ sqlplus

SQL*Plus: Release 12.1.0.1.0 Production on Sat Jul 13 22:03:08 2013

Copyright (c) 1982, 2013, Oracle. All rights reserved.

Enter user-name: sys as sysdba
Enter password:

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> select instance_name,status from v$instance;

INSTANCE_NAME STATUS
---------------- ------------
orcl12c OPEN

SQL> select dbms_xdb_config.gethttpsport () from dual;

DBMS_XDB_CONFIG.GETHTTPSPORT()
------------------------------
 5500

SQL> select sys_context('userenv','con_name') "CONTAINER_NAME" from dual;

CONTAINER_NAME
--------------------------------------------------------------------------------
CDB$ROOT

SQL> select SERVICE_ID,NETWORK_NAME,PDB from dba_services;

SERVICE_ID NETWORK_NAME PDB
---------- -------------------- ------------
 1 CDB$ROOT
 2 CDB$ROOT
 5 orcl12cXDB CDB$ROOT
 6 orcl12c CDB$ROOT

  • For configuring up Pluggable Databases see other posts ( to be available soon)

Oracle Database 11.2.0.3 Installation on RHEL 6

Oracle Installation  of 11.2.0.3 method’s are clearly indicated below. Each and every step is crucial to perform a error free setup.Oracle 11.2.0.3 software binaries are available in Oracle Patch 10404530, This software is not available via Oracle Download’s in oracle.com, they are only available via Oracle Support login. The following Installation is performed on a RHEL 6 64 Bit OS. The software Binaries vary from 32 and 64 Bit, be sure to download the correct software binaries.The files shown below are those for 64 Bit Linux OS. Download only the first two files for installing Database Software.

p10404530_112030_Linux-x86-64_1of7.zip
p10404530_112030_Linux-x86-64_2of7.zip

Let’s get started with the Installation, there are two major parts of any Oracle Database Installation.

  1. Operating System Settings
  2. Oracle Database Installation

Let’s start with each one of them,

1. Operating System Settings

All settings indicated here are to be performed after RHEL 6 64 Bit OS Installations

  • Ensure hostname and IP are set up properly, you will need to do the check same after Linux 64 Bit Installation.
[root@rhel2 ~]# more /etc/hosts
127.0.0.1 localhost
192.168.1.10 rhel1
192.168.1.11 rhel2
[root@rhel2 ~]# ifconfig -a | grep 192
 inet addr:192.168.1.11 Bcast:192.168.1.255 Mask:255.255.255.0
[root@rhel2 ~]# more /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=rhel2
GATEWAY=192.168.1.1
[root@rhel2 ~]#
  • Disable Firewall Settings : Firewall Settings can cause network issues while communicating with Applications.
[root@rhel2 ~]# service iptables save
[root@rhel2 ~]# service iptables stop
[root@rhel2 ~]# chkconfig iptables off
[root@rhel2 ~]# service network restart
  • Kernel Settings : Kernel Settings are of utmost importance to configure system wide configurable memory and allowable Port Ranges
[root@rhel2 ~]# more /etc/sysctl.conf
fs.suid_dumpable = 1
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default=4194304
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=1048586
  • Ensure the /ete/sysctl.conf settings are setup fine, the following command should not throw any error’s
[root@rhel2 ~]# sysctl -p
fs.suid_dumpable = 1
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default=4194304
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=1048586
  • Create Users,Groups & Folder Structures
[root@rhel2 ~]# groupadd -g 501 oinstall
[root@rhel2 ~]# groupadd -g 502 dba
[root@rhel2 ~]# groupadd -g 503 oper
[root@rhel2 ~]# groupadd -g 504 asmadmin
[root@rhel2 ~]# groupadd -g 506 asmdba
[root@rhel2 ~]# groupadd -g 505 asmoper
[root@rhel2 ~]# useradd -u 502 -g oinstall -G dba,asmdba,oper oracle
[root@rhel2 ~]# passwd oracle
[root@rhel2 ~]# mkdir -p /u01/app/oracle/product/11.2.0/db_1
[root@rhel2 ~]# mkdir -p /u01/softwares
[root@rhel2 ~]# chown -R oracle:oinstall /u01
[root@rhel2 ~]# chmod -R 775 /u01
  • Add the following Entries to /etc/security/limits.conf
/etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 4096
oracle hard nofile 65536
oracle soft stack 10240
  • Change Settings in /etc/security/limits.d/90-nproc.conf and /etc/selinux/config as shown below
/etc/security/limits.d/90-nproc.conf

# Comment the following Line
* soft nproc 1024

# Include the following Line
* - nproc 16384
/etc/selinux/config
SELINUX=permissive
  • Transfer the Oracle Database Media files p10404530_112030_Linux-x86-64_1of7.zip and p10404530_112030_Linux-x86-64_2of7.zip to /u01/softwares

Mount the RHEL 6 64 bit CD or you can mount the ISO image

[root@rhel2 ~]# mkdir -p /media/rhel6iso
[root@rhel2 ~]# mount -o loop /u01/softwares/rhel_6.2_x86_64_disc_1.iso /media/rhel6iso
[root@rhel2 ~]# df -h
The df -h output shows you that the ISO media for RHEL6 64bit ISO has been mounter

The df -h output shows you that the ISO media for RHEL6 64bit ISO has been mounted

  • Transfer ( using sftp, ftp in bin mode,scp,filezilla, etc.. ) Oracle Database Media files p10404530_112030_Linux-x86-64_1of7.zip and p10404530_112030_Linux-x86-64_2of7.zip to /u01/softwares. Mount the RHEL 6 64 bit CD or you can mount the ISO image
[root@rhel2 ~]# mkdir -p /media/rhel6iso
[root@rhel2 ~]# mount -o loop /u01/softwares/rhel_6.2_x86_64_disc_1.iso /media/rhel6iso
[root@rhel2 ~]# df -h
----------The df -h output shows you that the ISO media for RHEL6 64bit ISO has been mounter
[root@rhel2 ]# cd /media/rhel6iso/Packages
[root@rhel2 Packages]# touch /u01/softwares/rpm_inst.sh
[root@rhel2 Packages]# echo "cd /media/rhel6iso/Packages" > /u01/softwares/rpm_inst.sh
[root@rhel2 Packages]# ls -l | awk '{ print $9 }' | grep gcc >> /tmp/rpm_inst.sh
[root@rhel2 Packages]# ls -l | awk '{ print $9 }' | grep cpp >> /tmp/rpm_inst.sh
[root@rhel2 Packages]# ls -l | awk '{ print $9 }' | grep ppl >> /tmp/rpm_inst.sh
[root@rhel2 Packages]# ls -l | awk '{ print $9 }' | grep cloog >> /tmp/rpm_inst.sh
[root@rhel2 Packages]# ls -l | awk '{ print $9 }' | grep libaio >> /tmp/rpm_inst.sh
[root@rhel2 Packages]# ls -l | awk '{ print $9 }' | grep libltdl >> /tmp/rpm_inst.sh
[root@rhel2 Packages]# ls -l | awk '{ print $9 }' | grep thread >> /tmp/rpm_inst.sh
[root@rhel2 Packages]# ls -l | awk '{ print $9 }' | grep libc >> /tmp/rpm_inst.sh
[root@rhel2 Packages]# ls -l | awk '{ print $9 }' | grep binutils >> /tmp/rpm_inst.sh
[root@rhel2 Packages]# ls -l | awk '{ print $9 }' | grep compat >> /tmp/rpm_inst.sh
[root@rhel2 Packages]# ls -l | awk '{ print $9 }' | grep libXp >> /tmp/rpm_inst.sh
[root@rhel2 Packages]# ls -l | awk '{ print $9 }' | grep kernel >> /tmp/rpm_inst.sh
[root@rhel2 Packages]# ls -l | awk '{ print $9 }' | grep libaio >> /tmp/rpm_inst.sh
[root@rhel2 Packages]# ls -l | awk '{ print $9 }' | grep make >> /tmp/rpm_inst.sh
[root@rhel2 Packages]# ls -l | awk '{ print $9 }' | grep gdbm >> /tmp/rpm_inst.sh
[root@rhel2 Packages]# ls -l | awk '{ print $9 }' | grep unux >> /tmp/rpm_inst.sh
[root@rhel2 Packages]# ls -l | awk '{ print $9 }' | grep sysstat >> /tmp/rpm_inst.sh
[root@rhel2 Packages]# ls -l | awk '{ print $9 }' | grep ksh >> /tmp/rpm_inst.sh
[root@rhel2 Packages]# ls -l | awk '{ print $9 }' | grep std >> /tmp/rpm_inst.sh
[root@rhel2 Packages]# ls -l | awk '{ print $9 }' | grep elf >> /tmp/rpm_inst.sh
[root@rhel2 Packages]# ls -l | awk '{ print $9 }' | grep mpfr >> /tmp/rpm_inst.sh
[root@rhel2 Packages]# ls -l | awk '{ print $9 }' | grep unixODBC >> /tmp/rpm_inst.sh
[root@rhel2 Packages]# ls -l | awk '{ print $9 }' | grep std >> /tmp/rpm_inst.sh
[root@rhel2 Packages]# ls -l | awk '{ print $9 }' | grep sysstat >> /tmp/rpm_inst.sh
[root@rhel2 Packages]# ls -l | awk '{ print $9 }' | grep gomp >> /tmp/rpm_inst.sh
[root@rhel2 Packages]# chmod +x /u01/softwares/rpm_inst.sh
-------- Use vi Editor and include rpm -ivh at the beginning of every line (except first line) using esc :s/^/rpm -ivh /g
[root@rhel2 Packages]# sh /u01/softwares/rpm_inst.sh
-------- Rerun the script about 6 times or so that all dependency rpms will be installed

2. Oracle Database Installation

  • Login as Oracle User and set the Environment Variables in  /home/oracle/.bash_profile
# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR

ORACLE_HOSTNAME=rhel1; export ORACLE_HOSTNAME
ORACLE_UNQNAME=db11g; export ORACLE_UNQNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1; export ORACLE_HOME
ORACLE_SID=db11g; export ORACLE_SID

PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

/u01/softwares/database/stage/cvu/cv/admin
CV_ASSUME_DISTID=OEL4
to
CV_ASSUME_DISTID=OEL6
More information see metalink [ID 1304727.1]

  • In case you are directlly working on the server Set “xhost +” as root user and start working from oracle user.
  • In case you are working from a Ubuntu client, login to oracle as “ssh -X oracle@192.168.1.11
  • In case you are connecting to oracle user from a Windows PC to the Serve through putty, install Xmanager Software and export DISPLAY=<IP_of _your_PC>:0.0 and start XManager in the Start Tray
  • Start Installation of Oracle with software only option ( You will need to run a couple of scripts as root user at the End of the Installation )
[oracle@rhel2 ]# cd /u01/softwares/database
[oracle@rhel2 database]# ./runInstaller
[root@rhel2 ~]# /u01/app/oraInventory/orainstRoot.sh
[root@rhel2 ~]# /u01/app/oracle/product/11.2.0/db_1/root.sh
[root@rhel2 ~]#
  •  Create Database using dbca, use the GUI to set up all parameters for Database Creation, the Listener should be running at this time.
</pre>
 [oracle@rhel2 ]# dbca
 --------- Now the database should be up and running
 [root@rhel2 ~]# su - oracle
 [oracle@rhel2 ~]$ sqlplus

SQL*Plus: Release 11.2.0.3.0 Production on Mon Jul 15 02:55:17 2013

Copyright (c) 1982, 2011, Oracle. All rights reserved.

Enter user-name: sys as sysdba
 Enter password:

Connected to:
 Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
 With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select instance_name,status from v$instance;

 INSTANCE_NAME    STATUS
 ---------------- ------------
 db11g            OPEN

SQL> exit
 Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
 With the Partitioning, OLAP, Data Mining and Real Application Testing options
 [oracle@rhel2 ~]$ ps -ef|grep pmon
 oracle 440 359 0 02:55 pts/1 00:00:00 grep pmon
 oracle 23926 1 0 Jul14 ? 00:00:12 ora_pmon_db11g

That brings to the End of Oracle Software Installation & Database Creation.

Datamover Export and Import PeopleSoft

There are quite a few techniques available in PeopleSoft to export and import the table from the database, one of which is Datamover.
Data Mover Export
set log C:\EXPORT.log;                                                  — Place where log file is maintained
set output C:\QC146tabdmp.dat;                             — This is the place where the exported data is stored.
export FO_CSF_FIELD;                                                —  Table that needs to be exported.
export RS_ASSIGNMENT;
export RS_SO_HDR;
export CA_BI_DRIVER4;
Data Mover Import
set log C:\IMPORT.log;                                              — Place where log file is maintained
set input C:\QC146tabdmp.dat;                             — This is the place where the exported data is retrieved.
import FO_CSF_FIELD;                                             —  Table that needs to be imported from the .dat file.
import RS_ASSIGNMENT;
import RS_SO_HDR;
import CA_BI_DRIVER;
Note: PeopleSoft DataMover stores the exported file in as encrypted binary file and it cannot be reused in any other way, you can only use Datamover to export and import the dat file which the DataMover generates.

How to configure/setup PeopleSoft Core HRMS

Organization Master Data Setup

After the initial installation settings are done, the first step in configuring the application for an organisation is to Set-Up the Organisational Master Data. This data is also referred as Foundation Data.

The following organizational data will be setup:

  • Company
  • Business Unit & Set IDs
  • Locations
  • Departments
  • Job Master Data

SetID


With Set ID’s definition it is possible to control what a business unit can access within a table, as they are used to restrict or grant access to different data in a single table thereby allowing table set sharing. In Xyz Company, each LOB (Line of business) maintain separate department, designation etc. SetID will be created for each line of business so that each LOB can view respective data.

Navigation: People Tools >Utilities >Administration> TableSet IDs
Business Units

The Business Units are logical organizational entities, determinant on many control tables, which are a way of tracking specific business information for reporting and for data collection. InXyz Company, business unit will be created for each LOB.

Navigation: Set Up HRMS> Foundation Tables >Organization> Business Unit

Companies

The purpose of the Company table is to define organization’s legal business entities.
In PeopleSoft length of company field is 3 characters.

The Companies are created in Company component, divided in 4 pages

  • Company Location
  • Default Settings
  • Phones
  • Rules Definition

Navigation: Set Up HRMS> Foundation Tables >Organization >Company


Company– Location tab

Company is defined with code, the effective date from which it exists, short and long description of the company and the address. It can be associated with the Location, if it was already set up, and the corresponding set ID.

PeopleSoft allows 3 characters for Company code. Also, the EFFDT can be set for all companies as ’01-01-1900’ to avoid any data discrepancies.
Company– Default Settings tab

This page is used to specify default company information, like regulatory region and currency code. The values can be overridden at job level. Payroll for North America will be ignored, as well as the linked fields.

Company– Phones tab:
This page can be used to define the company’s industry (type of industry and industry sector) and the phone numbers of the company, like business, fax, etc.

Company– Rules Definition tab:

This page can be used to define the decimal precision for Full-Time Equivalency, so the purpose is to enter the number of decimal positions that the system will use to calculate FTE. FTE is used for calculating the employees pay on basis of hours worked. This feature will not be required for DB.

Location

The purpose of establishing Locations in PeopleSoft application is to clearly identify physical local place where the employees work.

PeopleSoft Locations would be mapped with the actual Xyz Company office locations. For each location the default holiday-schedule will also be specified.

Navigation: Set Up HRMS >Foundation Tables >Organization > Location

Location – Location Address tab

This  page is used to record the Location description, address, phone/Fax, building, floor, country, etc.

Location – Location Profile tab

This page is used to store the location profile information, such as:

  • Salary Default – The Setid and Salary plan will be used to default the salary information
  • Regulatory Region or Region
  • Holiday Schedule – a code defined with the specific holidays of the Location
  • Division – linked with the location

Each Line of Business shares the Locations and thus, one setid will be created for each Line of Business. If a location is common for State and Corporate Office or State and Unit Office a different location code will be configured to enable accurate data security. The list of locations will be finalized in Steering.

Sub-Location : The purpose of establishing Sub Locations in PeopleSoft application is to clearly identify physical local place where the employees work.
PeopleSoft Sub Locations would be mapped with the actual Xyz Company

Departments

The Departments are an important definition of the organizational structure. Based on the Department, the Location code, company and manager ID can be defaulted at the worker level. Xyz Company has currently many Departments/Verticals such as Finance and Accounts, HR, Editorial etc. These departments can be mapped to PeopleSoft departments. These departments typically have parent level department or verticals. Each vertical will have respective corporate head, state heads and unit heads.

Navigation: Set Up HRMS> Foundation Tables> Organization> Departments


Departments – Profile
In this page, Manager Type can be used to define the Manager ID or Manager’s Position number of the department. Since Xyz Company has departments centrally organized, thus, this feature will not be used.

The department/verticals in Xyx Company are listed in the table below.

SNO            Line of Business       Department Code                Department Description
1                   XXXX0                                  100                                                 Actuary
2                   XXXX0                                 120                                                  Admn
3                   XXXX0                                 140                                                  Claims
4                   XXXX0                                 160                                                  Corporate

 Department Tree

In PeopleSoft, Department tree will be built representing the department level hierarchy. It can also be used for governing the data security access but currently Xyz will use Location based data security access.

Navigation: Tree Manager> Tree Manager

Note: Whenever a new department needs to be added to the system, it should be done through the department tree. It is essential to do this to maintain the integrity between the department table and the department tree.

 Job Codes

Xyz Company maintains Designations and Salary grades for an employee. The designation can be mapped to PeopleSoft Job Code. Job Code has standard hours, work period, compensation frequency etc.
Navigation: Set Up HRMS> Foundation Tables>Job Attributes> Job Code Table

 Job Family: It categorizes a job code into a more general grouping. For example, a trust analyst and an operations analyst into a job family called Analyst.

The other tabs such as Evaluation Criteria, Market Pay Match, Default and Non-Base Compensation are used mainly for Compensation and will not be configured in DB.

The table below depicts the Static Positions in Xyz company that will be configured in PeopleSoft.

Job Code           Description
ACT001             Head and Appointed Actuary
ACT002            Manager – Actuary
ACT003            Acturial Mgr (Analytics)
ACT004            Deputy Manager-Actuary
ACT005           Asst Mgr – Actuary

 Currency

Indian Rupees i.e. INR will be the base currency for Xyz Company HRMS system.

Navigation: Set UP HRMS> Foundation Tables >Currency and Market Rates> Currency Code

Salary Plan
Salary Plans define salary components and default values for the components
Navigation: Set Up HRMS > Product Related> Compensation> Base Compensation >Salary Plan

Salary Grade and Step

Xyz Company hires employees in one of the following grades :
Navigation: Set Up HRMS> Product Related> Compensation> Base Compensation> Salary Grade

Set ID     Salary Administration Plan       Salary Grade         Description
XXXX0     S01                                                                AMG                              Assistant Manager
XXXX0     S01                                                                AVP                              Associate Vice President
XXXX0     S01                                                                CEO                               Chief Executive Officer
XXXX0     S01                                                                DCO                               Deputy CEO
XXXX0     S01                                                                DMG                             Deputy Manager
XXXX0     S01                                                                EXA                              Executive Assistant

Salary Grade – Salary Step: One default Salary step will be created for mapping in Job Data

Comp Rate Code
Comp Rate code represents different components of salary such as basic salary, HRA etc.
Navigation: Set Up HRMS> Foundation Tables> Compensation Rules> Rate Code Class Table

Joining Checklist

Employee’s documents such as education details, experience certificate etc. are verified by HR at the time of joining. HR verifies these documents and employee details against a checklist. The same checklist can be configured in PeopleSoft through following pages.
Navigation: Set Up HRMS > Common Definitions> Checklists>Checklist Items
Navigation: Set Up HRMS>  Common Definitions> Checklists> Checklist
Action/ Action Reason

During an employee’s life cycle in an organization, various activities such as Promotion, Transfer etc. can happen. To record these events, Personnel action and action reasons can be created in PeopleSoft.
Navigation: Set Up HRMS> Product Related> Workforce Administration >Actions

Navigation: Set Up HRMS> Product Related> Workforce Administration >Action Reasons

Following is the list of Actions that is delivered in PeopleSoft.

S.No.         Actions                            Action Reason
1                    Hiring                                    HIR
2                   Promotion                           PRO
3                   Transfer                                XFR
4                   Pay Rate Change               PAY
5                   Data Change                       DTA
6                   Leave of Absence            LOA
7                  Paid Leave of Absence   PLA
8                   Rehire                                   REH
9                  Retirement                          RET
10               Termination                        TDL

Address Type
Different address types such as Home, Business etc. can be defined at Address Type page.

Navigation: Set Up HRMS> Foundation Tables> Personal Address Type

Note: Address type that is not required can be removed.

National ID Type

National ID types such as PAN number, Voter ID Card can be defined here along with display format.

Navigation:  Set Up HRMS> Foundation Tables> Personal> National ID Type

Bank

List of banks used across Xyx Company for employee payroll processing can be configured here.

Navigation: Set Up HRMS >Common Definitions> Banking >Banks

Bank – Branch Tab:

In this page, IFSC code can be mapped to Bank Identifier Code. A custom field will be created for MICR code.

Employee Class
Employee Class will be used to differentiate the level of employee – Unit, State or Corporate.
Navigation: Set Up HRMS Product Related Workforce Administration Labor Administration Employee Class

Three Employee Classes will be configured – Unit, State and Corporate Employee. Employee Class will be assigned in the Job Data of the employee.

Content Items

The academic degrees, Responsibilities (For Editorial), Competencies, Honors and awards etc are defined in the following component. The degree is defined as a content type and the various degrees are referred as the content items of content type degree.

Navigation: Set Up HRMS > Product Related >Profile Management> Content Catalog >Content Items

How PeopleSoft Applications are tested during an Implementation

                         Once the developement is completed the Developer will do unit testing and he/she will be sending out a request to the Migration team to migrate the project to the respective testing environment, say UAT environment.
Generally, UAT will be performed by the Business/ Users / Vendor who are specialized in that particular domain.
Before all the testing starts, the testing team will analyse the product and create a test design for the module/product, based on the Business Requirement Document(BRD) given by the client, and based on the Functional Requirement Specification Document(FRSM), which basically will be created by the Development Team.
Soon after the real testing starts.
Smoke test is generally performed first with few number of test cases in each product to verify the application is ready for the testing. As a practice, testers will test some 10 to 15 % of the total test cases that they have designed. Tester may rise defect if they come across any and the developer will fix it immediately.
Comprehensive testing is a place where the each and every field and functionalities of the application/ product will be tested by the testing team. say 100% of the test cases will be tested by the them. In the course of the testing, if they find any defect they will immediately rise an issue and the development team will fix it in a short span of time.
So, at the end of the comprehensive round the product will come to a shape.
Regression testing is the final round of testing to make sure the product is a fool-proof, This testing will always be done in the code freeze environment, the developer will have no access to the environment in the mean time. Testing team will take some 60% of the test cases that they have tested in the comprehensive round.
In worst case, if the testing team come across any defect then they will rise it with a show stopper and issues will be addressed with a high priority. Now regression will be done to make sure that the code change doesn’t have any impact.
Some critical test cases will be taken for final sanity round and then the product will be given to user for UAT signoff and testing.

Dissecting Openbravo 3.0 UI

Having been worked on Openbravo 3.0 UI for more than a year now (right from RC1) , Openbravo has leaped ahead of most contemporary ERP’s in terms of UX design and usability. And a part of the credit has to go to the community too as they were actively involved in finalizing the UX and also involved enthusiastically in tested out the RC versions and providing their feedback.

In this post, I have tried to draw limelight on the basic UI components that are being used in Openbravo and their corresponding smartclient components. This is just to provide a very high level idea on how the entire architecture is coupled together. I have tried to use a single screen shot of Openbravo interface and tried to map the base components here.

 The hierarchy can be visualized in simple terms as follows:

Exhaustive information on these components are provided in the Openbravo Wiki here.

Most of these components are defined and managed from individual files (or code) thereby making it really easy to extend or customize even the UI layer. As a simple trial I shifted the TopLayout to bottom to give it a windows (OS) like experience. Not being so acquainted with scripting languages, I was really surprised by the simplicity with which I could manage that (though finding that took me a bit longer).

I wanted to share what I found and liked about this code. I would like to be corrected in case I have mentioned any component incorrectly or mapped them in an inappropriate hierarchy. The end goal is to make sure we understand the architecture so that it can be appreciated better.

Happy Working !!!

Implementing Main View using static Java script in Openbravo

In addition to the standard UI generation framework provided by Openbravo, we can also generate our own User Interface and manage them using our own controllers or by extending the controllers provided by Openbravo. There are multiple ways of achieving this. I have provided below, one way of achieving the same, which is specially better suited when the view does not need any dynamic data.

This approach requires a javascript file and a component which can tell the javascript file path to Openbravo. For the sake of simplicity, I have done all the logic in JSP and included the JSP as the html pane in smart client. You can use your own implementation stack for the same. I have used an example module (Fugo Example – com.fugoconsulting.example(DBPrefix – FEX)) for illustrating this.

Development Steps:

Html Content:

Create a jsp file to filter all the customers and their detailed information. For example create BusinessPartner.jsp with all logic and place it in modules/com.fugoconsulting.example/web/com.fugoconsulting.example/jsp/

/**
 * JSP page to provide the List of Customers
 *
 * @author pandeeswari
 */
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="org.openbravo.model.common.businesspartner.BusinessPartner"%>
<%@page import="org.openbravo.dal.service.OBQuery"%>
<%@page import="org.openbravo.dal.service.OBDal"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <style type="text/css">
 table.hovertable {
 font-family: helvetica;
 font-size:13px;
 color:#000;
 padding:5px;
 border-width: 1px;
 border-color: #a9c6c9;
 border-collapse: collapse;
 }

table.hovertable th {
 background-color:#008000;
 color:#FFF;
 padding:5px;
 font-weight:bold;
 font-family: helvetica;
 border-width: 1px;
 border-style: solid;
 border-color: #a9c6c9;
 }

table.hovertable tr {
 color:#000;
 padding:5px;
 border-width: 1px;
 border-color: #a9c6c9;
 color: #008000;
 }

table.hovertable td {
 border-width: 1px;
 border-style: solid;
 font-family: helvetica;
 border-color: #a9c6c9;
 padding:5px;
 }

 .text {
 font-family : helvetica;
 font-size:12px;
 }

 .heading {
 font-family : helvetica;
 font-size : 15px;
 font-weight : Bold;
 color: #008000;
 }
 .trwithoutbg {
 color:#333333;
 font-size:12px;
 background:#FFF;
 }
 </style>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>Customer Information</title>
 <p>List of customers</p>
 <table id = "customer">
 <tr>
 <th>Name</th>
 <th>Name2</th>
 <th>Business Partner Category</th>
 <th>Price List</th>
 <th>Payment Method</th>
 <th>Payment Terms</th>
 <th>Account</th>
 <th>Invoice Terms</th>
 <th>Credit Limit</th>
 </tr>
 <%
 try {
 OBQuery<BusinessPartner> businessPartner = OBDal.getInstance().createQuery(BusinessPartner.class, "customer = 'Y'");

 for(BusinessPartner customer : businessPartner.list()) {
 String name = customer.getName();
 String name2 = "";
 if(customer.getName2() != null) {
 name2 = customer.getName2();
 }
 String businessPartnerCategory = customer.getBusinessPartnerCategory().getName();
 String priceList = "";
 if(customer.getPriceList() != null) {
 priceList = customer.getPriceList().getName();
 }
 String paymentMethod = "";
 if(customer.getPaymentMethod() != null) {
 paymentMethod = customer.getPaymentMethod().getName();
 }
 String paymentTerms = "";
 if(customer.getPaymentTerms() != null) {
 paymentTerms = customer.getPaymentTerms().getName();
 }
 String financialAccount = "";
 if(customer.getAccount() != null) {
 financialAccount = customer.getAccount().getName();
 }
 String invoiceTerms = "";
 if(customer.getInvoiceTerms() != null) {
 invoiceTerms = customer.getInvoiceTerms();
 }
 String creditLimit = customer.getCreditLimit().toString();
 %>
 <tr onmouseover="this.style.backgroundColor='#D0D0D0';" onmouseout="this.style.backgroundColor='#FFF';">
 <td><%= name %></td>
 <td><%= name2 %></td>
 <td><%= businessPartnerCategory %></td>
 <td><%= priceList %></td>
 <td><%= paymentMethod %></td>
 <td><%= paymentTerms %></td>
 <td><%= financialAccount %></td>
 <td><%= invoiceTerms %></td>
 <td><%= creditLimit %></td>
 </tr>
 <%
 }
 }
 catch(Exception e) {
 System.out.println("Error:"+e.getMessage());
 }
 %>
 </table>
 </head>
 <body>
 </body>
</html>

 Static Java Script Resource:

Create a javascript file to include the jsp so that it can be rendered as a main view in openbravo. For example, create fex-business-partner-info.js and place it in modules/com.fugoconsulting.example/web/com.fugoconsulting.example/js/ .


isc.defineClass("FEX_BusinessPartnerInfo", isc.HTMLPane).addProperties({

width: '100%',
 height: '100%',
 overflow: 'visible',

contentsType: 'page',
 contentsURL: 'web/com.fugoconsulting.example/jsp/BusinessPartner.jsp',

// allow only open one tab for this tab instance
 isSameTab: function (viewId, params) {
 return viewId === this.getClassName();
 },

getBookMarkParams: function () {
 var result = {};
 result.viewId = this.getClassName();
 result.tabTitle = this.tabTitle;
 return result;
 }
});

defineClass:

The method defineClass is a smartclient method which is used to define a new java script class. It will create a javascript class with the name “FEX_BusinessPartnerInfo” as a HtmlPane. isc.HTMLPane is the smartclient class that is extended to create the html pane. Any class of smartclient can be extended like this. You can also define your own javascript class and extend the same. For instance, you can also extend the “FEX_BusinessPartnerInfo” class.

contentsType:

The contentsType property is used to specify whether the included html should be opened as a page or a fragment. In our example, since its “Page”, it will load the html as a standalone html page.

contentsURL:

The contentsURL property  is used to specify the URL of the html page which we want to load. Since we have our jsp at com.fugoconsulting.example/jsp of our module’s web directory, we need to give the path as “web/com.fugoconsulting.example/jsp/BusinessPartner.jsp.

isSameTab:

The method isSameTab is overrided to stop Openbravo from opening many instance of the same tab again and again when the menu is clicked.

View Definition:

You can define the view as follows:

  1. Log in as System Administrator
  2. Open Application Dictionary -> User Interface -> View Definition
  3. Define the view as below.

View Definition

The name of the View Implementation must be same as the java script  class name. Since we are creating the main view using static java script, we don not need to specify the template or class implementation. Instead, to make openbravo aware of our static java script, we need to register it in a global component provider. We need to create our own component provider that will act as a common resource pool for our static resources.

Component Provider:

Create a component provider FEXComponentProvider.java and place it in the directory modules/com.fugoconsulting.example/src/com/fugoconsulting/example/ as follows.


package com.fugoconsulting.example;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;

import javax.enterprise.context.ApplicationScoped;

import org.openbravo.client.kernel.BaseComponentProvider;
import org.openbravo.client.kernel.Component;
import org.openbravo.client.kernel.ComponentProvider;
import org.openbravo.client.kernel.KernelConstants;

/**
 * The Example module Component Provider.
 *
 * @author pandeeswari
 */
@ApplicationScoped
@ComponentProvider.Qualifier(FEXComponentProvider.QUALIFIER)
public class FEXComponentProvider extends BaseComponentProvider {
 public static final String QUALIFIER = "FEX_COMPONENTPROVIDER";

/*
 * (non-Javadoc)
 *
 * @see org.openbravo.client.kernel.ComponentProvider#getComponent(java.lang.String,
 * java.util.Map)
 */
 @Override
 public Component getComponent(String componentId, Map<String, Object> parameters) {
 throw new IllegalArgumentException("Component id " + componentId + " not supported.");
 }

@Override
 public List<ComponentResource> getGlobalComponentResources() {
 final List<ComponentResource> globalResources = new ArrayList<ComponentResource>();
 globalResources.add(createStaticResource(
 "web/com.fugoconsulting.example/js/fex-business-partner-info.js", false));
 return globalResources;
 }

@Override
 public List<String> getTestResources() {
 return Collections.emptyList();
 }
}

We should add all the static resources in the list variable globalResources.  This is done by overriding the getGlobalComponentResources() methodAt runtime, Openbravo will get the resource path from this component provider.

Now, create a menu “Customer Information” for this main view with action as “Open View in MDI”  and choose the view implementation we just created. Build the application and restart tomcat.

  1. Login as Client
  2. Choose the menu “Customer Information”
  3. Now you should be able to see the list of customers as below.

Customer Information

This example module is hosted in Openbravo forge and can be downloaded from http://forge.openbravo.com/projects/fugoexamplesmodule