Government Services Infrastructure - GSi

GSi
Overview
Why GSi?
Features
 
Understanding GSi
Terminology
GSi Philosophy
Roles Involved
Technical Overview
Typical Implementation
 
Getting Started
License
Download
Install Instructions
 
Documentation
Developer Guide
Vertical API Guide
Toolset Guide
GovServices API Guides
FAQ
 
Demos
Create Process
Monitor Process
 
Download
Binaries
Source Code
 
Common Master Service API Guide

 

Overview.. 3

Introduction. 3

Getting Started. 3

Distribution. 3

Configuration and deployment (Jboss application server) 3

Configuration and deployment (IBM WebSphere application server) 4

Java Client API Reference. 4

Construct CommonMasterService. 4

getCaste. 5

getSubCaste. 5

getCaste. 5

getState. 6

getStates. 6

getDivisions. 6

getDivision. 7

getAllDistricts. 7

getDistrict 8

getDistrict 8

getTaluk. 8

getTaluk. 9

getHoblis. 9

getHobli 9

getVillage. 10

getVillage. 10

getTownCity. 11

getTownCity. 11

getCategories. 11

getCommonMaster 12

getCommonMasters. 12

 


Overview

 

This document explains in detail the functions that can be invoked to get the common master data like Regions, Castes and Sub Castes etc.

Introduction

 

Using Common Master Services API below tasks can be performed.

  • Get the region data like state, divisions, districts, taluks, hoblis, villages and town city.
  • Get the caste and sub caste data.
  • Get the common category master and common master data.

 

All the above operations are exposed through the Common Master Data Service API.

 

Getting Started

Distribution

Common Master Data Services API distribution comes with the following files,

  • CommonMasterDataDto.jar
  • CommonMasterMgmtUtil.jar
  • CommonServicesAPI.jar
  • CommonMasterServices.war
  • commonmastercorelogger.properties
  • CommonMasterServices.properties
  • commmasterhibernate.cfg.xml
  • Javadoc API .

Configuration and deployment (Jboss application server)

Steps to configure and deploy the Common Master Data service on JBoss application server:

  1. Copy ‘CommonMasterServices.war’ to <JBOSS_HOME>\ server\default\deploy directory.
  2. Copy ‘CommonMasterDataDto.jar’, ‘CommonMasterMgmtUtil.jar’ and ‘CommonServicesAPI.jar’  to <JBOSS_HOME>\ server\default\lib directory
  3. Create a folder by name ‘GsiGovConfig’ in <JBOSS_HOME>\bin directory.
  4. Copy ‘commonmastercorelogger.properties’, ‘CommonMasterServices.properties’ and ‘commonmasterhibernate.cfg.xml’ in to the folder creation in step 3.
  5.  Also configure the data source to the name specified in the ‘commonmasterhibernate.cfg.xml’ file.
  6. Restart the server.

 

Configuration and deployment (IBM WebSphere application server)

Steps to configure and deploy the Common Master Data service on JBoss application server:

  1. Deploy the war file ‘CommonMasterServices.war’.
  2. Copy ‘CommonMasterDataDto.jar’, ‘CommonMasterMgmtUtil.jar’ and ‘CommonServicesAPI.jar’  to <APP_SERVER_HOME>\AppServer\lib directory
  3. Create a folder by name ‘GsiGovConfig’ in <APP_SERVER_HOME>\AppServer\Profies\<your_profile> directory.
  4. Copy ‘commonmastercorelogger.properties’, ‘CommonMasterServices.properties’ and ‘commonmasterhibernate.cfg.xml’ in to the folder creation in step 3.
  5.  Also configure the data source to the name specified in the ‘commonmasterhibernate.cfg.xml’ file.
  6. Restart the server.

 

Java Client API Reference

Distribution comes with the Common Master Data Service API jar file.  All access to API is encapsulated in one class CommonMasterService (Package: com.comat.govserivces.api) and this class is used to invoke the methods provided by the Common Master Data Service API.

 

For detailed information, refer to the Javadoc API documents provided with the distribution.

 

Construct CommonMasterService

 

CommonMasterService Creation

 

The instance of the ‘CommonMasterService’ needs to be created to invoke the common master API.

‘CommonMasterService’ class is singleton class. Use method getInstance() to create the instance of ‘CommonMasterService’.

 
        CommonMasterService getInstance()
        Use the above instance to invoke the method/s.
 
Sample Usage:
CommonMasterService commonMasterService = CommonMasterService.getInstance();
 
 

getCaste

Returns a list of Caste.

 

Signature:

      java.util.List getCaste()

 

Parameters:

 

Returns:

java.util.List – List of castes

 
Sample Usage:
CommonMasterService commonMasterService = CommonMasterService.getInstance();
List casteList = commonMasterService.getCaste();

