first commit
This commit is contained in:
262
hrmsEjb/wenrgise/ejb/help/business/HelpBO.java
Normal file
262
hrmsEjb/wenrgise/ejb/help/business/HelpBO.java
Normal file
@@ -0,0 +1,262 @@
|
||||
package wenrgise.ejb.help.business;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.logging.Logger;
|
||||
import wenrgise.common.exception.EnrgiseApplicationException;
|
||||
import wenrgise.common.exception.EnrgiseSystemException;
|
||||
import wenrgise.ejb.common.helper.DBObject;
|
||||
import wenrgise.ejb.common.helper.QueryRow;
|
||||
import wenrgise.ejb.common.helper.QueryValue;
|
||||
import wenrgise.ejb.common.utility.DBUtilitiesBean;
|
||||
import wenrgise.help.bean.HelpChapterBean;
|
||||
import wenrgise.help.bean.HelpComponentBean;
|
||||
import wenrgise.help.bean.HelpContentBean;
|
||||
import wenrgise.help.bean.HelpPartBean;
|
||||
|
||||
public class HelpBO {
|
||||
public static Logger log = Logger.getLogger("wenrgise.ejb.common.business.HelpBO");
|
||||
|
||||
public ArrayList getComponentCodes(String sModuleName) throws EnrgiseApplicationException, EnrgiseSystemException {
|
||||
ArrayList oParameters = new ArrayList();
|
||||
DBUtilitiesBean oBean = new DBUtilitiesBean();
|
||||
int count = 0;
|
||||
QueryRow oRow = null;
|
||||
QueryValue oValue = null;
|
||||
ArrayList oList = null;
|
||||
Iterator oIt = null;
|
||||
ArrayList oComponents = null;
|
||||
String sComp = null;
|
||||
oParameters = new ArrayList();
|
||||
oParameters.add(new DBObject(1, 1, 12, sModuleName));
|
||||
oParameters.add(new DBObject(2, 2, -10));
|
||||
oParameters.add(new DBObject(3, 2, 12));
|
||||
oParameters.add(new DBObject(4, 2, 12));
|
||||
oParameters.add(new DBObject(5, 2, 4));
|
||||
ArrayList oOutArray = oBean.callProc(oParameters, "HLPCONTENTDETAIL.proc_GetComponents(?,?,?,?,?)");
|
||||
oList = (ArrayList)((DBObject)oOutArray.get(0)).getObject();
|
||||
if (oList.size() == 0)
|
||||
oList = new ArrayList();
|
||||
count = 0;
|
||||
oIt = oList.iterator();
|
||||
while (oIt.hasNext()) {
|
||||
if (count == 0)
|
||||
oComponents = new ArrayList();
|
||||
count++;
|
||||
oRow = oIt.next();
|
||||
sComp = new String();
|
||||
sComp = oRow.get("component_id").getString();
|
||||
oComponents.add(sComp);
|
||||
}
|
||||
return oComponents;
|
||||
}
|
||||
|
||||
public ArrayList getChapter(String sCompId) throws EnrgiseApplicationException, EnrgiseSystemException {
|
||||
ArrayList oParameters = new ArrayList();
|
||||
DBUtilitiesBean oBean = new DBUtilitiesBean();
|
||||
HelpChapterBean oHelpChapterBean = null;
|
||||
int count = 0;
|
||||
QueryRow oRow = null;
|
||||
QueryValue oValue = null;
|
||||
ArrayList oList = null;
|
||||
Iterator oIt = null;
|
||||
ArrayList oChapter = null;
|
||||
String sChap = null;
|
||||
oParameters = new ArrayList();
|
||||
oParameters.add(new DBObject(1, 1, 12, sCompId));
|
||||
oParameters.add(new DBObject(2, 2, -10));
|
||||
oParameters.add(new DBObject(3, 2, 12));
|
||||
oParameters.add(new DBObject(4, 2, 12));
|
||||
oParameters.add(new DBObject(5, 2, 4));
|
||||
ArrayList oOutArray = oBean.callProc(oParameters, "HLPCONTENTDETAIL.proc_GetChapter(?,?,?,?,?)");
|
||||
oList = (ArrayList)((DBObject)oOutArray.get(0)).getObject();
|
||||
if (oList.size() == 0) {
|
||||
oList = new ArrayList();
|
||||
oChapter = new ArrayList();
|
||||
}
|
||||
count = 0;
|
||||
oIt = oList.iterator();
|
||||
while (oIt.hasNext()) {
|
||||
if (count == 0)
|
||||
oChapter = new ArrayList();
|
||||
count++;
|
||||
oRow = oIt.next();
|
||||
oHelpChapterBean = new HelpChapterBean();
|
||||
oHelpChapterBean.setTxtChapId(oRow.get("id").getString());
|
||||
oHelpChapterBean.setTxtHeading(oRow.get("heading").getString());
|
||||
oHelpChapterBean.setTxtKeyword(oRow.get("keyword").getString());
|
||||
oChapter.add(oHelpChapterBean);
|
||||
}
|
||||
return oChapter;
|
||||
}
|
||||
|
||||
public ArrayList getPart(String sChapId) throws EnrgiseApplicationException, EnrgiseSystemException {
|
||||
ArrayList oParameters = new ArrayList();
|
||||
DBUtilitiesBean oBean = new DBUtilitiesBean();
|
||||
int count = 0;
|
||||
QueryRow oRow = null;
|
||||
QueryValue oValue = null;
|
||||
ArrayList oList = null;
|
||||
Iterator oIt = null;
|
||||
ArrayList oParts = null;
|
||||
String sPart = null;
|
||||
oParameters = new ArrayList();
|
||||
oParameters.add(new DBObject(1, 1, 12, sChapId));
|
||||
oParameters.add(new DBObject(2, 2, -10));
|
||||
oParameters.add(new DBObject(3, 2, 12));
|
||||
oParameters.add(new DBObject(4, 2, 12));
|
||||
oParameters.add(new DBObject(5, 2, 4));
|
||||
ArrayList oOutArray = oBean.callProc(oParameters, "HLPCONTENTDETAIL.proc_GetPart(?,?,?,?,?)");
|
||||
oList = (ArrayList)((DBObject)oOutArray.get(0)).getObject();
|
||||
if (oList.size() == 0) {
|
||||
oList = new ArrayList();
|
||||
oParts = new ArrayList();
|
||||
}
|
||||
count = 0;
|
||||
oIt = oList.iterator();
|
||||
while (oIt.hasNext()) {
|
||||
if (count == 0)
|
||||
oParts = new ArrayList();
|
||||
count++;
|
||||
oRow = oIt.next();
|
||||
sPart = new String();
|
||||
sPart = oRow.get("id").getString();
|
||||
oParts.add(sPart);
|
||||
}
|
||||
return oParts;
|
||||
}
|
||||
|
||||
public ArrayList getModule(String sModName) throws EnrgiseApplicationException, EnrgiseSystemException {
|
||||
ArrayList oParameters = new ArrayList();
|
||||
DBUtilitiesBean oBean = new DBUtilitiesBean();
|
||||
int count = 0;
|
||||
QueryRow oRow = null;
|
||||
QueryValue oValue = null;
|
||||
ArrayList oList = null;
|
||||
Iterator oIt = null;
|
||||
ArrayList oCompList = null;
|
||||
ArrayList oModule = null;
|
||||
ArrayList oChapList = null;
|
||||
ArrayList oPartList = null;
|
||||
ArrayList oCompListDtl = null;
|
||||
ArrayList oModuleDtl = null;
|
||||
ArrayList oChapListDtl = null;
|
||||
ArrayList oPartListDtl = null;
|
||||
ArrayList oSubPartListDtl = null;
|
||||
HelpChapterBean oHelpChapterBean = new HelpChapterBean();
|
||||
HelpChapterBean oChapterBean = new HelpChapterBean();
|
||||
HelpComponentBean oHelpComponentBean = new HelpComponentBean();
|
||||
HelpPartBean oHelpPartBean = new HelpPartBean();
|
||||
String sCompId = "";
|
||||
String sChapId = "";
|
||||
String sPartId = "";
|
||||
String sPart = "";
|
||||
String sPartHeading = "";
|
||||
oCompList = getComponentCodes(sModName);
|
||||
oCompListDtl = new ArrayList();
|
||||
for (int i = 0; i < oCompList.size(); i++) {
|
||||
sCompId = oCompList.get(i);
|
||||
oHelpComponentBean = new HelpComponentBean();
|
||||
oHelpComponentBean.setTxtComponentCode(sCompId);
|
||||
oChapList = getChapter(sCompId);
|
||||
oChapListDtl = new ArrayList();
|
||||
for (int j = 0; j < oChapList.size(); j++) {
|
||||
oChapterBean = oChapList.get(j);
|
||||
sChapId = oChapterBean.getTxtChapId();
|
||||
oHelpChapterBean = new HelpChapterBean();
|
||||
oHelpChapterBean.setTxtHeading(oChapterBean.getTxtHeading());
|
||||
oHelpChapterBean.setTxtChapId(oChapterBean.getTxtChapId());
|
||||
oPartList = getPart(sChapId);
|
||||
oPartListDtl = new ArrayList();
|
||||
for (int k = 0; k < oPartList.size(); k++) {
|
||||
sPartId = oPartList.get(k);
|
||||
oHelpPartBean = new HelpPartBean();
|
||||
oParameters = new ArrayList();
|
||||
oParameters.add(new DBObject(1, 1, 12, sPartId));
|
||||
oParameters.add(new DBObject(2, 2, -10));
|
||||
oParameters.add(new DBObject(3, 2, 12));
|
||||
oParameters.add(new DBObject(4, 2, 12));
|
||||
oParameters.add(new DBObject(5, 2, 4));
|
||||
ArrayList oOutArray = oBean.callProc(oParameters, "HLPCONTENTDETAIL.proc_GetPartDtl(?,?,?,?,?)");
|
||||
oList = (ArrayList)((DBObject)oOutArray.get(0)).getObject();
|
||||
if (oList.size() == 0)
|
||||
oSubPartListDtl = new ArrayList();
|
||||
count = 0;
|
||||
oIt = oList.iterator();
|
||||
while (oIt.hasNext()) {
|
||||
if (count == 0)
|
||||
oSubPartListDtl = new ArrayList();
|
||||
count++;
|
||||
oRow = oIt.next();
|
||||
sPart = new String();
|
||||
sPartHeading = oRow.get("HEADING").getString();
|
||||
sPart = oRow.get("CONTENT").getString();
|
||||
oSubPartListDtl.add(sPart);
|
||||
}
|
||||
oHelpPartBean.setTxtHeading(sPartHeading);
|
||||
oHelpPartBean.setArylstContent(oSubPartListDtl);
|
||||
oPartListDtl.add(oHelpPartBean);
|
||||
}
|
||||
oHelpChapterBean.setArylstPart(oPartListDtl);
|
||||
oChapListDtl.add(oHelpChapterBean);
|
||||
}
|
||||
oHelpComponentBean.setArylstChapter(oChapListDtl);
|
||||
oCompListDtl.add(oHelpComponentBean);
|
||||
}
|
||||
return oCompListDtl;
|
||||
}
|
||||
|
||||
public ArrayList getOneChapter(String sChapId) throws EnrgiseApplicationException, EnrgiseSystemException {
|
||||
ArrayList oParameters = new ArrayList();
|
||||
DBUtilitiesBean oBean = new DBUtilitiesBean();
|
||||
int count = 0;
|
||||
QueryRow oRow = null;
|
||||
QueryValue oValue = null;
|
||||
ArrayList oList = null;
|
||||
Iterator oIt = null;
|
||||
ArrayList oPartList = null;
|
||||
ArrayList oPartListDtl = null;
|
||||
ArrayList oSubPartListDtl = null;
|
||||
HelpPartBean oHelpPartBean = new HelpPartBean();
|
||||
HelpContentBean oHelpContentBean = new HelpContentBean();
|
||||
String sPartId = "";
|
||||
String sPart = "";
|
||||
String sPartHeading = "";
|
||||
oPartList = getPart(sChapId);
|
||||
oPartListDtl = new ArrayList();
|
||||
for (int k = 0; k < oPartList.size(); k++) {
|
||||
sPartId = oPartList.get(k);
|
||||
oHelpPartBean = new HelpPartBean();
|
||||
oParameters = new ArrayList();
|
||||
oParameters.add(new DBObject(1, 1, 12, sPartId));
|
||||
oParameters.add(new DBObject(2, 1, 12, sChapId));
|
||||
oParameters.add(new DBObject(3, 2, -10));
|
||||
oParameters.add(new DBObject(4, 2, 12));
|
||||
oParameters.add(new DBObject(5, 2, 12));
|
||||
oParameters.add(new DBObject(6, 2, 4));
|
||||
ArrayList oOutArray = oBean.callProc(oParameters, "HLPCONTENTDETAIL.proc_GetPartDtl(?,?,?,?,?,?)");
|
||||
oList = (ArrayList)((DBObject)oOutArray.get(0)).getObject();
|
||||
if (oList.size() == 0) {
|
||||
oSubPartListDtl = new ArrayList();
|
||||
} else {
|
||||
count = 0;
|
||||
oIt = oList.iterator();
|
||||
while (oIt.hasNext()) {
|
||||
if (count == 0)
|
||||
oSubPartListDtl = new ArrayList();
|
||||
count++;
|
||||
oRow = oIt.next();
|
||||
oHelpContentBean = new HelpContentBean();
|
||||
sPartHeading = oRow.get("HEADING").getString();
|
||||
oHelpContentBean.setTxtContents(oRow.get("CONTENT").getString());
|
||||
oHelpContentBean.setTxtSecHeading(oRow.get("SECTION_NAME").getString());
|
||||
oSubPartListDtl.add(oHelpContentBean);
|
||||
}
|
||||
oHelpPartBean.setTxtHeading(sPartHeading);
|
||||
oHelpPartBean.setArylstContent(oSubPartListDtl);
|
||||
oPartListDtl.add(oHelpPartBean);
|
||||
}
|
||||
}
|
||||
return oPartListDtl;
|
||||
}
|
||||
}
|
65
hrmsEjb/wenrgise/ejb/help/business/SearchBO.java
Normal file
65
hrmsEjb/wenrgise/ejb/help/business/SearchBO.java
Normal file
@@ -0,0 +1,65 @@
|
||||
package wenrgise.ejb.help.business;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import wenrgise.common.bean.BaseHeaderBean;
|
||||
import wenrgise.common.exception.EnrgiseApplicationException;
|
||||
import wenrgise.common.exception.EnrgiseSystemException;
|
||||
import wenrgise.ejb.common.business.BaseBO;
|
||||
import wenrgise.ejb.common.helper.DBObject;
|
||||
import wenrgise.ejb.common.helper.QueryRow;
|
||||
import wenrgise.ejb.common.helper.QueryValue;
|
||||
import wenrgise.ejb.common.utility.DBUtilitiesBean;
|
||||
import wenrgise.help.bean.SearchBean;
|
||||
|
||||
public class SearchBO extends BaseBO {
|
||||
public String saveHeaderImpl(BaseHeaderBean oBaseHeaderBean, String sScreenMode) throws EnrgiseApplicationException, EnrgiseSystemException {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void saveDetailImpl(String sHeaderPrimaryKey, String sScreenName, ArrayList oDetailBeanArray) throws EnrgiseApplicationException, EnrgiseSystemException {}
|
||||
|
||||
public void saveDetailImpl(BaseHeaderBean oBaseHeaderBean, String sScreenName, ArrayList oDetailBeanArray) throws EnrgiseApplicationException, EnrgiseSystemException {}
|
||||
|
||||
public void initializeBOImpl() {}
|
||||
|
||||
public void additionalFieldValidationImpl(BaseHeaderBean oBaseHeaderBean, Timestamp oWhenPicked, String sScreenName, String sScreenMode, boolean bHeaderDataChanged, ArrayList oDetailBeanArray, boolean bDetailDataChanged, Timestamp oDetailPicked) throws EnrgiseApplicationException, EnrgiseSystemException {}
|
||||
|
||||
public void additionalTimestampValidationImpl(BaseHeaderBean oBaseHeaderBean, Timestamp oWhenPicked, String sScreenName, String sScreenMode, boolean bHeaderDataChanged, ArrayList oDetailBeanArray, boolean bDetailDataChanged, Timestamp oDetailPicked) throws EnrgiseApplicationException, EnrgiseSystemException {}
|
||||
|
||||
public void additionalBusinessValidationImpl(BaseHeaderBean oBaseHeaderBean, Timestamp oWhenPicked, String sScreenName, String sScreenMode, boolean bHeaderDataChanged, ArrayList oDetailBeanArray, boolean bDetailDataChanged, Timestamp oDetailPicked) throws EnrgiseApplicationException, EnrgiseSystemException {}
|
||||
|
||||
public ArrayList getChapterDetails(String sText, String sModuleId) throws EnrgiseApplicationException, EnrgiseSystemException {
|
||||
ArrayList oParameters = new ArrayList();
|
||||
DBUtilitiesBean oBean = new DBUtilitiesBean();
|
||||
int count = 0;
|
||||
SearchBean oSearchBean = null;
|
||||
QueryRow oRow = null;
|
||||
QueryValue oValue = null;
|
||||
ArrayList oList = null;
|
||||
Iterator oIt = null;
|
||||
ArrayList oChapterDetail = new ArrayList();
|
||||
oParameters = new ArrayList();
|
||||
oParameters.add(new DBObject(1, 1, 12, sModuleId));
|
||||
oParameters.add(new DBObject(2, 1, 12, sText));
|
||||
oParameters.add(new DBObject(3, 2, -10));
|
||||
oParameters.add(new DBObject(4, 2, 12));
|
||||
oParameters.add(new DBObject(5, 2, 12));
|
||||
oParameters.add(new DBObject(6, 2, 4));
|
||||
ArrayList oOutArray = oBean.callProc(oParameters, "ENRGISEHELP.PROC_GetChapters(?,?,?,?,?,?)");
|
||||
oList = (ArrayList)((DBObject)oOutArray.get(0)).getObject();
|
||||
if (oList.size() == 0)
|
||||
return new ArrayList();
|
||||
oIt = oList.iterator();
|
||||
while (oIt.hasNext()) {
|
||||
oSearchBean = new SearchBean();
|
||||
oRow = oIt.next();
|
||||
oSearchBean.setChapterId(oRow.get("ID").getString());
|
||||
oSearchBean.setChapterName(oRow.get("HEADING").getString());
|
||||
oSearchBean.setTxtScreenName(oRow.get("KEYWORD").getString());
|
||||
oChapterDetail.add(oSearchBean);
|
||||
}
|
||||
return oChapterDetail;
|
||||
}
|
||||
}
|
11
hrmsEjb/wenrgise/ejb/help/facade/HelpFacade.java
Normal file
11
hrmsEjb/wenrgise/ejb/help/facade/HelpFacade.java
Normal file
@@ -0,0 +1,11 @@
|
||||
package wenrgise.ejb.help.facade;
|
||||
|
||||
import java.rmi.RemoteException;
|
||||
import java.util.ArrayList;
|
||||
import javax.ejb.EJBObject;
|
||||
import wenrgise.common.exception.EnrgiseApplicationException;
|
||||
import wenrgise.common.exception.EnrgiseSystemException;
|
||||
|
||||
public interface HelpFacade extends EJBObject {
|
||||
ArrayList getChapterList(String paramString1, String paramString2) throws RemoteException, EnrgiseSystemException, EnrgiseApplicationException;
|
||||
}
|
25
hrmsEjb/wenrgise/ejb/help/facade/HelpFacadeBean.java
Normal file
25
hrmsEjb/wenrgise/ejb/help/facade/HelpFacadeBean.java
Normal file
@@ -0,0 +1,25 @@
|
||||
package wenrgise.ejb.help.facade;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import javax.ejb.SessionBean;
|
||||
import javax.ejb.SessionContext;
|
||||
import wenrgise.common.exception.EnrgiseApplicationException;
|
||||
import wenrgise.common.exception.EnrgiseSystemException;
|
||||
import wenrgise.ejb.help.business.SearchBO;
|
||||
|
||||
public class HelpFacadeBean implements SessionBean {
|
||||
public void ejbCreate() {}
|
||||
|
||||
public void ejbActivate() {}
|
||||
|
||||
public void ejbPassivate() {}
|
||||
|
||||
public void ejbRemove() {}
|
||||
|
||||
public void setSessionContext(SessionContext ctx) {}
|
||||
|
||||
public ArrayList getChapterList(String sText, String sModuleId) throws EnrgiseSystemException, EnrgiseApplicationException {
|
||||
SearchBO oSearchBO = new SearchBO();
|
||||
return oSearchBO.getChapterDetails(sText, sModuleId);
|
||||
}
|
||||
}
|
9
hrmsEjb/wenrgise/ejb/help/facade/HelpFacadeHome.java
Normal file
9
hrmsEjb/wenrgise/ejb/help/facade/HelpFacadeHome.java
Normal file
@@ -0,0 +1,9 @@
|
||||
package wenrgise.ejb.help.facade;
|
||||
|
||||
import java.rmi.RemoteException;
|
||||
import javax.ejb.CreateException;
|
||||
import javax.ejb.EJBHome;
|
||||
|
||||
public interface HelpFacadeHome extends EJBHome {
|
||||
HelpFacade create() throws CreateException, RemoteException;
|
||||
}
|
Reference in New Issue
Block a user