searchString = "";
// This will do Simple search
if (searchString.equals("") || searchString.startsWith("SIMPLE :")) {
try {
HrFacadeHome aa = (HrFacadeHome)CVUtility.getHomeObject(
"com.centraview.hr.hrfacade.HrFacadeHome", "HrFacade");
HashMap hm = new HashMap();
HrFacade remote = (HrFacade)aa.create();
remote.setDataSource(this.dataSource);
// TODO: We need to remove this hard-coded value FOR USER ID!!!!!
DL = remote.getEmployeeDetailList(1, hm);
DL.setTotalNoOfRecords(DL.size());
DL.setListType("Employee");
DL.setSortMember(DL2.getSortMember());
DL.setDirtyFlag(false);
} catch (Exception e) {
System.out.println("ListGenerator::getIndividualList" + e);
}
// end synchronized
// IndividualList DL1 = new IndividualList() ;
EmployeeList DL1 = new EmployeeList();
DL1.setSortMember(DL2.getSortMember());
DL1.setSortType(DL2.getSortType());
DL1.setStartAT(DL2.getStartAT());
DL1.setEndAT(DL2.getEndAT());
DL1.setSearchString(searchString);
DL1.setListType("Employee");
DL1.setPrimaryTable("employee");
// write the logic for begin index, endindex for this specific list type
// here
int beginIndex = 0;
int endIndex = 0;
int startAT = DL2.getStartAT();
int EndAt = DL2.getEndAT();
int tnorec = DL.size();
if (tnorec > EndAt) {
if (tnorec > EndAt + 100)
beginIndex = startAT - 100;
if (beginIndex < 1)
beginIndex = 1;
endIndex = EndAt + 100;
} else {
beginIndex = 1;
endIndex = EndAt;
}
DL1.setBeginIndex(beginIndex);
DL1.setEndIndex(endIndex);
DL2.setBeginIndex(0);
DL2.setEndIndex(0);
// search String
// check for serach string simple or in multiple tables
// and if the global list is complete
// if simple search in same GL and make DL1
// sort
DL1 = (EmployeeList)this.Sort(DL1, DL);
DL1.setSearchString(searchString);
if (!searchString.equals(""))
DL1.search();
DL1.setTotalNoOfRecords(DL1.size());
DL1.setListID(DLparam.getListID());
// this call will give u sublist from startAT to endAT
// DL1 = ( EntityList )getFilteredList( DL1.getBeginIndex() ,
// DL1.getEndIndex() , DL1 );
return DL1;
}// end of if SIMPLE :
else // for ADVANCE:
{
String powerString = DLparam.getPowerString();
try {
HrFacadeHome aa = (HrFacadeHome)CVUtility.getHomeObject(
"com.centraview.hr.hrfacade.HrFacadeHome", "HrFacade");
HashMap hm = new HashMap();
hm.put("ADVANCESEARCHSTRING", searchString);
HrFacade remote = (HrFacade)aa.create();
remote.setDataSource(this.dataSource);
// TODO: We need to remove this hard-coded value
DL = remote.getEmployeeDetailList(1, hm);
DL.setTotalNoOfRecords(DL.size());