first commit

This commit is contained in:
2025-07-28 13:56:49 +05:30
commit e9eb805edb
3438 changed files with 520990 additions and 0 deletions

View 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;
}
}

View 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;
}
}