getSubCaste

Returns subCaste for all the given casteIds

 

Signature:

        java.util.Map getSubCaste(long[] casteId)

 

Parameters:

casteId – Caste Id

 

Returns:

java.util.Map - Key - casteId ,Value - SubCaste List

 

Sample Usage:
long[] casteId = new long[]{1,2};
CommonMasterService commonMasterService = CommonMasterService.getInstance();
Map subCasteMap = commonMasterService. getSubCaste (casteId);
 

 

getCaste

Returns the Caste object for the given Caste id.

 

Signature:

com.comat.gsi.govservices.commmaster.dto.Caste getCaste(long casteId)
 

Parameters:

casteId – Caste Id

 

Returns:

Caste object - com.comat.gsi.govservices.commmaster.dto.Caste

 

Sample Usage:
long casteId = 1;
CommonMasterService commonMasterService = CommonMasterService.getInstance();
Caste caste = commonMasterService. getCaste (casteId);
 
 

getState

Returns the State object for the given state id.

 

Signature:

com.comat.gsi.govservices.commmaster.dto.State getState(long stateId)
 

Parameters:

stateId –State Id

 

Returns:

State object - com.comat.gsi.govservices.commmaster.dto.State

 

Sample Usage:
long stateId = 1;
CommonMasterService commonMasterService = CommonMasterService.getInstance();
State state = commonMasterService. getState(stateId);

 

getStates

Returns the List of states.

 

Signature:

        java.util.List getStates()
 

Parameters:

 

Returns:

            java.util.List – List of  states

           

Sample Usage:
CommonMasterService commonMasterService = CommonMasterService.getInstance();
List stateList = commonMasterService. getStates();

 

getDivisions

Returns the List of divisions for the given state id.

 

Signature:

        java.util.List getDivisions(long stateId)
 

Parameters:

stateId –State Id

 

Returns:

            java.util.List – List of  divisions

           

Sample Usage:
long stateId = 1;
CommonMasterService commonMasterService = CommonMasterService.getInstance();
List divisionList = commonMasterService. getDivisions (stateId);

 

 

getDivision

Returns the Division object for the given division id.

 

Signature:

com.comat.gsi.govservices.commmaster.dto.Division getDivision(long divisionId)
 

Parameters:

divisionId –Division Id

 

Returns:

Division object - com.comat.gsi.govservices.commmaster.dto.Division

 

Sample Usage:
long divisionId = 1;
CommonMasterService commonMasterService = CommonMasterService.getInstance();
Division division = commonMasterService. getDivision (divisionId);

 

getAllDistricts

Returns all the districts for the given state id.

 

Signature:

        java.util.List getAllDistricts (long stateId)
 

Parameters:

stateId –State Id

 

Returns:

            java.util.List – List of  districts

           

Sample Usage:
long stateId = 1;
CommonMasterService commonMasterService = CommonMasterService.getInstance();
List allDistrictList = commonMasterService. getAllDistricts(stateId);

 

 

getDistrict

Returns all the districts for the given for division ids.

 

Signature:

        java.util.List getDistrict(long[] divisionId)
 

Parameters:

divisionId –Division Ids

 

Returns:

            java.util.Map – Map of districts , key – divisionId and value – List of districts   

Sample Usage:
Long[] divisionIds= new long[]{1,2};
CommonMasterService commonMasterService = CommonMasterService.getInstance();
Map districtMap = commonMasterService. getDistrict (divisionIds);

getDistrict

Returns the District object for the given district id.

 

Signature:

com.comat.gsi.govservices.commmaster.dto.District getDistrict (long districtId)
 

Parameters:

districtId –District Id

 

Returns:

District object - com.comat.gsi.govservices.commmaster.dto.District

 

Sample Usage:
long districtId = 1;
CommonMasterService commonMasterService = CommonMasterService.getInstance();
District district = commonMasterService. getDistrict(districtId);

 

getTaluk

Returns all the taluks for the given districtIds.

 

Signature:

        java.util.Map getTaluk(long[] distId)
 

Parameters:

distId –District Ids

 

Returns:

            java.util.Map – Map of taluks , key – districtId and value – List of taluks          

Sample Usage:
Long[] districtIds= new long[]{1,2};
CommonMasterService commonMasterService = CommonMasterService.getInstance();
Map talukMap = commonMasterService. getTaluk (districtIds);

getTaluk

Returns the Taluk object for the given taluk id.

 

Signature:

com.comat.gsi.govservices.commmaster.dto.Taluk getTaluk (long talukId)
 

Parameters:

talukId –District Id

 

Returns:

District object - com.comat.gsi.govservices.commmaster.dto.District

 

Sample Usage:
long districtId = 1;
CommonMasterService commonMasterService = CommonMasterService.getInstance();
District district = commonMasterService. getDistrict(districtId);

 

getHoblis

Returns all the hoblis for the given taluk ids.

 

Signature:

        java.util.Map getHoblis(long[] talukId)
 

Parameters:

talukId – Taluk Ids

 

Returns:

            java.util.Map – Map of hoblis , key – taluk Id and value – List of Hoblis           

Sample Usage:
Long[]talukIds= new long[]{1,2};
CommonMasterService commonMasterService = CommonMasterService.getInstance();
Map hobliMap = commonMasterService. getHoblis (talukIds);

 

getHobli

Returns the Hobli object for the given hobli id.

 

Signature:

com.comat.gsi.govservices.commmaster.dto.Hobli getHobli(long hobliId)
 

Parameters:

hobliId –Hobli Id

 

Returns:

Hobli object - com.comat.gsi.govservices.commmaster.dto.Hobli

 

Sample Usage:
long hobliId = 1;
CommonMasterService commonMasterService = CommonMasterService.getInstance();
Hobli hobli = commonMasterService. getHobli(hobliId);

 

getVillage

Returns all the Village for the given grampanchayatId and/or hobliId.

If any one parameter is <0, village list will be returned for other parameter(If it is valid) Ex : To get the villages based on hobliId, use getVillage(-1,hobliId) and vice versa to get the.

 

Signature:

        java.util.List getVillage(long grampanchayatId,long hobliId)
 

Parameters:

grampanchayatId –Grampanchayat Id

hobliId – Hobli Id

 

Returns:

            java.util.List – List of  Villages

           

Sample Usage:
long grampanchayatId = -1;
long hobliId = 3
CommonMasterService commonMasterService = CommonMasterService.getInstance();
List villageList = commonMasterService. getVillage (grampanchayatId, hobliId);

 

getVillage

Returns the Village object for the given village id.

 

Signature:

com.comat.gsi.govservices.commmaster.dto.Village getVillage(long villageId)
 

Parameters:

villageId – Village Id

 

Returns:

Village object - com.comat.gsi.govservices.commmaster.dto.Village

 

Sample Usage:
long villageId = 1;
CommonMasterService commonMasterService = CommonMasterService.getInstance();
Hobli hobli = commonMasterService. getVillage(villageId);

getTownCity

Returns all the Town/Cities for the given taluk ids.

 

Signature:

        java.util.Map getTownCity(long[] talukId)
 

Parameters:

talukId – Taluk Ids

 

Returns:

            java.util.Map – Map of hoblis , key – taluk Id and value – List of Town/Cities  

Sample Usage:
Long[]talukIds= new long[]{1,2};
CommonMasterService commonMasterService = CommonMasterService.getInstance();
Map townCityMap = commonMasterService. getTownCity(talukIds);

 

getTownCity

Returns the Towncity object for the given taluk id.

 

Signature:

com.comat.gsi.govservices.commmaster.dto.Towncity getTownCity (long talukId)
 

Parameters:

talukId –Taluk Id

 

Returns:

Towncity object - com.comat.gsi.govservices.commmaster.dto.Towncity

 

Sample Usage:
long talukId = 1;
CommonMasterService commonMasterService = CommonMasterService.getInstance();
Towncity towncity = commonMasterService. getTownCity (talukId);

getCategories

Returns a List of Common Categories.

 

Signature:

        java.util.List getCategories()
 

Parameters:

 

Returns:

            java.util.List – List of  common categories

           

Sample Usage:
CommonMasterService commonMasterService = CommonMasterService.getInstance();
List commonCategoriesList = commonMasterService. getCategories();

 

getCommonMaster

Returns CommonMasters for all the given categoryIds.

 

Signature:

        java.util.Map getCommonMaster (long[] categoryId)
 

Parameters:

categoryId –Category Ids

 

Returns:

            java.util.Map – Map of common masters , key – category Id and value – List of Common masters        

Sample Usage:
Long[]categoryIds= new long[]{1,2};
CommonMasterService commonMasterService = CommonMasterService.getInstance();
Map commonMasterMap = commonMasterService. getCommonMaster(categoryIds);

 

getCommonMasters

Returns the masters for the given category Code.

 

Signature:

        java.util.List getCommonMasters(String categoryCode) 

 

Parameters:

            categoryCode – Category Code

 

Returns:

            java.util.List – List of  common masters

           

Sample Usage:
String categoryCode = “Bg”;//For Blood Group
CommonMasterService commonMasterService = CommonMasterService.getInstance();
List commonMastersList = commonMasterService. getCommonMasters(categoryCode);

 

Get GSi at SourceForge.net. Fast, secure and Free Open Source software downloads
©2004-2009 Comat Technologies Pvt. Ltd.