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,15 @@
package WEB-INF.classes.wenrgise.common.bean;
import wenrgise.common.bean.CommonAttributes;
public class BaseBean {
private CommonAttributes oCommonAttributes = null;
public CommonAttributes getOCommonAttributes() {
return this.oCommonAttributes;
}
public void setOCommonAttributes(CommonAttributes newOCommonAttributes) {
this.oCommonAttributes = newOCommonAttributes;
}
}

View File

@@ -0,0 +1,36 @@
package WEB-INF.classes.wenrgise.common.bean;
import java.io.Serializable;
import wenrgise.common.bean.BaseBean;
public class BaseDetailBean extends BaseBean implements Serializable {
String detailId = null;
String itemChecked = "N";
String status = "Q";
public String getDetailId() {
return this.detailId;
}
public void setDetailId(String newDetailId) {
this.detailId = newDetailId;
}
public String getItemChecked() {
return this.itemChecked;
}
public void setItemChecked(String newItemChecked) {
this.itemChecked = newItemChecked;
}
public String getStatus() {
return this.status;
}
public void setStatus(String newStatus) {
this.status = newStatus;
}
}

View File

@@ -0,0 +1,46 @@
package WEB-INF.classes.wenrgise.common.bean;
import java.io.Serializable;
import wenrgise.common.bean.BaseBean;
public class BaseHeaderBean extends BaseBean implements Serializable {
private String headerPrimaryKey = null;
private String headerStatus = null;
private String pseudoHeader;
private String workListId;
public String getHeaderPrimaryKey() {
return this.headerPrimaryKey;
}
public void setHeaderPrimaryKey(String newHeaderPrimaryKey) {
this.headerPrimaryKey = newHeaderPrimaryKey;
}
public String getHeaderStatus() {
return this.headerStatus;
}
public void setHeaderStatus(String newHeaderStatus) {
this.headerStatus = newHeaderStatus;
}
public String getPseudoHeader() {
return this.pseudoHeader;
}
public void setPseudoHeader(String newPseudoHeader) {
this.pseudoHeader = newPseudoHeader;
}
public String getWorkListId() {
return this.workListId;
}
public void setWorkListId(String newWorkListId) {
this.workListId = newWorkListId;
}
}

View File

@@ -0,0 +1,53 @@
package WEB-INF.classes.wenrgise.common.bean;
public class CommonAttributes {
private String userIdModiFied = null;
private String userIdCreated = null;
private String createdSiteId = null;
private String modifiedSiteId = null;
private String arcFlag = "N";
public String getArcFlag() {
return this.arcFlag;
}
public void setArcFlag(String newArcFlag) {
this.arcFlag = newArcFlag;
}
public String getCreatedSiteId() {
return this.createdSiteId;
}
public void setCreatedSiteId(String newCreatedSiteId) {
this.createdSiteId = newCreatedSiteId;
}
public String getModifiedSiteId() {
return this.modifiedSiteId;
}
public void setModifiedSiteId(String newModifiedSiteId) {
this.modifiedSiteId = newModifiedSiteId;
}
public String getUserIdCreated() {
return this.userIdCreated;
}
public void setUserIdCreated(String newUserIdCreated) {
this.userIdCreated = newUserIdCreated;
}
public String getUserIdModiFied() {
return this.userIdModiFied;
}
public void setUserIdModiFied(String newUserIdModiFied) {
this.userIdModiFied = newUserIdModiFied;
}
}

View File

@@ -0,0 +1,35 @@
package WEB-INF.classes.wenrgise.common.bean;
import java.io.Serializable;
public class EmpInfoBean implements Serializable {
String grpId;
String empId;
String moduleId;
public String getGrpId() {
return this.grpId;
}
public void setGrpId(String newGrpId) {
this.grpId = newGrpId;
}
public String getEmpId() {
return this.empId;
}
public void setEmpId(String newEmpId) {
this.empId = newEmpId;
}
public String getModuleId() {
return this.moduleId;
}
public void setModuleId(String newModuleId) {
this.moduleId = newModuleId;
}
}

View File

@@ -0,0 +1,44 @@
package WEB-INF.classes.wenrgise.common.businessdelegate;
import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.HashMap;
import javax.ejb.CreateException;
import wenrgise.common.bean.EmpInfoBean;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.ejb.common.facade.SecurityFacade;
import wenrgise.ejb.common.facade.SecurityFacadeHome;
import wenrgise.ejb.common.utility.ServiceLocator;
public class SecurityBD {
public HashMap getDisabledFields(String sScreenName, String sHdrDtlFlag, String sSreenMode, String sPageStatus) throws RemoteException, EnrgiseSystemException, EnrgiseApplicationException {
try {
SecurityFacadeHome oHome = (SecurityFacadeHome)ServiceLocator.getLocator().getService("HrmSecurityFacade");
SecurityFacade oSecFacade = oHome.create();
return oSecFacade.getDisabledFields(sScreenName, sHdrDtlFlag, sSreenMode, sPageStatus);
} catch (CreateException oCex) {
throw new EnrgiseApplicationException("wenrgise.common.internal");
}
}
public ArrayList getTreeSet(EmpInfoBean oEmpInfoBean) throws RemoteException, EnrgiseSystemException, EnrgiseApplicationException {
try {
SecurityFacadeHome oHome = (SecurityFacadeHome)ServiceLocator.getLocator().getService("HrmSecurityFacade");
SecurityFacade oSecFacade = oHome.create();
return oSecFacade.addMenuList(oEmpInfoBean);
} catch (CreateException oCex) {
throw new EnrgiseApplicationException("wenrgise.common.internal");
}
}
public HashMap getAccessInfo(EmpInfoBean oEmpInfoBean) throws RemoteException, EnrgiseSystemException, EnrgiseApplicationException {
try {
SecurityFacadeHome oHome = (SecurityFacadeHome)ServiceLocator.getLocator().getService("HrmSecurityFacade");
SecurityFacade oSecFacade = oHome.create();
return oSecFacade.getAccessInfo(oEmpInfoBean);
} catch (CreateException oCex) {
throw new EnrgiseApplicationException("wenrgise.common.internal");
}
}
}

View File

@@ -0,0 +1,21 @@
package WEB-INF.classes.wenrgise.common.exception;
import java.io.Serializable;
public class BaseException extends Exception implements Serializable {
private String sKey;
public BaseException() {}
public BaseException(String sKey) {
this.sKey = sKey;
}
public String getKey() {
return this.sKey;
}
public void setKey(String sMessageKey) {
this.sKey = sMessageKey;
}
}

View File

@@ -0,0 +1,63 @@
package WEB-INF.classes.wenrgise.common.exception;
import java.io.Serializable;
import java.util.ArrayList;
import wenrgise.common.exception.BaseException;
public class EnrgiseApplicationException extends BaseException implements Serializable {
private ArrayList oListExceptions;
private ArrayList oArguments;
private String errorType = null;
public EnrgiseApplicationException() {}
public EnrgiseApplicationException(String sMsgKey) {
super(sMsgKey);
this.errorType = "E";
}
public EnrgiseApplicationException(String sMsgKey, String errorType) {
super(sMsgKey);
this.errorType = errorType;
}
public EnrgiseApplicationException(String sMsgKey, ArrayList oArguments) {
super(sMsgKey);
this.oArguments = oArguments;
this.errorType = "E";
}
public EnrgiseApplicationException(String sMsgKey, ArrayList oArguments, String sErrorType) {
super(sMsgKey);
this.oArguments = oArguments;
this.errorType = sErrorType;
}
public ArrayList getList() {
return this.oListExceptions;
}
public void setList(ArrayList oListExceptions) {
this.oListExceptions = oListExceptions;
}
public void addToList(wenrgise.common.exception.EnrgiseApplicationException oAppExcp) {
if (this.oListExceptions == null)
this.oListExceptions = new ArrayList();
this.oListExceptions.add(oAppExcp);
}
public ArrayList getArguments() {
return this.oArguments;
}
public void setArguments(ArrayList newOArguments) {
this.oArguments = newOArguments;
}
public String getErrorType() {
return this.errorType;
}
}

View File

@@ -0,0 +1,17 @@
package WEB-INF.classes.wenrgise.common.exception;
import java.io.Serializable;
import java.util.ArrayList;
import wenrgise.common.exception.EnrgiseApplicationException;
public class EnrgiseMessageKeyException extends EnrgiseApplicationException implements Serializable {
public EnrgiseMessageKeyException() {}
public EnrgiseMessageKeyException(String sMsgKey, ArrayList oArguments) {
super(sMsgKey, oArguments);
}
public EnrgiseMessageKeyException(String sMsgKey, ArrayList oArguments, String sErrorType) {
super(sMsgKey, oArguments, sErrorType);
}
}

View File

@@ -0,0 +1,19 @@
package WEB-INF.classes.wenrgise.common.exception;
import java.io.Serializable;
import wenrgise.common.exception.BaseException;
public class EnrgiseSystemException extends BaseException implements Serializable {
private Exception oRootCause;
public EnrgiseSystemException() {}
public EnrgiseSystemException(Exception oExcp) {
this.oRootCause = oExcp;
}
public EnrgiseSystemException(String sKey, Exception oExcp) {
super(sKey);
this.oRootCause = oExcp;
}
}

View File

@@ -0,0 +1,39 @@
package WEB-INF.classes.wenrgise.common.utility;
import java.util.Hashtable;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
public class ContextProvider {
private Context ctx = null;
public static InitialContext localContext;
static {
try {
localContext = new InitialContext();
} catch (NamingException oNx) {
oNx.printStackTrace();
}
}
private static wenrgise.common.utility.ContextProvider objContextProvider = new wenrgise.common.utility.ContextProvider();
private ContextProvider() {
try {
Hashtable env = new Hashtable();
this.ctx = new InitialContext();
} catch (Throwable e) {
e.printStackTrace();
}
}
public static Context getContext() {
return objContextProvider.ctx;
}
public static InitialContext getLocalContext() {
return localContext;
}
}

View File

@@ -0,0 +1,46 @@
package WEB-INF.classes.wenrgise.common.utility;
import java.rmi.RemoteException;
import java.util.HashMap;
import javax.ejb.CreateException;
import javax.servlet.http.HttpSession;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.utility.ParamUtil;
import wenrgise.common.utility.UserInfo;
import wenrgise.ejb.common.session.UserSession;
import wenrgise.ejb.common.session.UserSessionHome;
import wenrgise.ejb.common.utility.ServiceLocator;
import wenrgise.hrms.ejb.facade.HrmFacade;
import wenrgise.hrms.ejb.facade.HrmFacadeHome;
public class DebugHelper {
public static void createUserEjb(HttpSession session) throws EnrgiseSystemException {
try {
UserSession oUser = (UserSession)session.getAttribute(ParamUtil.getSessionBeanName());
if (oUser == null) {
UserSessionHome oUserHome = (UserSessionHome)ServiceLocator.getLocator().getService("HrmUserSession");
oUser = oUserHome.create();
UserInfo oUserInfo = new UserInfo();
oUserInfo.setSiteId("1");
oUserInfo.setModuleId("4");
oUserInfo.setUserId("8501000");
oUserInfo.setCurrentYear("2011");
oUserInfo.setUserName("HANS RAJ SHARMA");
oUser.setUserInfo(oUserInfo);
HrmFacadeHome oHome = (HrmFacadeHome)ServiceLocator.getLocator().getService("HrmFacade");
HrmFacade oHrmFacade = oHome.create();
HashMap oMap = new HashMap();
oMap.put(ParamUtil.getModuleName(), oHrmFacade);
oUser.setModuleFacade(oMap);
session.setAttribute(ParamUtil.getSessionBeanName(), oUser);
}
} catch (RemoteException oRmt) {
throw new EnrgiseSystemException();
} catch (CreateException oCrt) {
throw new EnrgiseSystemException();
} catch (Exception oExCc) {
oExCc.printStackTrace();
throw new EnrgiseSystemException();
}
}
}

View File

@@ -0,0 +1,64 @@
package WEB-INF.classes.wenrgise.common.utility;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import wenrgise.common.xml.vo.DetailScreen;
import wenrgise.common.xml.vo.DetailScreens;
import wenrgise.common.xml.vo.EnrgiseApp;
import wenrgise.common.xml.vo.EnrgiseForms;
import wenrgise.common.xml.vo.HashedEnrgiseForms;
import wenrgise.common.xml.vo.SingleForm;
public class EnrgiseManager {
private static wenrgise.common.utility.EnrgiseManager me;
private HashMap oEnrgiseMap = new HashMap();
private HashMap appMap = new HashMap();
public static wenrgise.common.utility.EnrgiseManager getInstance() {
if (me == null)
me = new wenrgise.common.utility.EnrgiseManager();
return me;
}
public HashedEnrgiseForms getCachedObject(String name_) {
if (name_ == null || name_.trim().length() <= 0)
return null;
return (HashedEnrgiseForms)this.oEnrgiseMap.get(name_);
}
public void init(EnrgiseForms oEnrgiseForms) {
if (oEnrgiseForms == null)
return;
ArrayList oFormsList = oEnrgiseForms.get_SingleForm();
Iterator oIt = oFormsList.iterator();
while (oIt.hasNext()) {
SingleForm oSingleForm = oIt.next();
String sFormName = oSingleForm.get_FormName();
HashedEnrgiseForms oHashedEnrgiseForms = new HashedEnrgiseForms();
oHashedEnrgiseForms.setSingleForm(oSingleForm);
DetailScreens oDetailScreens = oSingleForm.get_DetailScreens();
ArrayList oDetailList = oDetailScreens.get_DetailScreen();
Iterator oDetailIt = oDetailList.iterator();
while (oDetailIt.hasNext()) {
DetailScreen oDetailScreen = oDetailIt.next();
String sDetailName = oDetailScreen.get_DetailScreenName();
if (!oHashedEnrgiseForms.getDetailMap().containsKey(sDetailName))
oHashedEnrgiseForms.getDetailMap().put(sDetailName, oDetailScreen);
}
if (!this.oEnrgiseMap.containsKey(sFormName))
this.oEnrgiseMap.put(sFormName, oHashedEnrgiseForms);
}
}
public void setEnrApp(EnrgiseApp oEnrApp) {
this.appMap.put("DBName", oEnrApp.get_DBName());
this.appMap.put("Module", oEnrApp.get_Module());
}
public HashMap getAppMap() {
return this.appMap;
}
}

View File

@@ -0,0 +1,62 @@
package WEB-INF.classes.wenrgise.common.utility;
import com.tcs.wenrgise.util.common.FWXMLUtility;
import java.util.logging.Logger;
import javax.servlet.ServletException;
import org.apache.struts.action.ActionServlet;
import org.apache.struts.action.PlugIn;
import org.apache.struts.config.ModuleConfig;
import wenrgise.common.utility.EnrgiseManager;
import wenrgise.common.utility.LOVManager;
import wenrgise.common.xml.vo.EnrgiseApp;
import wenrgise.common.xml.vo.EnrgiseForms;
import wenrgise.common.xml.vo.INFOClass;
import wenrgise.common.xml.vo.LOVClass;
import wenrgise.workflow.utility.WflDocParamsManager;
import wenrgise.workflow.xml.vo.WflDocParams;
public class EnrgisePlugIn implements PlugIn {
static final Logger log = Logger.getLogger("wenrgise.common.utility.EnrgisePlugIn");
private String formPathName = "/WEB-INF/EnrgiseConfig.xml";
private String pathName = "/WEB-INF/EnrgiseLOV.xml";
private String appPath = "/WEB-INF/EnrgiseApp.xml";
private String reportPathName = "/WEB-INF/EnrgiseReport.xml";
private String wflImplPathName = "/WEB-INF/WflDocParameters.xml";
public void init(ActionServlet servlet, ModuleConfig config) throws ServletException {
try {
EnrgiseForms oEnrgiseForms = (EnrgiseForms)FWXMLUtility.xmlToObject("wenrgise.common.xml.vo.EnrgiseForms", calculatePath(servlet, this.formPathName));
EnrgiseManager.getInstance().init(oEnrgiseForms);
LOVClass oLOVClass = (LOVClass)FWXMLUtility.xmlToObject("wenrgise.common.xml.vo.LOVClass", calculatePath(servlet, this.pathName));
LOVManager.getInstance().init(oLOVClass);
EnrgiseApp oEnrgiseApp = (EnrgiseApp)FWXMLUtility.xmlToObject("wenrgise.common.xml.vo.EnrgiseApp", calculatePath(servlet, this.appPath));
EnrgiseManager.getInstance().setEnrApp(oEnrgiseApp);
WflDocParams oWflDocParams = (WflDocParams)FWXMLUtility.xmlToObject("wenrgise.workflow.xml.vo.WflDocParams", calculatePath(servlet, this.wflImplPathName));
WflDocParamsManager.getInstance().init(oWflDocParams);
INFOClass oINFOClass = (INFOClass)FWXMLUtility.xmlToObject("wenrgise.common.xml.vo.INFOClass", calculatePath(servlet, this.reportPathName));
StringBuffer woStringBuffer = new StringBuffer();
woStringBuffer.append(" rwserver server=peerless");
} catch (Exception oEx) {
log.severe(oEx.getMessage());
}
}
public void destroy() {}
private String calculatePath(ActionServlet servlet, String sPath) {
return servlet.getServletContext().getRealPath(sPath);
}
public String getFormPathName() {
return this.formPathName;
}
public void setFormPathName(String newFormPathName) {
this.formPathName = newFormPathName;
}
}

View File

@@ -0,0 +1,343 @@
package WEB-INF.classes.wenrgise.common.utility;
import java.lang.reflect.Array;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.sql.Timestamp;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseMessageKeyException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.utility.MessageKey;
import wenrgise.ejb.common.helper.QueryRow;
import wenrgise.ejb.common.helper.QueryValue;
import wenrgise.ejb.common.utility.DBUtilitiesBean;
public class EnrgiseUtil {
public static void pageArrayCopier(ArrayList oSource, ArrayList oDest, int iSourcePos, int iLength) throws EnrgiseSystemException {
if (oSource == null) {
System.out.println("Source array is null");
throw new EnrgiseSystemException();
}
if (oDest == null) {
System.out.println("Destination array is null");
throw new EnrgiseSystemException();
}
if (iLength < 0) {
System.out.println("Length should be positive");
return;
}
if (oSource.size() < iSourcePos + iLength) {
System.out.println("The source array is out of range");
return;
}
oDest.clear();
for (int iIndex = iSourcePos; iIndex < iSourcePos + iLength; iIndex++)
oDest.add(oSource.get(iIndex));
}
public static ArrayList addToList(ArrayList oList, Object[] obj) {
for (int i = 0; i < obj.length; i++)
oList.add(obj[i]);
return oList;
}
public static boolean checkString(String oInputString) {
if (oInputString == null)
return false;
String oString = new String(oInputString);
oString = oString.trim();
if (oString.equals(""))
return false;
return true;
}
public static int compareDates(DateFormat dateFormat, String sOrigDate, String sRefDate) throws EnrgiseSystemException {
if (!checkString(sOrigDate) || !checkString(sRefDate))
return -2;
if (null == dateFormat) {
dateFormat = DateFormat.getDateInstance(2);
dateFormat = new SimpleDateFormat("dd-MMM-yyyy");
}
try {
Date origDate = dateFormat.parse(sOrigDate);
Date refDate = dateFormat.parse(sRefDate);
return compareDates(origDate, refDate);
} catch (ParseException oParEx) {
System.out.println(String.valueOf("Date comparison problem ").concat(String.valueOf(oParEx.getMessage())));
throw new EnrgiseSystemException();
}
}
public static int compareDates(Date origDate, Date refDate) {
if (null == origDate || null == refDate)
return -2;
if (origDate.equals(refDate))
return 0;
if (origDate.before(refDate))
return -1;
return 1;
}
public static int compareWithSysdate(Date origDate) throws EnrgiseSystemException {
return compareDates(origDate, getSysDate());
}
public static int compareWithSysdate(DateFormat dateFormat, String sOrigDate) throws EnrgiseSystemException {
if (!checkString(sOrigDate))
return -2;
if (null == dateFormat)
dateFormat = new SimpleDateFormat("dd-MMM-yyyy");
try {
Date origDate = dateFormat.parse(sOrigDate);
return compareDates(origDate, getSysDate());
} catch (ParseException oParEx) {
System.out.println(String.valueOf("Date comparison problem ").concat(String.valueOf(oParEx.getMessage())));
throw new EnrgiseSystemException();
}
}
public static Date getSysDate() throws EnrgiseSystemException {
Date sysDate = null;
DBUtilitiesBean oBean = new DBUtilitiesBean();
ArrayList oList = oBean.executeQuery("SELECT sysdate FROM dual");
if (null != oList) {
QueryRow oRow = oList.get(0);
QueryValue oValue = oRow.get("sysDate");
return oValue.getDate();
}
return null;
}
public static Object setFieldValue(Object obj, String sItem, String sItemValue) throws EnrgiseSystemException {
try {
Class oClass = obj.getClass();
String sSetterMethod = getSetterMethodName(sItem);
String oStr = new String();
Class[] oCls = { oStr.getClass() };
Method oMethod = oClass.getMethod(sSetterMethod, oCls);
Object[] oParams = { sItemValue };
return oMethod.invoke(obj, oParams);
} catch (NoSuchMethodException oNsEx) {
throw new EnrgiseSystemException(oNsEx);
} catch (IllegalAccessException oIlEx) {
throw new EnrgiseSystemException(oIlEx);
} catch (InvocationTargetException oInEx) {
throw new EnrgiseSystemException(oInEx);
}
}
public static Object getFieldValue(Object obj, String sItem) throws EnrgiseSystemException {
try {
Class oClass = obj.getClass();
String sGetterMethod = getGetterMethodName(sItem);
Method oMethod = oClass.getMethod(sGetterMethod, null);
return oMethod.invoke(obj, null);
} catch (NoSuchMethodException oNsEx) {
throw new EnrgiseSystemException(oNsEx);
} catch (IllegalAccessException oIlEx) {
throw new EnrgiseSystemException(oIlEx);
} catch (InvocationTargetException oInEx) {
throw new EnrgiseSystemException(oInEx);
}
}
public static String getGetterMethodName(String sItem) {
String sFirstString = sItem.substring(0, 1);
String sRestString = sItem.substring(1);
String sFirst = sFirstString.toUpperCase();
return String.valueOf(String.valueOf("get").concat(String.valueOf(sFirst))).concat(String.valueOf(sRestString));
}
public static String getSetterMethodName(String sItem) {
String sFirstString = sItem.substring(0, 1);
String sRestString = sItem.substring(1);
String sFirst = sFirstString.toUpperCase();
return String.valueOf(String.valueOf("set").concat(String.valueOf(sFirst))).concat(String.valueOf(sRestString));
}
public static void checkDuplicate(ArrayList oList, String[] sItems, String sFieldKey, ArrayList oExceptionList) throws EnrgiseSystemException {
int index = 0;
Object[] oItemArray = null;
String[] oStatusArray = null;
ArrayList oRowList = new ArrayList();
int iSize = oList.size();
if (sItems != null) {
oItemArray = (Object[])Array.newInstance(Class.forName("java.lang.String"), iSize);
oStatusArray = (String[])Array.newInstance(Class.forName("java.lang.String"), iSize);
} else {
return;
}
if (null != sItems) {
Iterator oIt = oList.iterator();
while (oIt.hasNext()) {
Object obj = oIt.next();
oItemArray[index] = getAllFieldsValue(obj, sItems);
oStatusArray[index++] = (String)getFieldValue(obj, "status");
}
}
for (int iSource = 0; iSource < iSize; iSource++) {
if (null != oItemArray[iSource])
if (null == oStatusArray[iSource] || !oStatusArray[iSource].equals("D"))
for (int iTarget = iSource + 1; iTarget < iSize; iTarget++) {
if (null != oItemArray[iTarget])
if (null == oStatusArray || !oStatusArray[iTarget].equals("D"))
if (compareObject(oItemArray[iSource], oItemArray[iTarget])) {
ArrayList oArgList = new ArrayList();
Integer oRow = new Integer(iSource + 1);
if (null != sFieldKey) {
MessageKey oMessageKey = new MessageKey(sFieldKey);
oArgList.add(oMessageKey);
oArgList.add(oRow);
oExceptionList.add(new EnrgiseMessageKeyException("wenrgise.common.field.combinatonNotUnique", oArgList, "E"));
} else {
oArgList.add(oRow);
oExceptionList.add(new EnrgiseApplicationException("wenrgise.common.duplicatefound", oArgList, "E"));
}
}
}
}
}
public static void checkDuplicate(ArrayList oList, String sItem, String sFieldKey, ArrayList oExceptionList, boolean bCheckStatus) throws EnrgiseSystemException {
int index = 0;
Object[] oItemArray = null;
String[] oStatusArray = null;
if (null == oList)
return;
int iSize = oList.size();
if (null != sItem) {
oItemArray = (Object[])Array.newInstance(sItem.getClass(), iSize);
if (bCheckStatus)
oStatusArray = (String[])Array.newInstance(sItem.getClass(), iSize);
} else {
oItemArray = (Object[])Array.newInstance(oList.get(0).getClass(), iSize);
}
Iterator oIt = oList.iterator();
while (oIt.hasNext()) {
Object obj = oIt.next();
if (null != sItem) {
oItemArray[index] = getFieldValue(obj, sItem);
oStatusArray[index++] = (String)getFieldValue(obj, "status");
continue;
}
oItemArray[index++] = obj;
}
for (int iSource = 0; iSource < iSize; iSource++) {
if (null != oItemArray[iSource])
if (null == oStatusArray[iSource] || !oStatusArray[iSource].equals("D"))
for (int iTarget = iSource + 1; iTarget < iSize; iTarget++) {
if (null != oItemArray[iTarget])
if (null == oStatusArray || !oStatusArray[iTarget].equals("D"))
if (compareObject(oItemArray[iSource], oItemArray[iTarget])) {
ArrayList oArgList = new ArrayList();
Integer oRow = new Integer(iSource + 1);
if (null != sFieldKey) {
MessageKey oMessageKey = new MessageKey(sFieldKey);
oArgList.add(oMessageKey);
oArgList.add(oRow);
oExceptionList.add(new EnrgiseMessageKeyException("wenrgise.common.field.duplicatefound", oArgList, "E"));
} else {
oArgList.add(oRow);
oExceptionList.add(new EnrgiseApplicationException("wenrgise.common.duplicatefound", oArgList, "E"));
}
}
}
}
}
private static String getAllFieldsValue(Object obj, String[] sItems) throws EnrgiseSystemException {
String sValues = " ";
for (int i = 0; i < sItems.length; i++) {
String sValue = (String)getFieldValue(obj, sItems[i]);
if (null != sValue)
sValues = String.valueOf(sValues).concat(String.valueOf(sValue.trim()));
}
return sValues.trim();
}
private static boolean compareObject(Object oSource, Object oTarget) {
if (oSource.getClass().getName().equals("java.lang.String")) {
String sSource = ((String)oSource).trim();
String sTarget = ((String)oTarget).trim();
if (sSource.equalsIgnoreCase(sTarget))
return true;
} else if (oSource.equals(oTarget)) {
return true;
}
return false;
}
public static Timestamp convertToSqlDate(String sDate) throws EnrgiseSystemException {
if (!checkString(sDate))
return null;
DateFormat dateFormat = new SimpleDateFormat("dd-MMM-yyyy");
try {
Date oDate = dateFormat.parse(sDate);
return new Timestamp(oDate.getTime());
} catch (ParseException oParEx) {
System.out.println(String.valueOf("Date comparison problem ").concat(String.valueOf(oParEx.getMessage())));
throw new EnrgiseSystemException();
}
}
public static String convertToString(Date oDate) {
return (null != oDate) ? (new SimpleDateFormat("dd-MMM-yyyy")).format(oDate) : null;
}
public static boolean checkNumber(String sInputValue, int iScale, int iPrecision, String sSign) {
String sLeft = null;
String sRight = null;
boolean bDecimal = false;
if (checkString(sInputValue)) {
String sVal = sInputValue.trim();
int iDecimalIndex = sVal.indexOf(".");
if (iDecimalIndex != -1) {
sLeft = sVal.substring(0, iDecimalIndex);
sRight = sVal.substring(iDecimalIndex + 1);
} else {
sLeft = sVal;
}
if (!sLeft.startsWith("+") && !sLeft.startsWith("-"))
sLeft = String.valueOf("+").concat(String.valueOf(sLeft));
if (iPrecision == 0 && iScale == 0)
return false;
try {
if (iPrecision == 0) {
long lVal = Long.parseLong(sVal);
if (sLeft.length() <= iScale + 1) {
if (Double.parseDouble(sLeft) == false && (sSign.equals("N") || sSign.equals("P")))
return false;
} else {
return false;
}
} else {
double d = Double.parseDouble(sVal);
}
} catch (NumberFormatException oNumEx) {
return false;
}
if (sLeft.length() > iScale + 1)
return false;
if (null != sRight)
if (sRight.length() > iPrecision)
return false;
if (null != sSign) {
if (sSign.equals("N") && !sLeft.startsWith("-"))
return false;
if (sSign.equals("P") && !sLeft.startsWith("+"))
return false;
if (sSign.equals("NN") && sLeft.startsWith("-"))
return false;
if (sSign.equals("NP") && sLeft.startsWith("+"))
return false;
}
}
return true;
}
}

View File

@@ -0,0 +1,21 @@
package WEB-INF.classes.wenrgise.common.utility;
import java.io.Serializable;
public class MessageKey implements Serializable {
private String key;
public MessageKey() {}
public MessageKey(String key) {
this.key = key;
}
public String getKey() {
return this.key;
}
public void setKey(String newKey) {
this.key = newKey;
}
}

View File

@@ -0,0 +1,18 @@
package WEB-INF.classes.wenrgise.common.utility;
import javax.servlet.ServletException;
import org.apache.struts.action.ActionServlet;
import org.apache.struts.action.PlugIn;
import org.apache.struts.config.ModuleConfig;
public class ReportPlugin implements PlugIn {
private String reportPathName = "/WEB-INF/EnrgiseReport.xml";
public void init(ActionServlet servlet, ModuleConfig config) throws ServletException {}
public void destroy() {}
private String calculatePath(ActionServlet servlet, String sPath) {
return servlet.getServletContext().getRealPath(sPath);
}
}

View File

@@ -0,0 +1,39 @@
package WEB-INF.classes.wenrgise.common.utility;
public class ReportReader {
String parameter;
String parameterValue;
public String getAppServerName() {
return "reportserver";
}
public String getAppServerPortNumber() {
return "8888";
}
public String getAppServerReportPathAlias() {
return "reports";
}
public String getStatsRep() {
return "statusKey";
}
public String getParameter() {
return this.parameter;
}
public void setParameter(String newParameter) {
this.parameter = newParameter;
}
public String getParameterValue() {
return this.parameterValue;
}
public void setParameterValue(String newParameterValue) {
this.parameterValue = newParameterValue;
}
}

View File

@@ -0,0 +1,84 @@
package WEB-INF.classes.wenrgise.common.utility;
import java.util.HashMap;
import javax.ejb.EJBLocalHome;
import javax.naming.Context;
import javax.naming.NamingException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.utility.ContextProvider;
public class ServiceLocator {
private HashMap homeCache;
private final HashMap cacheMap = new HashMap();
private static wenrgise.common.utility.ServiceLocator serviceLocator = new wenrgise.common.utility.ServiceLocator();
private ServiceLocator() {
try {
this.homeCache = new HashMap();
} catch (Throwable e) {
e.printStackTrace();
}
}
public static wenrgise.common.utility.ServiceLocator getLocator() {
return serviceLocator;
}
public Object getService(String jndiName) throws EnrgiseSystemException {
try {
if (!this.homeCache.containsKey(jndiName.trim())) {
Context context = ContextProvider.getContext();
this.homeCache.put(jndiName.trim(), context.lookup(jndiName.trim()));
}
} catch (NamingException oNa) {
oNa.printStackTrace();
System.out.println(oNa.getExplanation());
throw new EnrgiseSystemException(oNa);
} catch (Exception oEx) {
oEx.printStackTrace();
throw new EnrgiseSystemException(oEx);
}
return this.homeCache.get(jndiName.trim());
}
public Object getLocalService(String jndiHomeName) throws EnrgiseSystemException {
Object obj = null;
try {
Context context = ContextProvider.getLocalContext();
if (this.cacheMap.containsKey(jndiHomeName)) {
obj = this.cacheMap.get(jndiHomeName);
} else {
obj = context.lookup(jndiHomeName);
this.cacheMap.put(jndiHomeName, obj);
}
} catch (NamingException ne) {
ne.printStackTrace();
throw new EnrgiseSystemException(ne);
}
return obj;
}
public EJBLocalHome getLocalHome(String jndiHomeName) throws EnrgiseSystemException {
System.out.println(String.valueOf("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").concat(String.valueOf(jndiHomeName)));
EJBLocalHome home = null;
try {
Context context = ContextProvider.getLocalContext();
if (this.cacheMap.containsKey(jndiHomeName)) {
home = (EJBLocalHome)this.cacheMap.get(jndiHomeName);
} else {
home = (EJBLocalHome)context.lookup(String.valueOf("java:comp/env/").concat(String.valueOf(jndiHomeName)));
this.cacheMap.put(jndiHomeName, home);
}
} catch (NamingException ne) {
System.out.println(ne);
ne.printStackTrace();
throw new EnrgiseSystemException(ne);
} catch (Exception oEx) {
oEx.printStackTrace();
throw new EnrgiseSystemException(oEx);
}
return home;
}
}

View File

@@ -0,0 +1,175 @@
package WEB-INF.classes.wenrgise.common.utility;
import java.io.Serializable;
public class UserInfo implements Serializable {
private String userSystemId;
private String userId;
private String siteId;
private String userType;
private String userTypeId;
private String userLocked;
private String userActiveFlag;
private String userName;
private String siteName;
private String currentYear;
private boolean superUser = false;
private String moduleId;
private String gradeId;
private String grade;
private String desigId;
private String designation;
private String siteCode;
public String getUserName() {
return this.userName;
}
public void setUserName(String newUserName) {
this.userName = newUserName;
}
public String getSiteName() {
return this.siteName;
}
public void setSiteName(String newSiteName) {
this.siteName = newSiteName;
}
public String getSiteId() {
return this.siteId;
}
public void setSiteId(String newSiteId) {
this.siteId = newSiteId;
}
public String getUserActiveFlag() {
return this.userActiveFlag;
}
public void setUserActiveFlag(String newUserActiveFlag) {
this.userActiveFlag = newUserActiveFlag;
}
public String getUserId() {
return this.userId;
}
public void setUserId(String newUserId) {
this.userId = newUserId;
}
public String getUserLocked() {
return this.userLocked;
}
public void setUserLocked(String newUserLocked) {
this.userLocked = newUserLocked;
}
public String getUserSystemId() {
return this.userSystemId;
}
public void setUserSystemId(String newUserSystemId) {
this.userSystemId = newUserSystemId;
}
public String getUserType() {
return this.userType;
}
public void setUserType(String newUserType) {
this.userType = newUserType;
}
public String getUserTypeId() {
return this.userTypeId;
}
public void setUserTypeId(String newUserTypeId) {
this.userTypeId = newUserTypeId;
}
public String getCurrentYear() {
return this.currentYear;
}
public void setCurrentYear(String newCurrentYear) {
this.currentYear = newCurrentYear;
}
public boolean isSuperUser() {
return this.superUser;
}
public void setSuperUser(boolean newSuperUser) {
this.superUser = newSuperUser;
}
public String getModuleId() {
return this.moduleId;
}
public void setModuleId(String newModuleId) {
this.moduleId = newModuleId;
}
public String getGradeId() {
return this.gradeId;
}
public void setGradeId(String newGradeId) {
this.gradeId = newGradeId;
}
public String getGrade() {
return this.grade;
}
public void setGrade(String newGrade) {
this.grade = newGrade;
}
public String getDesigId() {
return this.desigId;
}
public void setDesigId(String newDesigId) {
this.desigId = newDesigId;
}
public String getDesignation() {
return this.designation;
}
public void setDesignation(String newDesignation) {
this.designation = newDesignation;
}
public String getSiteCode() {
return this.siteCode;
}
public void setSiteCode(String newSiteCode) {
this.siteCode = newSiteCode;
}
}

View File

@@ -0,0 +1,32 @@
package WEB-INF.classes.wenrgise.common.utility;
import java.util.Hashtable;
import javax.naming.Context;
import javax.naming.InitialContext;
public class WorkFlowContextProvider {
private Context ctx = null;
public static InitialContext localContext;
private static wenrgise.common.utility.WorkFlowContextProvider objContextProvider = new wenrgise.common.utility.WorkFlowContextProvider();
private WorkFlowContextProvider() {
try {
Hashtable env = new Hashtable();
env.put("java.naming.factory.initial", "com.ibm.websphere.naming.WsnInitialContextFactory");
env.put("java.naming.provider.url", "iiop://tcs093390:2811");
this.ctx = new InitialContext(env);
} catch (Throwable e) {
e.printStackTrace();
}
}
public static Context getContext() {
return objContextProvider.ctx;
}
public static InitialContext getLocalContext() {
return localContext;
}
}

View File

@@ -0,0 +1,35 @@
package WEB-INF.classes.wenrgise.common.utility;
import java.util.Hashtable;
import javax.naming.Context;
import javax.naming.InitialContext;
public class WorkFlowContextProvider2 {
private Context ctx = null;
public static InitialContext localContext;
private static wenrgise.common.utility.WorkFlowContextProvider2 objContextProvider = new wenrgise.common.utility.WorkFlowContextProvider2();
private WorkFlowContextProvider2() {
try {
Hashtable env = new Hashtable();
env.put("java.naming.factory.initial", "com.evermind.server.rmi.RMIInitialContextFactory");
env.put("java.naming.security.principal", "admin");
env.put("dedicated.rmicontext", "true");
env.put("java.naming.security.credentials", "welcome");
env.put("java.naming.provider.url", "ormi://tcs041981:23892/current-workspace-app");
this.ctx = new InitialContext(env);
} catch (Throwable e) {
e.printStackTrace();
}
}
public static Context getContext() {
return objContextProvider.ctx;
}
public static InitialContext getLocalContext() {
return localContext;
}
}

View File

@@ -0,0 +1,62 @@
package WEB-INF.classes.wenrgise.common.utility;
import java.util.HashMap;
import javax.ejb.EJBLocalHome;
import javax.naming.Context;
import javax.naming.NamingException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.utility.WorkFlowContextProvider;
public class WorkFlowServiceLocator {
private HashMap homeCache;
private final HashMap cacheMap = new HashMap();
private static wenrgise.common.utility.WorkFlowServiceLocator serviceLocator = new wenrgise.common.utility.WorkFlowServiceLocator();
private WorkFlowServiceLocator() {
try {
this.homeCache = new HashMap();
} catch (Throwable e) {
e.printStackTrace();
}
}
public static wenrgise.common.utility.WorkFlowServiceLocator getLocator() {
return serviceLocator;
}
public Object getService(String jndiName) throws EnrgiseSystemException {
try {
if (!this.homeCache.containsKey(jndiName)) {
Context context = WorkFlowContextProvider.getContext();
this.homeCache.put(jndiName, context.lookup(jndiName));
}
} catch (NamingException oNa) {
System.out.println(String.valueOf(String.valueOf(String.valueOf("The problem is ").concat(String.valueOf(oNa.getMessage()))).concat(String.valueOf(" the type is "))).concat(String.valueOf(oNa.getClass().getName())));
throw new EnrgiseSystemException(oNa);
} catch (Exception oEx) {
System.out.println(String.valueOf(String.valueOf(String.valueOf("The problem is ").concat(String.valueOf(oEx.getMessage()))).concat(String.valueOf(" the type is "))).concat(String.valueOf(oEx.getClass().getName())));
throw new EnrgiseSystemException(oEx);
}
return this.homeCache.get(jndiName);
}
public EJBLocalHome getLocalHome(String jndiHomeName) throws EnrgiseSystemException {
EJBLocalHome home = null;
try {
jndiHomeName = jndiHomeName.trim();
Context context = WorkFlowContextProvider.getLocalContext();
if (this.cacheMap.containsKey(jndiHomeName)) {
home = (EJBLocalHome)this.cacheMap.get(jndiHomeName);
} else {
home = (EJBLocalHome)context.lookup(String.valueOf("java:comp/env/").concat(String.valueOf(jndiHomeName)));
this.cacheMap.put(jndiHomeName, home);
}
} catch (NamingException ne) {
ne.printStackTrace();
throw new EnrgiseSystemException(ne);
}
return home;
}
}

View File

@@ -0,0 +1,62 @@
package WEB-INF.classes.wenrgise.common.utility;
import java.util.HashMap;
import javax.ejb.EJBLocalHome;
import javax.naming.Context;
import javax.naming.NamingException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.utility.WorkFlowContextProvider2;
public class WorkFlowServiceLocator2 {
private HashMap homeCache;
private final HashMap cacheMap = new HashMap();
private static wenrgise.common.utility.WorkFlowServiceLocator2 serviceLocator = new wenrgise.common.utility.WorkFlowServiceLocator2();
private WorkFlowServiceLocator2() {
try {
this.homeCache = new HashMap();
} catch (Throwable e) {
e.printStackTrace();
}
}
public static wenrgise.common.utility.WorkFlowServiceLocator2 getLocator() {
return serviceLocator;
}
public Object getService(String jndiName) throws EnrgiseSystemException {
try {
if (!this.homeCache.containsKey(jndiName)) {
Context context = WorkFlowContextProvider2.getContext();
this.homeCache.put(jndiName, context.lookup(jndiName));
}
} catch (NamingException oNa) {
System.out.println(String.valueOf(String.valueOf(String.valueOf("The problem is ").concat(String.valueOf(oNa.getMessage()))).concat(String.valueOf(" the type is "))).concat(String.valueOf(oNa.getClass().getName())));
throw new EnrgiseSystemException(oNa);
} catch (Exception oEx) {
System.out.println(String.valueOf(String.valueOf(String.valueOf("The problem is ").concat(String.valueOf(oEx.getMessage()))).concat(String.valueOf(" the type is "))).concat(String.valueOf(oEx.getClass().getName())));
throw new EnrgiseSystemException(oEx);
}
return this.homeCache.get(jndiName);
}
public EJBLocalHome getLocalHome(String jndiHomeName) throws EnrgiseSystemException {
EJBLocalHome home = null;
try {
jndiHomeName = jndiHomeName.trim();
Context context = WorkFlowContextProvider2.getLocalContext();
if (this.cacheMap.containsKey(jndiHomeName)) {
home = (EJBLocalHome)this.cacheMap.get(jndiHomeName);
} else {
home = (EJBLocalHome)context.lookup(String.valueOf("java:comp/env/").concat(String.valueOf(jndiHomeName)));
this.cacheMap.put(jndiHomeName, home);
}
} catch (NamingException ne) {
ne.printStackTrace();
throw new EnrgiseSystemException(ne);
}
return home;
}
}

View File

@@ -0,0 +1,145 @@
package WEB-INF.classes.wenrgise.common.vo;
import java.io.Serializable;
import java.util.ArrayList;
import wenrgise.common.vo.BaseVO;
public class BaseDetailVO extends BaseVO implements Serializable {
private int recordsPerPage = 0;
private int maxPage = 0;
private long currentPage = 0L;
private long currentSlot = 0L;
private long totalDetailRecord = 0L;
private ArrayList oThisPageData = null;
private ArrayList oAllPageData = null;
int rowAdded = 0;
int rowDeleted = 0;
public BaseDetailVO() {
this.oThisPageData = new ArrayList();
this.oAllPageData = new ArrayList();
this.currentSlot = 0L;
}
public void reset() {
this.currentPage = 0L;
this.currentSlot = 0L;
this.oThisPageData = new ArrayList();
this.oAllPageData = new ArrayList();
}
public ArrayList getOAllPageData() {
return this.oAllPageData;
}
public void setOAllPageData(ArrayList newOAllPageData) {
this.oAllPageData = newOAllPageData;
}
public ArrayList getOThisPageData() {
return this.oThisPageData;
}
public void setOThisPageData(ArrayList newOThisPageData) {
this.oThisPageData = newOThisPageData;
}
public long getTotalDetailRecord() {
return this.totalDetailRecord;
}
public void setTotalDetailRecord(long newTotalDetailRecord) {
this.totalDetailRecord = newTotalDetailRecord;
}
public int getRowAdded() {
return this.rowAdded;
}
public void setRowAdded(int newRowAdded) {
this.rowAdded = newRowAdded;
}
public int getRowDeleted() {
return this.rowDeleted;
}
public void setRowDeleted(int newRowDeleted) {
this.rowDeleted = newRowDeleted;
}
public long getCurrentPage() {
return this.currentPage;
}
public void setCurrentPage(long newCurrentPage) {
this.currentPage = newCurrentPage;
}
public long getCurrentSlot() {
return this.currentSlot;
}
public void setCurrentSlot(long newCurrentSlot) {
this.currentSlot = newCurrentSlot;
}
public int getMaxPage() {
return this.maxPage;
}
public void setMaxPage(int newMaxPage) {
this.maxPage = newMaxPage;
}
public int getRecordsPerPage() {
return this.recordsPerPage;
}
public void setRecordsPerPage(int newRecordsPerPage) {
this.recordsPerPage = newRecordsPerPage;
}
public long getSlot(long lPageRequested) {
return (lPageRequested % this.maxPage != 0L) ? (lPageRequested / this.maxPage + 1L) : (lPageRequested / this.maxPage);
}
public int getRelativeStart(long lPageRequested) {
long lAbsoluteIndex = (lPageRequested - 1L) * this.recordsPerPage + 1L;
return (int)(lAbsoluteIndex % (this.recordsPerPage * this.maxPage)) - 1;
}
public int getRelativeEnd(long lPageRequested) {
long lAbsoluteIndexStart = (lPageRequested - 1L) * this.recordsPerPage;
long lAbsoluteEnd = (lAbsoluteIndexStart + this.recordsPerPage < this.totalDetailRecord) ? (lAbsoluteIndexStart + this.recordsPerPage) : this.totalDetailRecord;
int iMod = (int)(lAbsoluteEnd % (this.recordsPerPage * this.maxPage));
if (iMod != 0)
return iMod - 1;
return this.recordsPerPage * this.maxPage - 1;
}
public long getAbsoluteStart(long lPageRequested) {
return (lPageRequested - 1L) * this.recordsPerPage + 1L;
}
public long getAbsoluteEnd(long lPageRequested) {
long lStart = (lPageRequested - 1L) * this.recordsPerPage;
return (lStart + (this.recordsPerPage * this.maxPage) < this.totalDetailRecord) ? (lStart + (this.recordsPerPage * this.maxPage)) : this.totalDetailRecord;
}
public long getSlotStartPosition() {
return (this.currentSlot - 1L) * this.recordsPerPage * this.maxPage + 1L;
}
public long getSlotLastPosition() {
return (this.currentSlot * this.recordsPerPage * this.maxPage < this.totalDetailRecord) ? (this.currentSlot * this.recordsPerPage * this.maxPage) : this.totalDetailRecord;
}
}

View File

@@ -0,0 +1,86 @@
package WEB-INF.classes.wenrgise.common.vo;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import wenrgise.common.bean.BaseHeaderBean;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.vo.BaseVO;
public class BaseHeaderVO extends BaseVO implements Serializable {
private ArrayList oHeaderVOTable = new ArrayList();
private long positionRequested = 0L;
private long currentSlot = 0L;
private long totalCount = 0L;
private long maxHeaderSize = 0L;
private Timestamp oWhenPicked = null;
public ArrayList getOHeaderVOTable() {
return this.oHeaderVOTable;
}
public long getHeaderStartPosition() throws EnrgiseApplicationException {
int iSlot = getSlot();
return (iSlot - 1) * this.maxHeaderSize + 1L;
}
public long getHeaderLastPosition() throws EnrgiseApplicationException {
int iSlot = getSlot();
return (iSlot * this.maxHeaderSize < this.totalCount) ? (iSlot * this.maxHeaderSize) : this.totalCount;
}
public int getSlot() throws EnrgiseApplicationException {
if (this.positionRequested < 0L || this.positionRequested > this.totalCount)
throw new EnrgiseApplicationException("wenrgise.common.navigation", "E");
return ((int)(this.positionRequested % this.maxHeaderSize) != 0) ? (int)((int)this.positionRequested / this.maxHeaderSize + 1L) : (int)(this.positionRequested / this.maxHeaderSize);
}
public void setOHeaderVOTable(ArrayList newOHeaderVOTable) {
this.oHeaderVOTable = newOHeaderVOTable;
}
public BaseHeaderBean getHeaderRecord(int iPosition) throws EnrgiseApplicationException {
if (this.oHeaderVOTable == null)
throw new EnrgiseApplicationException("wenrgise.common.norecordfound", "M");
if (this.oHeaderVOTable.size() == 0 || this.oHeaderVOTable.size() < iPosition)
throw new EnrgiseApplicationException("wenrgise.common.norecordfound", "M");
return this.oHeaderVOTable.get(iPosition - 1);
}
public long getPositionRequested() {
return this.positionRequested;
}
public void setPositionRequested(long newPositionRequested) {
this.positionRequested = newPositionRequested;
}
public long getCurrentSlot() {
return this.currentSlot;
}
public void setCurrentSlot(long newCurrentSlot) {
this.currentSlot = newCurrentSlot;
}
public long getTotalCount() {
return this.totalCount;
}
public void setTotalCount(long newTotalCount) {
this.totalCount = newTotalCount;
}
public long getMaxHeaderSize() {
return this.maxHeaderSize;
}
public void setMaxHeaderSize(long newMaxHeaderSize) {
this.maxHeaderSize = newMaxHeaderSize;
}
}

View File

@@ -0,0 +1,45 @@
package WEB-INF.classes.wenrgise.common.vo;
import java.io.Serializable;
public class BaseQueryVO implements Serializable {
private long positionRequested = 0L;
private String headerPrimaryKey = null;
private int maxHeaderSize = 0;
private String workListId;
public long getPositionRequested() {
return this.positionRequested;
}
public void setPositionRequested(long newPositionRequested) {
this.positionRequested = newPositionRequested;
}
public String getHeaderPrimaryKey() {
return this.headerPrimaryKey;
}
public void setHeaderPrimaryKey(String newHeaderPrimaryKey) {
this.headerPrimaryKey = newHeaderPrimaryKey;
}
public int getMaxHeaderSize() {
return this.maxHeaderSize;
}
public void setMaxHeaderSize(int newMaxHeaderSize) {
this.maxHeaderSize = newMaxHeaderSize;
}
public String getWorkListId() {
return this.workListId;
}
public void setWorkListId(String newWorkListId) {
this.workListId = newWorkListId;
}
}

View File

@@ -0,0 +1,36 @@
package WEB-INF.classes.wenrgise.common.vo;
import java.io.Serializable;
import java.sql.Timestamp;
public class BaseVO implements Serializable {
private Timestamp oWhenPicked = null;
private long firstPosition = 0L;
private long lastPosition = 0L;
public Timestamp getOWhenPicked() {
return this.oWhenPicked;
}
public void setOWhenPicked(Timestamp newOWhenPicked) {
this.oWhenPicked = newOWhenPicked;
}
public long getFirstPosition() {
return this.firstPosition;
}
public void setFirstPosition(long newFirstPosition) {
this.firstPosition = newFirstPosition;
}
public long getLastPosition() {
return this.lastPosition;
}
public void setLastPosition(long newLastPosition) {
this.lastPosition = newLastPosition;
}
}

View File

@@ -0,0 +1,134 @@
package WEB-INF.classes.wenrgise.common.webtier.action;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Map;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import wenrgise.common.bean.BaseDetailBean;
import wenrgise.common.bean.BaseHeaderBean;
import wenrgise.common.businessdelegate.BaseBD;
import wenrgise.common.businessdelegate.SecurityBD;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.vo.BaseDetailVO;
import wenrgise.common.vo.DetailSizeValues;
import wenrgise.common.vo.ThisPageVO;
import wenrgise.common.webtier.action.BaseAction;
import wenrgise.common.webtier.form.BaseForm;
import wenrgise.ejb.common.session.UserSession;
import wenrgise.ejb.common.utility.ParamUtil;
public class AddRowAction extends BaseAction {
public ActionForward executeImpl(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws EnrgiseApplicationException, EnrgiseSystemException, IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException, ServletException, IOException {
BaseForm oBaseForm = (BaseForm)form;
String sFormName = form.getClass().getName();
if (oBaseForm.getScreenMode().equals("N") || oBaseForm.getHeaderPrimaryKey() == null) {
String sHeaderSave = ParamUtil.getHeaderSaveRequired(sFormName);
if (null == sHeaderSave)
throw new EnrgiseApplicationException("wenrgise.common.saveheaderrecord", "M");
}
String sScreenName = oBaseForm.getScreenName();
String sHeaderPrimaryKey = oBaseForm.getHeaderPrimaryKey();
UserSession oUser = getUserSessionBean(request);
String sComponentName = getComponentName(sFormName);
checkAccessInfo(oUser, sComponentName, oBaseForm.getScreenMode(), "", 10, oBaseForm.getWorkListId());
DetailSizeValues oDetailSizeValues = new DetailSizeValues();
oDetailSizeValues.setDetailRecordPerPage(ParamUtil.getDetailRecordPerPage(sFormName, sScreenName));
oDetailSizeValues.setMaxPages(ParamUtil.getMaxDetailPages(sFormName, sScreenName));
BaseDetailVO oBaseDetailVO = oUser.getBaseDetailVO(sFormName, sScreenName);
boolean bGetDetailNotPressed = false;
BaseBD oBaseBD = getDetailBusinessDelegate((ActionForm)oBaseForm, request);
if (null == oBaseDetailVO) {
bGetDetailNotPressed = true;
oBaseDetailVO = getDetailData(oBaseForm, sFormName, sScreenName, 1L, request, oBaseBD, false, oUser);
long l = oBaseDetailVO.getTotalDetailRecord();
oBaseForm.setTotalPageCount(calculateTotalDetailPage(sFormName, sScreenName, l));
}
if (oBaseDetailVO.getCurrentPage() == 0L)
oBaseDetailVO.setCurrentPage(1L);
long lPageRequested = getPageRequested(oBaseDetailVO, oDetailSizeValues);
ArrayList oDetailList = null;
if (oBaseDetailVO.getCurrentPage() != lPageRequested) {
if (oBaseForm.isHeaderDataChanged() || oBaseForm.isDetailDataChanged()) {
BeanUtils.setProperty(oBaseForm, ParamUtil.getDetailArrayName(sFormName, sScreenName), getDetailArray(oBaseForm));
throw new EnrgiseApplicationException("wenrgise.common.savefirst", "M");
}
oBaseBD = getDetailBusinessDelegate(form, request);
oBaseDetailVO = getDetailData(oBaseForm, sFormName, sScreenName, lPageRequested, request, oBaseBD, false, oUser);
oBaseDetailVO.setRowAdded(oBaseDetailVO.getRowAdded() + 1);
oDetailList = oBaseDetailVO.getOThisPageData();
} else {
if (bGetDetailNotPressed) {
oDetailList = (oBaseDetailVO.getOThisPageData() != null) ? oBaseDetailVO.getOThisPageData() : new ArrayList();
} else {
oDetailList = getDetailArray(oBaseForm);
}
oBaseDetailVO.setRowAdded(oBaseDetailVO.getRowAdded() + 1);
}
BaseDetailBean oBaseDetailBean = getDetailBean(form);
oBaseDetailBean.setStatus("N");
oDetailList.add(oBaseDetailBean);
oBaseForm.setThisPageDetailCount(oBaseForm.getThisPageDetailCount() + 1);
oBaseForm.setDetailDataChanged(true);
long totDetRecord = oBaseDetailVO.getTotalDetailRecord() - oBaseDetailVO.getRowDeleted() + oBaseDetailVO.getRowAdded();
oBaseForm.setTotalPageCount(calculateTotalDetailPage(sFormName, sScreenName, totDetRecord));
BeanUtils.setProperty(oBaseForm, ParamUtil.getDetailArrayName(sFormName, sScreenName), oDetailList);
oUser.putBaseDetailVO(sFormName, sScreenName, oBaseDetailVO);
SecurityBD oSecBD = new SecurityBD();
Map oSecMap = oSecBD.getDisabledFields(String.valueOf(oBaseForm.getScreenName()).concat(String.valueOf(".jsp")), "DETAIL", oBaseForm.getScreenMode(), oBaseForm.getHeaderStatus());
if (null != oSecMap) {
if (null != oSecMap.get("D"))
enableDisable(oBaseForm, (ArrayList)oSecMap.get("D"), "D");
ArrayList oEnableList = new ArrayList();
oEnableList.add("butSave");
if (null != oSecMap.get("E"))
oEnableList.addAll((ArrayList)oSecMap.get("E"));
enableDisable(oBaseForm, oEnableList, "E");
}
BaseHeaderBean oThisBaseHeaderBean = getBaseHeaderBean(sFormName);
BeanUtils.copyProperties(oThisBaseHeaderBean, form);
ThisPageVO oThisPageVO = new ThisPageVO();
oThisPageVO.setOHeaderBean(oThisBaseHeaderBean);
oThisPageVO.setScreenMode(oBaseForm.getScreenMode());
oThisPageVO.setScreenName(oBaseForm.getScreenName());
oThisPageVO.setActionName(14);
oBaseDetailVO = null;
oBaseDetailVO = oUser.getBaseDetailVO(sFormName, oBaseForm.getScreenName());
if (null != oBaseDetailVO) {
ArrayList oList = getDetailArrayList(oBaseForm, sFormName, sScreenName);
oThisPageVO.setODetailList(oList);
}
Map oMap = oBaseBD.getDisabledFields(oThisPageVO);
if (oMap != null) {
if (oMap.containsKey("D"))
enableDisable(oBaseForm, (ArrayList)oMap.get("D"), "D");
if (oMap.containsKey("E"))
enableDisable(oBaseForm, (ArrayList)oMap.get("E"), "E");
}
if (oThisPageVO.getODetailList() != null) {
oBaseForm.setThisPageDetailCount(oThisPageVO.getODetailList().size());
BeanUtils.setProperty(oBaseForm, ParamUtil.getDetailArrayName(sFormName, sScreenName), oThisPageVO.getODetailList());
}
onLoad(form, request, 14);
return mapping.findForward("success");
}
private void populateThisPageList(BaseDetailVO oBaseDetailVO, DetailSizeValues oDetailSizeValues) {
long lGrandTotalDetailRecord = oBaseDetailVO.getTotalDetailRecord() - oBaseDetailVO.getRowDeleted() + oBaseDetailVO.getRowAdded();
int iPage = (int)lGrandTotalDetailRecord % oDetailSizeValues.getDetailRecordPerPage() + 1;
int iDetailStartPosition = (iPage - 1) * oDetailSizeValues.getDetailRecordPerPage() + 1;
if (iDetailStartPosition < lGrandTotalDetailRecord + 1L);
}
private long getPageRequested(BaseDetailVO oBaseDetailVO, DetailSizeValues oDetailSizeValues) {
long lLastRecordNumber = oBaseDetailVO.getTotalDetailRecord() - oBaseDetailVO.getRowDeleted() + oBaseDetailVO.getRowAdded() + 1L;
return (lLastRecordNumber % oDetailSizeValues.getDetailRecordPerPage() != 0L) ? (lLastRecordNumber / oDetailSizeValues.getDetailRecordPerPage() + 1L) : (lLastRecordNumber / oDetailSizeValues.getDetailRecordPerPage());
}
}

View File

@@ -0,0 +1,751 @@
package WEB-INF.classes.wenrgise.common.webtier.action;
import java.io.IOException;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.logging.Logger;
import javax.ejb.CreateException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
import org.apache.struts.action.ActionMessages;
import org.apache.struts.util.MessageResources;
import wenrgise.common.bean.AccessBean;
import wenrgise.common.bean.BaseDetailBean;
import wenrgise.common.bean.BaseHeaderBean;
import wenrgise.common.bean.EmpInfoBean;
import wenrgise.common.businessdelegate.BaseBD;
import wenrgise.common.businessdelegate.SecurityBD;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseMessageKeyException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.utility.DebugHelper;
import wenrgise.common.utility.EnrgiseUtil;
import wenrgise.common.utility.MessageKey;
import wenrgise.common.utility.UserInfo;
import wenrgise.common.vo.BaseDetailVO;
import wenrgise.common.vo.BaseHeaderVO;
import wenrgise.common.vo.BaseQueryVO;
import wenrgise.common.vo.DetailSizeValues;
import wenrgise.common.vo.ThisPageVO;
import wenrgise.common.webtier.form.BaseForm;
import wenrgise.common.xml.vo.DetailScreen;
import wenrgise.ejb.common.session.UserSession;
import wenrgise.ejb.common.session.UserSessionHome;
import wenrgise.ejb.common.utility.ParamUtil;
import wenrgise.ejb.common.utility.ServiceLocator;
import wenrgise.hrms.ejb.facade.HrmFacade;
import wenrgise.hrms.ejb.facade.HrmFacadeHome;
import wenrgise.hrms.ejb.facade.HrmSecondFacade;
import wenrgise.hrms.ejb.facade.HrmSecondFacadeHome;
import wenrgise.hrms.ejb.facade.HrmThirdFacade;
import wenrgise.hrms.ejb.facade.HrmThirdFacadeHome;
public abstract class BaseAction extends Action {
static final Logger log = Logger.getLogger("wenrgise.common.webtier.action.BaseAction");
MessageResources oMsgRes = null;
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
ActionErrors oErrorTable = null;
ActionMessages oMessageTable = null;
BaseForm oBaseForm = (BaseForm)form;
this.oMsgRes = getResources(request);
try {
HttpSession oSes = request.getSession();
String sUserId = (String)oSes.getAttribute("userId");
System.out.println(String.valueOf("I am in Base Action and UserId: --->").concat(String.valueOf(sUserId)));
if (null == sUserId) {
System.out.println("I am in Base Action And session expired");
System.out.println("Session has expired");
return mapping.findForward("failure");
}
DebugHelper.createUserEjb(request.getSession());
return executeImpl(mapping, form, request, response);
} catch (ClassNotFoundException oClassEx) {
processSystemException(oClassEx, oErrorTable);
} catch (InstantiationException oInSt) {
processSystemException(oInSt, oErrorTable);
} catch (InvocationTargetException oInvTar) {
processSystemException(oInvTar, oErrorTable);
} catch (IllegalAccessException oIlAcc) {
processSystemException(oIlAcc, oErrorTable);
} catch (EnrgiseSystemException oSys) {
if (oErrorTable == null)
oErrorTable = new ActionErrors();
String sKey = (null != oSys.getKey()) ? oSys.getKey() : "wenrgise.common.system";
ActionError oSysError = new ActionError(sKey);
oErrorTable.add("org.apache.struts.action.GLOBAL_ERROR", oSysError);
} catch (EnrgiseApplicationException oApp) {
if (oErrorTable == null)
oErrorTable = new ActionErrors();
if (oMessageTable == null)
oMessageTable = new ActionMessages();
processException(oErrorTable, oMessageTable, oApp);
if (oApp.getList() != null) {
Iterator oIt = oApp.getList().iterator();
while (oIt.hasNext()) {
EnrgiseApplicationException oAppErr = oIt.next();
processException(oErrorTable, oMessageTable, oAppErr);
}
}
} finally {
if (oErrorTable != null) {
System.out.println("Save errors");
if (oErrorTable.size() > 0) {
saveErrors(request, oErrorTable);
return mapping.findForward("success");
}
}
if (oMessageTable != null)
if (oMessageTable.size() > 0) {
System.out.println("Save messages");
saveMessages(request, oMessageTable);
return mapping.findForward("success");
}
}
return mapping.findForward("failure");
}
private void processSystemException(Exception oEc, ActionErrors oErrorTable) {
if (oErrorTable == null)
oErrorTable = new ActionErrors();
EnrgiseSystemException oSys = new EnrgiseSystemException("wenrgise.common.system", oEc);
ActionError oSysError = new ActionError(oSys.getKey());
oErrorTable.add("org.apache.struts.action.GLOBAL_ERROR", oSysError);
}
private void processException(ActionErrors oErrorTable, ActionMessages oMessageTable, EnrgiseApplicationException oApp) {
if (oApp.getArguments() == null) {
if (oApp.getErrorType().equals("E")) {
oErrorTable.add("org.apache.struts.action.GLOBAL_ERROR", new ActionError(oApp.getKey()));
} else {
oMessageTable.add("org.apache.struts.action.GLOBAL_MESSAGE", new ActionMessage(oApp.getKey()));
}
} else if (oApp instanceof EnrgiseMessageKeyException) {
processMessageKeyException((EnrgiseMessageKeyException)oApp, oErrorTable, oMessageTable);
} else if (oApp.getErrorType().equals("E")) {
oErrorTable.add("org.apache.struts.action.GLOBAL_ERROR", new ActionError(oApp.getKey(), oApp.getArguments().toArray()));
} else {
oMessageTable.add("org.apache.struts.action.GLOBAL_MESSAGE", new ActionMessage(oApp.getKey(), oApp.getArguments().toArray()));
}
}
private void processMessageKeyException(EnrgiseMessageKeyException oApp, ActionErrors oErrorTable, ActionMessages oMessageTable) {
ArrayList oList = oApp.getArguments();
if (null == oList) {
if (oApp.getErrorType().equals("E")) {
oErrorTable.add("org.apache.struts.action.GLOBAL_ERROR", new ActionError(oApp.getKey()));
} else {
oMessageTable.add("org.apache.struts.action.GLOBAL_MESSAGE", new ActionMessage(oApp.getKey()));
}
} else {
ArrayList oNewList = new ArrayList();
Iterator oIt = oList.iterator();
while (oIt.hasNext()) {
Object obj = oIt.next();
if (obj instanceof MessageKey) {
MessageKey oMsgKey = (MessageKey)obj;
oNewList.add(this.oMsgRes.getMessage(oMsgKey.getKey()));
continue;
}
oNewList.add(obj);
}
if (oApp.getErrorType().equals("E")) {
oErrorTable.add("org.apache.struts.action.GLOBAL_ERROR", new ActionError(oApp.getKey(), oNewList.toArray()));
} else {
oMessageTable.add("org.apache.struts.action.GLOBAL_MESSAGE", new ActionMessage(oApp.getKey(), oNewList.toArray()));
}
}
}
protected BaseQueryVO getQueryVO(ActionForm form) throws IllegalAccessException, InstantiationException, ClassNotFoundException {
BaseForm oBaseForm = (BaseForm)form;
String sFormName = form.getClass().getName();
String sScreenName = oBaseForm.getScreenName();
String sQueryVO = ParamUtil.getQueryVO(sFormName);
BaseQueryVO oBaseQueryVO = (BaseQueryVO)Class.forName(sQueryVO).newInstance();
oBaseQueryVO.setMaxHeaderSize(ParamUtil.getHeaderSize(sFormName));
return oBaseQueryVO;
}
protected BaseDetailBean getDetailBean(ActionForm form) throws IllegalAccessException, InstantiationException, ClassNotFoundException {
BaseForm oBaseForm = (BaseForm)form;
String sFormName = form.getClass().getName();
String sScreenName = oBaseForm.getScreenName();
String sDetailBean = ParamUtil.getDetailBeanName(sFormName, sScreenName);
BaseDetailBean oBaseDetailBean = (BaseDetailBean)Class.forName(sDetailBean).newInstance();
return oBaseDetailBean;
}
protected BaseBD getHeaderBusinessDelegate(ActionForm form, HttpServletRequest request) throws EnrgiseApplicationException, EnrgiseSystemException, RemoteException, IllegalAccessException, InstantiationException, ClassNotFoundException {
BaseForm oBaseForm = (BaseForm)form;
String sFormName = form.getClass().getName();
String sScreenName = oBaseForm.getScreenName();
String sBusinessDelegate = ParamUtil.getHeaderBD(sFormName);
try {
BaseBD oBaseBD = (BaseBD)Class.forName(sBusinessDelegate).newInstance();
UserSession oUser = getUserSessionBean(request);
oBaseBD.setModuleName(ParamUtil.getModuleName());
oBaseBD.setModuleFacade(oUser.getModuleFacade());
oBaseBD.setOUserInfo(oUser.getUserInfo());
return oBaseBD;
} catch (Exception Ex) {
Ex.printStackTrace();
return null;
}
}
protected BaseBD getDetailBusinessDelegate(ActionForm form, HttpServletRequest request) throws EnrgiseApplicationException, EnrgiseSystemException, RemoteException, IllegalAccessException, InstantiationException, ClassNotFoundException {
BaseForm oBaseForm = (BaseForm)form;
String sFormName = form.getClass().getName();
String sScreenName = oBaseForm.getScreenName();
String sBusinessDelegate = ParamUtil.getDetailBD(sFormName, sScreenName);
BaseBD oBaseBD = (BaseBD)Class.forName(sBusinessDelegate).newInstance();
UserSession oUser = getUserSessionBean(request);
oBaseBD.setModuleName(ParamUtil.getModuleName());
oBaseBD.setModuleFacade(oUser.getModuleFacade());
oBaseBD.setOUserInfo(oUser.getUserInfo());
return oBaseBD;
}
protected BaseHeaderBean getBaseHeaderBean(String sFormName) throws IllegalAccessException, InstantiationException, ClassNotFoundException {
String sBaseHeaderBean = ParamUtil.getHeaderBean(sFormName);
try {
BaseHeaderBean oBaseHeaderBean = (BaseHeaderBean)Class.forName(sBaseHeaderBean).newInstance();
String pseudoHeader = ParamUtil.getPseudoHeaderFlag(sFormName);
oBaseHeaderBean.setPseudoHeader(pseudoHeader);
return oBaseHeaderBean;
} catch (Exception ex) {
ex.printStackTrace();
return null;
}
}
protected ArrayList getDetailArrayList(BaseForm oBaseForm, String sFormName, String sScreenName) throws EnrgiseSystemException, IllegalAccessException, InstantiationException, ClassNotFoundException {
String sDetailArrayList = ParamUtil.getDetailArrayName(sFormName, sScreenName);
ArrayList oList = (ArrayList)EnrgiseUtil.getFieldValue(oBaseForm, sDetailArrayList);
return oList;
}
protected UserSession getUserSessionBean(HttpServletRequest request) throws EnrgiseApplicationException, RemoteException, EnrgiseSystemException {
UserInfo oUserInfo = new UserInfo();
HttpSession session = request.getSession();
UserSession oUser = (UserSession)session.getAttribute(ParamUtil.getSessionBeanName());
if (oUser == null)
try {
String sEmpId = (String)session.getAttribute("empId");
String sSiteId = (String)session.getAttribute("siteId");
UserSessionHome oUserHome = (UserSessionHome)ServiceLocator.getLocator().getService("HrmUserSession");
oUser = oUserHome.create();
HrmFacadeHome oHome = (HrmFacadeHome)ServiceLocator.getLocator().getService("HrmFacade");
HrmFacade oHrmFacade = oHome.create();
oUserInfo = oHrmFacade.getLoginUserInfo(sEmpId, sSiteId);
oUser.setUserInfo(oUserInfo);
HrmSecondFacadeHome oSecHome = (HrmSecondFacadeHome)ServiceLocator.getLocator().getService("HrmSecondFacade");
HrmSecondFacade oSecHrmFacade = oSecHome.create();
HrmThirdFacadeHome oThirdHome = (HrmThirdFacadeHome)ServiceLocator.getLocator().getService("HrmThirdFacade");
HrmThirdFacade oThirdFacade = oThirdHome.create();
HashMap oMap = new HashMap();
oMap.put(ParamUtil.getModuleName(), oHrmFacade);
oMap.put("SecHRMS", oSecHrmFacade);
oMap.put("ThirdHRMS", oThirdFacade);
oUser.setModuleFacade(oMap);
session.setAttribute(ParamUtil.getSessionBeanName(), oUser);
EmpInfoBean oEmpInfoBean = new EmpInfoBean();
oEmpInfoBean.setModuleId("8");
oEmpInfoBean.setEmpId(oUserInfo.getUserTypeId());
SecurityBD oSecurityBD = new SecurityBD();
ArrayList menu = oSecurityBD.getTreeSet(oEmpInfoBean);
HashMap secMap = oSecurityBD.getAccessInfo(oEmpInfoBean);
oUser.setAccessInfo(secMap);
session.setAttribute("menuList", menu);
session.setAttribute("userId", sEmpId);
} catch (CreateException ex) {
ex.printStackTrace();
}
return oUser;
}
protected void clearDetailLists(BaseForm form, ArrayList oDetailList) throws IllegalAccessException, InvocationTargetException {
Iterator oIt = oDetailList.iterator();
while (oIt.hasNext()) {
DetailScreen oDetailScreen = oIt.next();
BeanUtils.copyProperty(form, oDetailScreen.get_DetailArrayName(), new ArrayList());
}
}
protected ArrayList getDetailArray(BaseForm oBaseForm) throws EnrgiseSystemException, IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException {
String sFormName = oBaseForm.getClass().getName();
String sScreenName = oBaseForm.getScreenName();
ArrayList oDetailArray = new ArrayList();
String sDetailBean = ParamUtil.getDetailBeanName(sFormName, sScreenName);
BaseDetailBean oBaseDetailBean = (BaseDetailBean)Class.forName(sDetailBean).newInstance();
ArrayList oFieldList = new ArrayList();
oFieldList = getFieldList(oFieldList, oBaseDetailBean.getClass());
ArrayList oList = (ArrayList)EnrgiseUtil.getFieldValue(oBaseForm, ParamUtil.getDetailArrayName(sFormName, sScreenName));
for (int iRecord = 0; iRecord < oBaseForm.getThisPageDetailCount(); iRecord++) {
if (null == oList)
break;
oBaseDetailBean = oList.get(iRecord);
if (null == oBaseDetailBean)
break;
Iterator oIt = oFieldList.iterator();
while (oIt.hasNext()) {
try {
Field ob = oIt.next();
String sFieldName = ob.getName();
if (sFieldName.startsWith("disab"))
continue;
if (ob.getType().getName().equals("java.lang.String")) {
String sValue = BeanUtils.getIndexedProperty(oBaseForm, sFieldName, iRecord);
BeanUtils.setProperty(oBaseDetailBean, sFieldName, sValue);
}
} catch (NoSuchMethodException noSuchMethodException) {}
}
oDetailArray.add(oBaseDetailBean);
}
return oDetailArray;
}
private ArrayList getFieldList(ArrayList oFieldList, Class oClass) {
if (oClass == null)
return oFieldList;
Field[] oFields = oClass.getDeclaredFields();
EnrgiseUtil.addToList(oFieldList, (Object[])oFields);
return getFieldList(oFieldList, oClass.getSuperclass());
}
protected void changeMode(BaseForm oBaseForm, HttpServletRequest request) throws EnrgiseApplicationException, EnrgiseSystemException, IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException, ServletException, IOException {
String sFormName = oBaseForm.getClass().getName();
String sScreenName = oBaseForm.getScreenName();
BaseHeaderBean oBaseHeaderBean = getBaseHeaderBean(sFormName);
BeanUtils.copyProperties(oBaseForm, oBaseHeaderBean);
clearDetailLists(oBaseForm, ParamUtil.getDetailList(sFormName));
UserSession oUser = getUserSessionBean(request);
oUser.putBaseHeaderVO(sFormName, null);
oUser.removeAllDetailVO(sFormName);
resetForm(oBaseForm);
}
protected void checkHeaderNavigation(BaseForm oBaseForm, BaseHeaderVO oBaseHeaderVO) throws EnrgiseApplicationException {
long lPositionRequested = Long.parseLong(oBaseForm.getUserPositionRequested());
if (null != oBaseHeaderVO) {
if (lPositionRequested <= 0L || lPositionRequested > oBaseHeaderVO.getTotalCount())
throw new EnrgiseApplicationException("wenrgise.common.headerNavigation", "E");
oBaseForm.setPositionRequested(lPositionRequested);
} else {
throw new EnrgiseApplicationException("wenrgise.common.headerNavigation", "E");
}
}
private void resetForm(BaseForm oBaseForm) {
oBaseForm.setPageRequested(0L);
oBaseForm.setPositionRequested(0L);
oBaseForm.setTotalCount(0L);
oBaseForm.setTotalDetailRecord(0L);
oBaseForm.setTotalHeaderRecord(0L);
oBaseForm.setHeaderPrimaryKey(null);
oBaseForm.setUserPageRequested(null);
oBaseForm.setDetailId(null);
oBaseForm.setStatus(null);
oBaseForm.setDetailDataChanged(false);
oBaseForm.setHeaderDataChanged(false);
oBaseForm.setChecked(null);
oBaseForm.setUserPositionRequested(null);
oBaseForm.setTotalCount(0L);
oBaseForm.setNewPageRequested(null);
oBaseForm.setItemChecked(null);
oBaseForm.setLovKey(null);
oBaseForm.setTxtSearchFields(null);
oBaseForm.setTxtDisplayFields(null);
oBaseForm.setTxtIndex(null);
oBaseForm.setThisPageDetailCount(0);
oBaseForm.setTotalPageCount(0L);
oBaseForm.setHeaderStatus(null);
oBaseForm.setButtonClicked(null);
oBaseForm.setButtonName(null);
oBaseForm.setDetailStartPage(0);
}
protected void checkDetailNavigation(BaseForm oBaseForm, BaseDetailVO oBaseDetailVO) throws EnrgiseApplicationException {
boolean flag = false;
long lPageRequested = 0L;
if (EnrgiseUtil.checkString(oBaseForm.getUserPageRequested())) {
lPageRequested = Long.parseLong(oBaseForm.getUserPageRequested());
} else {
flag = true;
}
if (null != oBaseDetailVO) {
if (flag == false) {
if (lPageRequested <= 0L || oBaseDetailVO.getTotalDetailRecord() <= oBaseDetailVO.getRecordsPerPage() * (lPageRequested - 1L))
throw new EnrgiseApplicationException("wenrgise.common.detailNavigation", "E");
oBaseForm.setPageRequested(lPageRequested);
} else if (oBaseForm.getDetailList() != null) {
oBaseForm.setPageRequested(1L);
} else {
oBaseForm.setPageRequested(0L);
}
} else {
throw new EnrgiseApplicationException("wenrgise.common.detailNavigation", "E");
}
}
protected void enableDisable(BaseForm oBaseForm, ArrayList arylstFields, String enableFlag) throws EnrgiseApplicationException, EnrgiseSystemException, IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException, ServletException, IOException {
if (null != arylstFields) {
Iterator iterFields = arylstFields.iterator();
while (iterFields.hasNext()) {
StringBuffer sField = new StringBuffer(iterFields.next());
String sProperty = String.valueOf("setDisab").concat(String.valueOf(sField.toString()));
try {
Class[] oCls = { Class.forName("java.lang.String") };
Method oMethod = oBaseForm.getClass().getMethod(sProperty, oCls);
String sFlag = enableFlag.equals("D") ? "true" : "false";
Object[] obj = { sFlag };
oMethod.invoke(oBaseForm, obj);
} catch (NoSuchMethodException nse) {
System.out.println(String.valueOf(String.valueOf(String.valueOf("The problem is ").concat(String.valueOf(nse.getMessage()))).concat(String.valueOf(" "))).concat(String.valueOf(sProperty)));
}
}
}
}
protected void enableAll(BaseForm oBaseForm) {
try {
ArrayList arylstDisFields = new ArrayList();
ArrayList arylstFields = new ArrayList();
arylstFields = getFieldList(arylstFields, oBaseForm.getClass());
Iterator iterFields = arylstFields.iterator();
while (iterFields.hasNext()) {
Field oField = iterFields.next();
if (oField.getName().startsWith("disab"))
arylstDisFields.add(oField.getName().replaceFirst("disab", ""));
}
enableDisable(oBaseForm, arylstDisFields, "E");
} catch (Exception exception) {}
}
protected void disableAll(BaseForm oBaseForm) {
try {
ArrayList arylstDisFields = new ArrayList();
ArrayList arylstFields = new ArrayList();
arylstFields = getFieldList(arylstFields, oBaseForm.getClass());
Iterator iterFields = arylstFields.iterator();
while (iterFields.hasNext()) {
Field oField = iterFields.next();
if (oField.getName().startsWith("disab"))
arylstDisFields.add(oField.getName().replaceFirst("disab", ""));
}
enableDisable(oBaseForm, arylstDisFields, "D");
} catch (Exception exception) {}
}
protected ArrayList queryClicked() {
ArrayList arylstFields = new ArrayList();
arylstFields.add("butQuery");
arylstFields.add("butSave");
arylstFields.add("butDelete");
arylstFields.add("butPrint");
arylstFields.add("butGetDetail");
arylstFields.add("butAddRow");
arylstFields.add("butDelRow");
arylstFields.add("butNextHeader");
arylstFields.add("butPrevHeader");
arylstFields.add("newPositionRequested");
arylstFields.add("butJumpHeader");
arylstFields.add("butNextDetail");
arylstFields.add("butPrevDetail");
arylstFields.add("newPageRequested");
arylstFields.add("butJumpDetail");
return arylstFields;
}
protected ArrayList insertClicked() {
ArrayList arylstFields = new ArrayList();
arylstFields.add("butInsert");
arylstFields.add("butExecute");
arylstFields.add("butDelete");
arylstFields.add("butPrint");
arylstFields.add("butGetDetail");
arylstFields.add("butAddRow");
arylstFields.add("butDelRow");
arylstFields.add("butNextHeader");
arylstFields.add("butPrevHeader");
arylstFields.add("newPositionRequested");
arylstFields.add("butJumpHeader");
arylstFields.add("butNextDetail");
arylstFields.add("butPrevDetail");
arylstFields.add("newPageRequested");
arylstFields.add("butJumpDetail");
return arylstFields;
}
protected ArrayList executeClicked() {
ArrayList arylstFields = new ArrayList();
arylstFields.add("butExecute");
arylstFields.add("butAddRow");
arylstFields.add("butDelRow");
arylstFields.add("butExecute");
arylstFields.add("butNextDetail");
arylstFields.add("butPrevDetail");
arylstFields.add("butJumpDetail");
arylstFields.add("newPageRequested");
return arylstFields;
}
protected ArrayList deleteClicked() {
ArrayList arylstFields = new ArrayList();
arylstFields.add("butQuery");
arylstFields.add("butExecute");
arylstFields.add("butDelete");
return arylstFields;
}
protected ArrayList saveClicked() {
ArrayList arylstFields = new ArrayList();
arylstFields.add("butExecute");
arylstFields.add("butGetDetail");
return arylstFields;
}
protected ArrayList refreshClicked() {
ArrayList arylstFields = new ArrayList();
return arylstFields;
}
protected ArrayList nextHeaderClicked() {
ArrayList arylstFields = new ArrayList();
arylstFields.add("butExecute");
arylstFields.add("butAddRow");
arylstFields.add("butDelRow");
arylstFields.add("butNextDetail");
arylstFields.add("butPrevDetail");
arylstFields.add("butJumpDetail");
arylstFields.add("newPageRequested");
return arylstFields;
}
protected ArrayList prevHeaderClicked() {
ArrayList arylstFields = new ArrayList();
arylstFields.add("butExecute");
arylstFields.add("butAddRow");
arylstFields.add("butDelRow");
arylstFields.add("butNextDetail");
arylstFields.add("butPrevDetail");
arylstFields.add("butJumpDetail");
arylstFields.add("newPageRequested");
return arylstFields;
}
protected ArrayList getDetailClicked() {
ArrayList arylstFields = new ArrayList();
arylstFields.add("butGetDetail");
return arylstFields;
}
protected ArrayList addRowClicked() {
ArrayList arylstFields = new ArrayList();
arylstFields.add("butGetDetail");
return arylstFields;
}
protected ArrayList delRowClicked() {
ArrayList arylstFields = new ArrayList();
arylstFields.add("butDelRow");
arylstFields.add("butGetDetail");
return arylstFields;
}
protected void controlHeaderNavigation(BaseForm oBaseForm) throws EnrgiseApplicationException, EnrgiseSystemException, IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException, ServletException, IOException {
ArrayList arylstFields = new ArrayList();
long lTotalRecord = oBaseForm.getTotalCount();
long lRecordNum = oBaseForm.getPositionRequested();
if (lTotalRecord == 0L || lTotalRecord == 1L) {
arylstFields.add("butNextHeader");
arylstFields.add("butPrevHeader");
arylstFields.add("newPositionRequested");
arylstFields.add("butJumpHeader");
} else {
if (lRecordNum == lTotalRecord)
arylstFields.add("butNextHeader");
if (lRecordNum == 1L)
arylstFields.add("butPrevHeader");
}
enableDisable(oBaseForm, arylstFields, "D");
}
protected void controlDetailNavigation(BaseForm oBaseForm) throws EnrgiseApplicationException, EnrgiseSystemException, IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException, ServletException, IOException {
ArrayList oEnableList = new ArrayList();
ArrayList oDisableList = new ArrayList();
long lTotalRecord = oBaseForm.getTotalPageCount();
long lRecordNum = oBaseForm.getPageRequested();
if (lTotalRecord == 0L || lTotalRecord == 1L) {
oDisableList.add("butNextDetail");
oDisableList.add("butPrevDetail");
oDisableList.add("newPageRequested");
oDisableList.add("butJumpDetail");
} else if (lRecordNum == lTotalRecord) {
oEnableList.add("butPrevDetail");
oEnableList.add("newPageRequested");
oEnableList.add("butJumpDetail");
oDisableList.add("butNextDetail");
} else if (lRecordNum == 1L) {
oEnableList.add("newPageRequested");
oEnableList.add("butJumpDetail");
oEnableList.add("butNextDetail");
oDisableList.add("butPrevDetail");
} else {
oEnableList.add("newPageRequested");
oEnableList.add("butJumpDetail");
oEnableList.add("butNextDetail");
oEnableList.add("butPrevDetail");
}
enableDisable(oBaseForm, oEnableList, "E");
enableDisable(oBaseForm, oDisableList, "D");
}
protected void resetDetailPageData(BaseForm oBaseForm) {
oBaseForm.setPageRequested(0L);
oBaseForm.setTotalPageCount(0L);
}
protected long calculateTotalDetailPage(String sFormName, String sScreenName, long lTotDetRecord) {
long totRecPerPage = ParamUtil.getDetailRecordPerPage(sFormName, sScreenName);
if (lTotDetRecord % totRecPerPage != 0L)
return lTotDetRecord / totRecPerPage + 1L;
return lTotDetRecord / totRecPerPage;
}
protected BaseDetailVO getDetailData(BaseForm oBaseForm, String sFormName, String sScreenName, long lPageRequested, HttpServletRequest request, BaseBD oBaseBD, boolean bForce, UserSession oUser) throws RemoteException, ClassNotFoundException, InvocationTargetException, InstantiationException, IllegalAccessException, EnrgiseApplicationException, EnrgiseSystemException {
String sHeaderPrimaryKey = oBaseForm.getHeaderPrimaryKey();
String pseudoHeader = ParamUtil.getPseudoHeaderFlag(sFormName);
DetailSizeValues oDetailSizeValues = new DetailSizeValues();
oDetailSizeValues.setDetailRecordPerPage(ParamUtil.getDetailRecordPerPage(sFormName, sScreenName));
oDetailSizeValues.setMaxPages(ParamUtil.getMaxDetailPages(sFormName, sScreenName));
BaseDetailVO oBaseDetailVO = null;
oBaseDetailVO = oUser.getBaseDetailVO(sFormName, sScreenName);
if (!EnrgiseUtil.checkString(pseudoHeader)) {
oBaseDetailVO = oBaseBD.getDetailRecord(sFormName, sScreenName, sHeaderPrimaryKey, lPageRequested, oDetailSizeValues, oBaseDetailVO, bForce, oUser);
} else {
BaseQueryVO oBaseQueryVO = getQueryVO((ActionForm)oBaseForm);
BeanUtils.copyProperties(oBaseQueryVO, oBaseForm);
oBaseDetailVO = oBaseBD.getDetailRecord(sFormName, sScreenName, oBaseQueryVO, lPageRequested, oDetailSizeValues, oBaseDetailVO, bForce, oUser);
}
if (oBaseDetailVO.getOThisPageData() != null)
BeanUtils.setProperty(oBaseForm, ParamUtil.getDetailArrayName(sFormName, sScreenName), oBaseDetailVO.getOThisPageData());
oBaseForm.setPageRequested(lPageRequested);
oBaseForm.setThisPageDetailCount((null != oBaseDetailVO.getOThisPageData()) ? oBaseDetailVO.getOThisPageData().size() : 0);
BeanUtils.copyProperties(oBaseForm, oBaseDetailVO);
oBaseForm.setNewPageRequested(null);
oBaseForm.setPageRequested(lPageRequested);
oUser.putBaseDetailVO(sFormName, sScreenName, oBaseDetailVO);
return oBaseDetailVO;
}
protected void onLoad(ActionForm form, HttpServletRequest request, int actionName) throws RemoteException, ClassNotFoundException, InvocationTargetException, InstantiationException, IllegalAccessException, EnrgiseApplicationException, EnrgiseSystemException {
BaseForm oBaseForm = (BaseForm)form;
String sFormName = form.getClass().getName();
String sScreenName = oBaseForm.getScreenName();
BaseDetailVO oBaseDetailVO = new BaseDetailVO();
UserSession oUser = getUserSessionBean(request);
BaseBD oBaseBD = getHeaderBusinessDelegate(form, request);
BaseHeaderBean oBaseHeaderBean = getBaseHeaderBean(sFormName);
BeanUtils.copyProperties(oBaseHeaderBean, form);
ThisPageVO oThisPageVO = new ThisPageVO();
oThisPageVO.setActionName(actionName);
oThisPageVO.setOHeaderBean(oBaseHeaderBean);
oThisPageVO.setScreenMode(oBaseForm.getScreenMode());
oThisPageVO.setScreenName(oBaseForm.getScreenName());
oBaseDetailVO = oUser.getBaseDetailVO(sFormName, sScreenName);
if (null != oBaseDetailVO) {
ArrayList oDetailList = getDetailArrayList(oBaseForm, sFormName, sScreenName);
oThisPageVO.setODetailList(oDetailList);
}
oBaseBD.onLoadAction(oThisPageVO);
if (oThisPageVO != null)
if (oThisPageVO.getOHeaderBean() != null)
BeanUtils.copyProperties(form, oThisPageVO.getOHeaderBean());
if (oThisPageVO.getODetailList() != null) {
oBaseForm.setThisPageDetailCount(oThisPageVO.getODetailList().size());
BeanUtils.setProperty(oBaseForm, ParamUtil.getDetailArrayName(sFormName, sScreenName), oThisPageVO.getODetailList());
}
}
protected void checkAccessInfo(UserSession oUserSession, String sComponentName, String sScreenMode, String sButtonName, int iActionName, String sWorkListId) throws RemoteException, EnrgiseApplicationException, EnrgiseSystemException {
HashMap oSecMap = oUserSession.getAccessInfo();
AccessBean objBean = (AccessBean)oSecMap.get(sComponentName);
if (!EnrgiseUtil.checkString(sWorkListId)) {
if (iActionName == 10 || iActionName == 14 || iActionName == 23) {
String s = null;
System.out.println("I am in AccessInfo");
System.out.println("Insert Flag: ");
try {
if (!objBean.getInsertFlag().equalsIgnoreCase("Y")) {
System.out.println("after Insert Flag: ");
ArrayList oParam = new ArrayList();
MessageKey oMessageKey = new MessageKey("right.for.insert");
oParam.add(oMessageKey);
throw new EnrgiseMessageKeyException("wenrgise.authorisation.error", oParam, "M");
}
} catch (Exception e) {
e.printStackTrace();
}
}
if (iActionName == 8)
if (sScreenMode.equalsIgnoreCase("N")) {
if (!objBean.getInsertFlag().equalsIgnoreCase("Y")) {
ArrayList oParam = new ArrayList();
MessageKey oMessageKey = new MessageKey("right.for.insert");
oParam.add(oMessageKey);
throw new EnrgiseMessageKeyException("wenrgise.authorisation.error", oParam, "M");
}
} else if (sScreenMode.equalsIgnoreCase("U")) {
if (!objBean.getUpdateFlag().equalsIgnoreCase("Y")) {
ArrayList oParam = new ArrayList();
MessageKey oMessageKey = new MessageKey("right.for.update");
oParam.add(oMessageKey);
throw new EnrgiseMessageKeyException("wenrgise.authorisation.error", oParam, "M");
}
}
if (iActionName == 17 || iActionName == 15)
if (!objBean.getDeleteFlag().equalsIgnoreCase("Y")) {
ArrayList oParam = new ArrayList();
MessageKey oMessageKey = new MessageKey("right.for.delete");
oParam.add(oMessageKey);
throw new EnrgiseMessageKeyException("wenrgise.authorisation.error", oParam, "M");
}
}
}
protected String getComponentName(String sFormName) {
String sModFormName = sFormName.replace('.', ',');
int index = 0;
char g = ',';
char[] arrayModeFormName = sModFormName.toCharArray();
int k;
for (k = arrayModeFormName.length - 1; k > 0; k--) {
if (arrayModeFormName[k] == g) {
index = k + 1;
break;
}
}
String sComponentName = sModFormName.substring(index, sModFormName.length());
return sComponentName;
}
public abstract ActionForward executeImpl(ActionMapping paramActionMapping, ActionForm paramActionForm, HttpServletRequest paramHttpServletRequest, HttpServletResponse paramHttpServletResponse) throws EnrgiseApplicationException, EnrgiseSystemException, IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException, ServletException, IOException;
}

View File

@@ -0,0 +1,23 @@
package WEB-INF.classes.wenrgise.common.webtier.action;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.webtier.action.BaseAction;
import wenrgise.common.webtier.form.BaseForm;
public class CancelAction extends BaseAction {
public ActionForward executeImpl(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws EnrgiseApplicationException, EnrgiseSystemException, IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException, ServletException, IOException {
BaseForm oBaseForm = (BaseForm)form;
oBaseForm.setHeaderDataChanged(false);
oBaseForm.setDetailDataChanged(false);
return mapping.getInputForward();
}
}

View File

@@ -0,0 +1,65 @@
package WEB-INF.classes.wenrgise.common.webtier.action;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import wenrgise.common.bean.BaseDetailBean;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.vo.BaseDetailVO;
import wenrgise.common.webtier.action.BaseAction;
import wenrgise.common.webtier.form.BaseForm;
import wenrgise.ejb.common.session.UserSession;
import wenrgise.ejb.common.utility.ParamUtil;
public class DecrAction extends BaseAction {
public ActionForward executeImpl(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws EnrgiseApplicationException, EnrgiseSystemException, IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException, ServletException, IOException {
BaseForm oBaseForm = (BaseForm)form;
String sFormName = form.getClass().getName();
String sScreenName = oBaseForm.getScreenName();
UserSession oUser = getUserSessionBean(request);
BaseDetailVO oBaseDetailVO = oUser.getBaseDetailVO(sFormName, sScreenName);
int count = 0;
ArrayList oDetailArray = getDetailArray(oBaseForm);
try {
String[] itemChecked = oBaseForm.getItemChecked();
String[] sStatuss = oBaseForm.getStatus();
String[] sStartFields = BeanUtils.getArrayProperty(oBaseForm, "startField");
for (int i = 0; i < itemChecked.length; i++) {
if (itemChecked[i].equals("Y")) {
count++;
String sStartField = sStartFields[i];
if (i < itemChecked.length - 1) {
for (int j = i + 1; j < itemChecked.length; j++) {
String sStatus = sStatuss[j];
if (!sStatus.equals("D")) {
BaseDetailBean oBaseDetailBean = oDetailArray.get(j);
oBaseDetailBean.setStatus("U");
BeanUtils.setProperty(oBaseDetailBean, "startField", sStartField);
oDetailArray.set(j, oBaseDetailBean);
break;
}
}
((BaseDetailBean)oDetailArray.get(i)).setStatus("D");
((BaseDetailBean)oDetailArray.get(i)).setItemChecked("N");
oBaseDetailVO.setRowDeleted(oBaseDetailVO.getRowDeleted() + 1);
}
}
}
} catch (NoSuchMethodException noSuchMethodException) {}
if (count > 0)
oBaseForm.setDetailDataChanged(true);
oBaseDetailVO.setOThisPageData(oDetailArray);
BeanUtils.setProperty(oBaseForm, ParamUtil.getDetailArrayName(sFormName, sScreenName), oBaseDetailVO.getOThisPageData());
oUser.putBaseDetailVO(sFormName, sScreenName, oBaseDetailVO);
onLoad(form, request, 16);
return mapping.findForward("success");
}
}

View File

@@ -0,0 +1,109 @@
package WEB-INF.classes.wenrgise.common.webtier.action;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Map;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import wenrgise.common.bean.BaseHeaderBean;
import wenrgise.common.businessdelegate.BaseBD;
import wenrgise.common.businessdelegate.SecurityBD;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.vo.BaseDetailVO;
import wenrgise.common.vo.BaseHeaderVO;
import wenrgise.common.vo.BaseQueryVO;
import wenrgise.common.vo.ThisPageVO;
import wenrgise.common.webtier.action.BaseAction;
import wenrgise.common.webtier.form.BaseForm;
import wenrgise.ejb.common.session.UserSession;
import wenrgise.ejb.common.utility.ParamUtil;
public class DeleteAction extends BaseAction {
public ActionForward executeImpl(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws EnrgiseApplicationException, EnrgiseSystemException, IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException, ServletException, IOException {
BaseForm oBaseForm = (BaseForm)form;
String sFormName = form.getClass().getName();
String sScreenName = oBaseForm.getScreenName();
BaseBD oBaseBD = getHeaderBusinessDelegate(form, request);
UserSession oUser = getUserSessionBean(request);
String sComponentName = getComponentName(sFormName);
checkAccessInfo(oUser, sComponentName, oBaseForm.getScreenMode(), "", 17, oBaseForm.getWorkListId());
BaseHeaderBean oBaseHeaderBean = getBaseHeaderBean(sFormName);
ArrayList oDetailBeanArray = null;
BaseDetailVO oBaseDetailVO = null;
BaseHeaderVO oBaseHeaderVO = null;
Timestamp oHeaderPicked = null;
Timestamp oDetailPicked = null;
oBaseHeaderVO = oUser.getBaseHeaderVO(sFormName);
if (oBaseHeaderVO != null) {
oHeaderPicked = oBaseHeaderVO.getOWhenPicked();
oBaseHeaderBean = getBaseHeaderBean(sFormName);
if (oBaseHeaderBean == null)
oBaseHeaderBean = getBaseHeaderBean(sFormName);
}
BeanUtils.copyProperties(oBaseHeaderBean, form);
oBaseForm.setHeaderDataChanged(true);
String sHeaderPrimaryKey = oBaseBD.saveRecord(oBaseHeaderBean, oHeaderPicked, oBaseForm.getScreenName(), "D", oBaseForm.isHeaderDataChanged(), oDetailBeanArray, oBaseForm.isDetailDataChanged(), oDetailPicked);
BaseQueryVO oBaseQueryVO = null;
if (oBaseForm.getPositionRequested() > 0L && sHeaderPrimaryKey == null) {
if (oBaseForm.getTotalHeaderRecord() == 1L) {
oBaseForm.setScreenMode("Q");
changeMode(oBaseForm, request);
} else {
oBaseHeaderVO = oBaseBD.getNextHeaderRecord(oBaseQueryVO, oBaseForm.getPositionRequested(), sFormName, true, oUser);
int iRelativePosition = (int)(oBaseHeaderVO.getPositionRequested() - oBaseHeaderVO.getHeaderStartPosition() + 1L);
BeanUtils.copyProperties(form, oBaseHeaderVO.getHeaderRecord(iRelativePosition));
BeanUtils.copyProperties(form, oBaseHeaderVO);
oBaseForm.setTotalHeaderRecord(((int)oBaseForm.getTotalHeaderRecord() - 1));
oBaseHeaderVO.setTotalCount(oBaseHeaderVO.getTotalCount() - 1L);
oBaseForm.setHeaderDataChanged(false);
oBaseForm.setDetailDataChanged(false);
oBaseForm.setScreenMode("U");
}
} else {
oBaseQueryVO = getQueryVO(form);
oBaseQueryVO.setHeaderPrimaryKey(sHeaderPrimaryKey);
oBaseQueryVO.setMaxHeaderSize(ParamUtil.getHeaderSize(sFormName));
oBaseHeaderVO = oBaseBD.getHeaderRecord(oBaseQueryVO, sFormName, oUser);
BeanUtils.copyProperties(form, oBaseHeaderVO.getHeaderRecord(1));
BeanUtils.copyProperties(form, oBaseHeaderVO);
oBaseForm.setScreenMode("U");
}
enableAll(oBaseForm);
enableDisable(oBaseForm, saveClicked(), "D");
controlHeaderNavigation(oBaseForm);
SecurityBD oSecBD = new SecurityBD();
Map oSecMap = oSecBD.getDisabledFields(String.valueOf(oBaseForm.getScreenName()).concat(String.valueOf(".jsp")), "ALL", oBaseForm.getScreenMode(), oBaseForm.getHeaderStatus());
if (null != oSecMap)
enableDisable(oBaseForm, (ArrayList)oSecMap.get("D"), "D");
BaseHeaderBean oThisBaseHeaderBean = getBaseHeaderBean(sFormName);
BeanUtils.copyProperties(oThisBaseHeaderBean, form);
ThisPageVO oThisPageVO = new ThisPageVO();
oThisPageVO.setOHeaderBean(oThisBaseHeaderBean);
oThisPageVO.setScreenMode(oBaseForm.getScreenMode());
oThisPageVO.setScreenName(oBaseForm.getScreenName());
oThisPageVO.setActionName(17);
oBaseDetailVO = null;
oBaseDetailVO = oUser.getBaseDetailVO(sFormName, oBaseForm.getScreenName());
if (null != oBaseDetailVO) {
ArrayList oDetailList = (oBaseDetailVO.getOThisPageData() != null) ? oBaseDetailVO.getOThisPageData() : new ArrayList();
oThisPageVO.setODetailList(oDetailList);
}
Map oMap = oBaseBD.getDisabledFields(oThisPageVO);
if (oMap != null) {
if (oMap.containsKey("D"))
enableDisable(oBaseForm, (ArrayList)oMap.get("D"), "D");
if (oMap.containsKey("E"))
enableDisable(oBaseForm, (ArrayList)oMap.get("E"), "E");
}
onLoad(form, request, 17);
return mapping.findForward("success");
}
}

View File

@@ -0,0 +1,90 @@
package WEB-INF.classes.wenrgise.common.webtier.action;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Map;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import wenrgise.common.bean.BaseDetailBean;
import wenrgise.common.bean.BaseHeaderBean;
import wenrgise.common.businessdelegate.BaseBD;
import wenrgise.common.businessdelegate.SecurityBD;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.utility.UserInfo;
import wenrgise.common.vo.BaseDetailVO;
import wenrgise.common.vo.ThisPageVO;
import wenrgise.common.webtier.action.BaseAction;
import wenrgise.common.webtier.form.BaseForm;
import wenrgise.ejb.common.session.UserSession;
import wenrgise.ejb.common.utility.ParamUtil;
public class DeleteRowAction extends BaseAction {
public ActionForward executeImpl(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws EnrgiseApplicationException, EnrgiseSystemException, IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException, ServletException, IOException {
BaseForm oBaseForm = (BaseForm)form;
String sFormName = form.getClass().getName();
String sScreenName = oBaseForm.getScreenName();
String[] itemChecked = oBaseForm.getItemChecked();
UserSession oUser = getUserSessionBean(request);
String sComponentName = getComponentName(sFormName);
checkAccessInfo(oUser, sComponentName, oBaseForm.getScreenMode(), "", 17, oBaseForm.getWorkListId());
BaseDetailVO oBaseDetailVO = oUser.getBaseDetailVO(sFormName, sScreenName);
BaseDetailBean oBaseDetailBean = null;
boolean newRecordFlag = false;
UserInfo oUserInfo = oUser.getUserInfo();
SecurityBD oSecBD = new SecurityBD();
ArrayList oDetailArray = getDetailArray(oBaseForm);
int count = 0;
for (int i = 0; i < itemChecked.length; i++) {
if (itemChecked[i].equals("Y"))
if (!((BaseDetailBean)oDetailArray.get(i)).getStatus().equals("N")) {
count++;
((BaseDetailBean)oDetailArray.get(i)).setStatus("D");
oBaseDetailVO.setRowDeleted(oBaseDetailVO.getRowDeleted() + 1);
} else {
oDetailArray.remove(i);
oBaseDetailVO.setRowDeleted(oBaseDetailVO.getRowAdded() - 1);
newRecordFlag = true;
}
}
if (count == 0 && newRecordFlag == false)
throw new EnrgiseApplicationException("wenrgise.common.norowselected");
if (count > 0)
oBaseForm.setDetailDataChanged(true);
oBaseDetailVO.setOThisPageData(oDetailArray);
BeanUtils.setProperty(oBaseForm, ParamUtil.getDetailArrayName(sFormName, sScreenName), oBaseDetailVO.getOThisPageData());
oUser.putBaseDetailVO(sFormName, sScreenName, oBaseDetailVO);
BaseHeaderBean oThisBaseHeaderBean = getBaseHeaderBean(sFormName);
BeanUtils.copyProperties(oThisBaseHeaderBean, form);
ThisPageVO oThisPageVO = new ThisPageVO();
oThisPageVO.setOHeaderBean(oThisBaseHeaderBean);
oThisPageVO.setScreenMode(oBaseForm.getScreenMode());
oThisPageVO.setScreenName(oBaseForm.getScreenName());
oBaseDetailVO = null;
oBaseDetailVO = oUser.getBaseDetailVO(sFormName, oBaseForm.getScreenName());
if (null != oBaseDetailVO) {
ArrayList oThisList = (oBaseDetailVO.getOThisPageData() != null) ? oBaseDetailVO.getOThisPageData() : new ArrayList();
oThisPageVO.setODetailList(oThisList);
}
BaseBD oBaseBD = getDetailBusinessDelegate(form, request);
Map oMap = oBaseBD.getDisabledFields(oThisPageVO);
if (oMap != null) {
if (oMap.containsKey("D"))
enableDisable(oBaseForm, (ArrayList)oMap.get("D"), "D");
if (oMap.containsKey("E"))
enableDisable(oBaseForm, (ArrayList)oMap.get("E"), "E");
}
if (oThisPageVO.getODetailList() != null) {
oBaseForm.setThisPageDetailCount(oThisPageVO.getODetailList().size());
BeanUtils.setProperty(oBaseForm, ParamUtil.getDetailArrayName(sFormName, sScreenName), oThisPageVO.getODetailList());
}
onLoad(form, request, 15);
return mapping.findForward("success");
}
}

View File

@@ -0,0 +1,34 @@
package WEB-INF.classes.wenrgise.common.webtier.action;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.webtier.action.BaseAction;
import wenrgise.common.webtier.form.BaseForm;
import wenrgise.ejb.common.session.UserSession;
public class ExitAction extends BaseAction {
public ActionForward executeImpl(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws EnrgiseApplicationException, EnrgiseSystemException, IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException, ServletException, IOException {
System.out.println("I am in Exit Action ---->");
BaseForm oBaseForm = (BaseForm)form;
String sFormBean = mapping.getAttribute();
String sScreenName = oBaseForm.getScreenName();
if (oBaseForm.isHeaderDataChanged() || oBaseForm.isDetailDataChanged())
throw new EnrgiseApplicationException("wenrgise.common.datashouldbesaved", "M");
String sFormName = form.getClass().getName();
UserSession oUser = getUserSessionBean(request);
if (oUser != null)
oUser.removeAllIfExists(sFormName, sScreenName);
HttpSession session = request.getSession();
session.removeAttribute(sFormBean);
return mapping.findForward("success");
}
}

View File

@@ -0,0 +1,132 @@
package WEB-INF.classes.wenrgise.common.webtier.action;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Map;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import wenrgise.common.bean.BaseHeaderBean;
import wenrgise.common.businessdelegate.BaseBD;
import wenrgise.common.businessdelegate.SecurityBD;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.vo.BaseDetailVO;
import wenrgise.common.vo.BaseHeaderVO;
import wenrgise.common.vo.BaseQueryVO;
import wenrgise.common.vo.DetailSizeValues;
import wenrgise.common.vo.ThisPageVO;
import wenrgise.common.webtier.action.BaseAction;
import wenrgise.common.webtier.form.BaseForm;
import wenrgise.ejb.common.session.UserSession;
import wenrgise.ejb.common.utility.ParamUtil;
public class GetButtonAction extends BaseAction {
public ActionForward executeImpl(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws EnrgiseApplicationException, EnrgiseSystemException, IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException, ServletException, IOException {
BaseForm oBaseForm = (BaseForm)form;
if (oBaseForm.getScreenMode().equals("N"))
throw new EnrgiseApplicationException("wenrgise.common.saveheaderrecord", "M");
if (oBaseForm.isHeaderDataChanged() || oBaseForm.isDetailDataChanged())
throw new EnrgiseApplicationException("wenrgise.common.datashouldbesaved", "M");
String sFormName = form.getClass().getName();
String sScreenName = oBaseForm.getScreenName();
BaseBD oBaseBD = getHeaderBusinessDelegate(form, request);
UserSession oUser = getUserSessionBean(request);
String sComponentName = getComponentName(sFormName);
BaseHeaderBean oBaseHeaderBean = getBaseHeaderBean(sFormName);
ArrayList oDetailBeanArray = null;
BaseDetailVO oBaseDetailVO = null;
BaseHeaderVO oBaseHeaderVO = null;
Timestamp oHeaderPicked = null;
Timestamp oDetailPicked = null;
oBaseHeaderVO = oUser.getBaseHeaderVO(sFormName);
if (oBaseHeaderVO != null) {
oHeaderPicked = oBaseHeaderVO.getOWhenPicked();
oBaseHeaderBean = getBaseHeaderBean(sFormName);
}
BeanUtils.copyProperties(oBaseHeaderBean, form);
oBaseDetailVO = oUser.getBaseDetailVO(sFormName, sScreenName);
if (oBaseDetailVO != null) {
oDetailPicked = oBaseDetailVO.getOWhenPicked();
oDetailBeanArray = getDetailArray(oBaseForm);
}
String sHeaderPrimaryKey = oBaseBD.submit(oBaseForm.getButtonName(), oBaseHeaderBean, oHeaderPicked, oBaseForm.getScreenName(), oBaseForm.getScreenMode(), oBaseForm.isHeaderDataChanged(), oDetailBeanArray, oBaseForm.isDetailDataChanged(), oDetailPicked);
oBaseForm.setHeaderPrimaryKey(sHeaderPrimaryKey);
BaseQueryVO oBaseQueryVO = null;
oBaseQueryVO = getQueryVO(form);
BeanUtils.copyProperties(oBaseQueryVO, form);
oBaseQueryVO.setHeaderPrimaryKey(sHeaderPrimaryKey);
oBaseQueryVO.setMaxHeaderSize(ParamUtil.getHeaderSize(sFormName));
oBaseHeaderVO = oBaseBD.getHeaderRecord(oBaseQueryVO, sFormName, oUser);
BeanUtils.copyProperties(form, oBaseHeaderVO.getHeaderRecord(1));
BeanUtils.copyProperties(form, oBaseHeaderVO);
oUser.putBaseHeaderVO(sFormName, oBaseHeaderVO);
if (null != oBaseDetailVO) {
if (oBaseDetailVO.getTotalDetailRecord() + oBaseDetailVO.getRowAdded() - oBaseDetailVO.getRowDeleted() > 0L) {
oBaseDetailVO.setRowDeleted(0);
oBaseDetailVO.setRowAdded(0);
DetailSizeValues oDetailSizeValues = new DetailSizeValues();
oDetailSizeValues.setDetailRecordPerPage(ParamUtil.getDetailRecordPerPage(sFormName, sScreenName));
oDetailSizeValues.setMaxPages(ParamUtil.getMaxDetailPages(sFormName, sScreenName));
oBaseDetailVO = getDetailData(oBaseForm, sFormName, sScreenName, 1L, request, oBaseBD, true, oUser);
oBaseForm.setPageRequested(1L);
long totDetRecord = oBaseDetailVO.getTotalDetailRecord();
oBaseForm.setTotalPageCount(calculateTotalDetailPage(sFormName, sScreenName, totDetRecord));
if (oBaseDetailVO.getOThisPageData() != null) {
oBaseForm.setThisPageDetailCount(oBaseDetailVO.getOThisPageData().size());
BeanUtils.setProperty(oBaseForm, ParamUtil.getDetailArrayName(sFormName, sScreenName), oBaseDetailVO.getOThisPageData());
} else {
oBaseForm.setThisPageDetailCount(0);
}
checkDetailNavigation(oBaseForm, oUser.getBaseDetailVO(sFormName, sScreenName));
BeanUtils.copyProperties(oBaseForm, oBaseDetailVO);
}
oBaseDetailVO.setRowAdded(0);
oBaseDetailVO.setRowDeleted(0);
oUser.putBaseDetailVO(sFormName, sScreenName, oBaseDetailVO);
}
oBaseForm.setHeaderDataChanged(false);
oBaseForm.setDetailDataChanged(false);
oBaseForm.setScreenMode("U");
enableAll(oBaseForm);
enableDisable(oBaseForm, saveClicked(), "D");
controlHeaderNavigation(oBaseForm);
controlDetailNavigation(oBaseForm);
SecurityBD oSecBD = new SecurityBD();
Map oSecMap = oSecBD.getDisabledFields(String.valueOf(oBaseForm.getScreenName()).concat(String.valueOf(".jsp")), "ALL", oBaseForm.getScreenMode(), oBaseForm.getHeaderStatus());
if (null != oSecMap)
enableDisable(oBaseForm, (ArrayList)oSecMap.get("D"), "D");
BaseHeaderBean oThisBaseHeaderBean = getBaseHeaderBean(sFormName);
BeanUtils.copyProperties(oThisBaseHeaderBean, form);
ThisPageVO oThisPageVO = new ThisPageVO();
oThisPageVO.setOHeaderBean(oThisBaseHeaderBean);
oThisPageVO.setScreenMode(oBaseForm.getScreenMode());
oThisPageVO.setScreenName(oBaseForm.getScreenName());
oThisPageVO.setActionName(18);
oBaseDetailVO = null;
oBaseDetailVO = oUser.getBaseDetailVO(sFormName, oBaseForm.getScreenName());
if (null != oBaseDetailVO) {
ArrayList oDetailList = (oBaseDetailVO.getOThisPageData() != null) ? oBaseDetailVO.getOThisPageData() : new ArrayList();
oThisPageVO.setODetailList(oDetailList);
}
Map oMap = oBaseBD.getDisabledFields(oThisPageVO);
if (oMap != null) {
if (oMap.containsKey("D"))
enableDisable(oBaseForm, (ArrayList)oMap.get("D"), "D");
if (oMap.containsKey("E"))
enableDisable(oBaseForm, (ArrayList)oMap.get("E"), "E");
}
if (oThisPageVO.getODetailList() != null) {
oBaseForm.setThisPageDetailCount(oThisPageVO.getODetailList().size());
BeanUtils.setProperty(oBaseForm, ParamUtil.getDetailArrayName(sFormName, sScreenName), oThisPageVO.getODetailList());
}
onLoad(form, request, 18);
throw new EnrgiseApplicationException("wenrgise.common.datasaved", "M");
}
}

View File

@@ -0,0 +1,90 @@
package WEB-INF.classes.wenrgise.common.webtier.action;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Map;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import wenrgise.common.bean.BaseHeaderBean;
import wenrgise.common.businessdelegate.BaseBD;
import wenrgise.common.businessdelegate.SecurityBD;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.vo.BaseDetailVO;
import wenrgise.common.vo.ThisPageVO;
import wenrgise.common.webtier.action.BaseAction;
import wenrgise.common.webtier.form.BaseForm;
import wenrgise.ejb.common.session.UserSession;
import wenrgise.ejb.common.utility.ParamUtil;
public class GetDetailAction extends BaseAction {
public ActionForward executeImpl(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws EnrgiseApplicationException, EnrgiseSystemException, IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException, ServletException, IOException {
BaseForm oBaseForm = (BaseForm)form;
if (oBaseForm.getScreenMode().equals("N"))
throw new EnrgiseApplicationException("wenrgise.common.saveheaderrecord", "M");
if (oBaseForm.isHeaderDataChanged() || oBaseForm.isDetailDataChanged())
throw new EnrgiseApplicationException("wenrgise.common.datashouldbesaved", "M");
String sFormName = form.getClass().getName();
UserSession oUser = getUserSessionBean(request);
BaseBD oBaseBD = getDetailBusinessDelegate(form, request);
String sScreenName = oBaseForm.getScreenName();
BaseDetailVO oBaseDetailVO = getDetailData(oBaseForm, sFormName, sScreenName, 1L, request, oBaseBD, true, oUser);
if (oBaseDetailVO.getOThisPageData() != null)
oBaseForm.setScreenMode("U");
long totDetRecord = oBaseDetailVO.getTotalDetailRecord();
oBaseForm.setTotalPageCount(calculateTotalDetailPage(sFormName, sScreenName, totDetRecord));
ArrayList oClicked = getDetailClicked();
ArrayList oEnableList = new ArrayList();
oEnableList.add("butAddRow");
if (totDetRecord == 0L) {
oBaseForm.setPageRequested(0L);
oClicked.add("butDelRow");
} else {
oEnableList.add("butDelRow");
oEnableList.add("butSave");
}
enableDisable(oBaseForm, oClicked, "D");
enableDisable(oBaseForm, oEnableList, "E");
controlDetailNavigation(oBaseForm);
SecurityBD oSecBD = new SecurityBD();
Map oSecMap = oSecBD.getDisabledFields(String.valueOf(oBaseForm.getScreenName()).concat(String.valueOf(".jsp")), "DETAIL", oBaseForm.getScreenMode(), oBaseForm.getHeaderStatus());
if (null != oSecMap) {
if (null != oSecMap.get("D"))
enableDisable(oBaseForm, (ArrayList)oSecMap.get("D"), "D");
if (null != oSecMap.get("E"))
enableDisable(oBaseForm, (ArrayList)oSecMap.get("E"), "E");
}
BaseHeaderBean oBaseHeaderBean = getBaseHeaderBean(sFormName);
BeanUtils.copyProperties(oBaseHeaderBean, form);
ThisPageVO oThisPageVO = new ThisPageVO();
oThisPageVO.setOHeaderBean(oBaseHeaderBean);
oThisPageVO.setScreenMode(oBaseForm.getScreenMode());
oThisPageVO.setScreenName(oBaseForm.getScreenName());
oThisPageVO.setActionName(6);
oBaseDetailVO = oUser.getBaseDetailVO(sFormName, oBaseForm.getScreenName());
if (null != oBaseDetailVO) {
ArrayList oDetailList = (oBaseDetailVO.getOThisPageData() != null) ? oBaseDetailVO.getOThisPageData() : new ArrayList();
oThisPageVO.setODetailList(oDetailList);
}
Map oMap = oBaseBD.getDisabledFields(oThisPageVO);
if (oMap != null) {
if (oMap.containsKey("D"))
enableDisable(oBaseForm, (ArrayList)oMap.get("D"), "D");
if (oMap.containsKey("E"))
enableDisable(oBaseForm, (ArrayList)oMap.get("E"), "E");
}
if (oThisPageVO.getODetailList() != null) {
oBaseForm.setThisPageDetailCount(oThisPageVO.getODetailList().size());
BeanUtils.setProperty(oBaseForm, ParamUtil.getDetailArrayName(sFormName, sScreenName), oThisPageVO.getODetailList());
}
onLoad(form, request, 6);
oUser.setForwardedPage(sFormName, "success");
return mapping.findForward("success");
}
}

View File

@@ -0,0 +1,86 @@
package WEB-INF.classes.wenrgise.common.webtier.action;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Map;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import wenrgise.common.bean.BaseHeaderBean;
import wenrgise.common.businessdelegate.BaseBD;
import wenrgise.common.businessdelegate.SecurityBD;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.vo.BaseDetailVO;
import wenrgise.common.vo.ThisPageVO;
import wenrgise.common.webtier.action.BaseAction;
import wenrgise.common.webtier.form.BaseForm;
import wenrgise.ejb.common.session.UserSession;
import wenrgise.ejb.common.utility.ParamUtil;
public class GetDetailPageAction extends BaseAction {
public ActionForward executeImpl(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws EnrgiseApplicationException, EnrgiseSystemException, IllegalAccessException, IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException, ServletException, IOException {
BaseForm oBaseForm = (BaseForm)form;
if (oBaseForm.isHeaderDataChanged() || oBaseForm.isDetailDataChanged())
throw new EnrgiseApplicationException("wenrgise.common.datashouldbesaved", "M");
String sFormName = form.getClass().getName();
UserSession oUser = getUserSessionBean(request);
BaseBD oBaseBD = getDetailBusinessDelegate(form, request);
String sScreenName = oBaseForm.getScreenName();
checkDetailNavigation(oBaseForm, oUser.getBaseDetailVO(sFormName, sScreenName));
BaseDetailVO oBaseDetailVO = getDetailData(oBaseForm, sFormName, sScreenName, oBaseForm.getPageRequested(), request, oBaseBD, false, oUser);
long totDetRecord = oBaseDetailVO.getTotalDetailRecord();
oBaseForm.setTotalPageCount(calculateTotalDetailPage(sFormName, oBaseForm.getScreenName(), totDetRecord));
ArrayList oClicked = getDetailClicked();
ArrayList oEnableList = new ArrayList();
oEnableList.add("butAddRow");
if (totDetRecord == 0L) {
oClicked.add("butDelRow");
} else {
oEnableList.add("butDelRow");
oEnableList.add("butSave");
}
enableDisable(oBaseForm, oClicked, "D");
enableDisable(oBaseForm, oEnableList, "E");
controlDetailNavigation(oBaseForm);
SecurityBD oSecBD = new SecurityBD();
Map oSecMap = oSecBD.getDisabledFields(String.valueOf(oBaseForm.getScreenName()).concat(String.valueOf(".jsp")), "DETAIL", oBaseForm.getScreenMode(), oBaseForm.getHeaderStatus());
if (null != oSecMap) {
if (null != oSecMap.get("D"))
enableDisable(oBaseForm, (ArrayList)oSecMap.get("D"), "D");
if (null != oSecMap.get("E"))
enableDisable(oBaseForm, (ArrayList)oSecMap.get("E"), "E");
}
BaseHeaderBean oBaseHeaderBean = getBaseHeaderBean(sFormName);
BeanUtils.copyProperties(oBaseHeaderBean, form);
ThisPageVO oThisPageVO = new ThisPageVO();
oThisPageVO.setOHeaderBean(oBaseHeaderBean);
oThisPageVO.setScreenMode(oBaseForm.getScreenMode());
oThisPageVO.setScreenName(oBaseForm.getScreenName());
oThisPageVO.setActionName(6);
oBaseDetailVO = null;
oBaseDetailVO = oUser.getBaseDetailVO(sFormName, oBaseForm.getScreenName());
if (null != oBaseDetailVO) {
ArrayList oDetailList = (oBaseDetailVO.getOThisPageData() != null) ? oBaseDetailVO.getOThisPageData() : new ArrayList();
oThisPageVO.setODetailList(oDetailList);
}
Map oMap = oBaseBD.getDisabledFields(oThisPageVO);
if (oMap != null) {
if (oMap.containsKey("D"))
enableDisable(oBaseForm, (ArrayList)oMap.get("D"), "D");
if (oMap.containsKey("E"))
enableDisable(oBaseForm, (ArrayList)oMap.get("E"), "E");
}
if (oThisPageVO.getODetailList() != null) {
oBaseForm.setThisPageDetailCount(oThisPageVO.getODetailList().size());
BeanUtils.setProperty(oBaseForm, ParamUtil.getDetailArrayName(sFormName, sScreenName), oThisPageVO.getODetailList());
}
onLoad(form, request, 6);
return mapping.findForward("success");
}
}

View File

@@ -0,0 +1,69 @@
package WEB-INF.classes.wenrgise.common.webtier.action;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Map;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import wenrgise.common.bean.BaseHeaderBean;
import wenrgise.common.businessdelegate.BaseBD;
import wenrgise.common.businessdelegate.SecurityBD;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.vo.BaseHeaderVO;
import wenrgise.common.vo.BaseQueryVO;
import wenrgise.common.vo.ThisPageVO;
import wenrgise.common.webtier.action.BaseAction;
import wenrgise.common.webtier.form.BaseForm;
import wenrgise.ejb.common.session.UserSession;
import wenrgise.ejb.common.utility.ParamUtil;
public class GetHeaderAction extends BaseAction {
public ActionForward executeImpl(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws EnrgiseApplicationException, EnrgiseSystemException, IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException, ServletException, IOException {
BaseForm oBaseForm = (BaseForm)form;
if (oBaseForm.isHeaderDataChanged() || oBaseForm.isDetailDataChanged())
throw new EnrgiseApplicationException("wenrgise.common.datashouldbesaved", "M");
String sFormName = form.getClass().getName();
BaseQueryVO oBaseQueryVO = getQueryVO(form);
BaseBD oBaseBD = getHeaderBusinessDelegate(form, request);
BeanUtils.copyProperties(oBaseQueryVO, form);
oBaseQueryVO.setMaxHeaderSize(ParamUtil.getHeaderSize(sFormName));
UserSession oUser = getUserSessionBean(request);
BaseHeaderVO oBaseHeaderVO = oBaseBD.getHeaderRecord(oBaseQueryVO, sFormName, oUser);
BeanUtils.copyProperties(form, oBaseHeaderVO.getHeaderRecord(1));
BeanUtils.copyProperties(form, oBaseHeaderVO);
resetDetailPageData(oBaseForm);
if (oBaseHeaderVO.getTotalCount() > 0L)
oBaseForm.setScreenMode("U");
enableAll(oBaseForm);
enableDisable(oBaseForm, executeClicked(), "D");
controlHeaderNavigation(oBaseForm);
SecurityBD oSecBD = new SecurityBD();
Map oSecMap = oSecBD.getDisabledFields(String.valueOf(oBaseForm.getScreenName()).concat(String.valueOf(".jsp")), "HEADER", oBaseForm.getScreenMode(), oBaseForm.getHeaderStatus());
if (null != oSecMap)
enableDisable(oBaseForm, (ArrayList)oSecMap.get("D"), "D");
BaseHeaderBean oBaseHeaderBean = getBaseHeaderBean(sFormName);
BeanUtils.copyProperties(oBaseHeaderBean, form);
ThisPageVO oThisPageVO = new ThisPageVO();
oThisPageVO.setOHeaderBean(oBaseHeaderBean);
oThisPageVO.setScreenMode(oBaseForm.getScreenMode());
oThisPageVO.setScreenName(oBaseForm.getScreenName());
oThisPageVO.setActionName(1);
Map oMap = oBaseBD.getDisabledFields(oThisPageVO);
if (oMap != null) {
if (oMap.containsKey("D"))
enableDisable(oBaseForm, (ArrayList)oMap.get("D"), "D");
if (oMap.containsKey("E"))
enableDisable(oBaseForm, (ArrayList)oMap.get("E"), "E");
}
onLoad(form, request, 1);
oUser.setForwardedPage(sFormName, "success");
return mapping.findForward("success");
}
}

View File

@@ -0,0 +1,106 @@
package WEB-INF.classes.wenrgise.common.webtier.action;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Map;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import wenrgise.common.bean.BaseHeaderBean;
import wenrgise.common.businessdelegate.BaseBD;
import wenrgise.common.businessdelegate.SecurityBD;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.utility.UserInfo;
import wenrgise.common.vo.BaseDetailVO;
import wenrgise.common.vo.BaseHeaderVO;
import wenrgise.common.vo.BaseQueryVO;
import wenrgise.common.vo.DetailSizeValues;
import wenrgise.common.vo.ThisPageVO;
import wenrgise.common.webtier.action.BaseAction;
import wenrgise.common.webtier.form.BaseForm;
import wenrgise.ejb.common.session.UserSession;
import wenrgise.ejb.common.utility.ParamUtil;
public class GetInsertAction extends BaseAction {
public ActionForward executeImpl(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws EnrgiseApplicationException, EnrgiseSystemException, IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException, ServletException, IOException {
BaseForm oBaseForm = (BaseForm)form;
String sFormName = form.getClass().getName();
String sScreenName = oBaseForm.getScreenName();
BaseQueryVO oBaseQueryVO = getQueryVO(form);
System.out.println(String.valueOf("Class name ").concat(String.valueOf(oBaseQueryVO.getClass().getName())));
BaseBD oBaseBD = getHeaderBusinessDelegate(form, request);
BeanUtils.copyProperties(oBaseQueryVO, form);
oBaseQueryVO.setMaxHeaderSize(ParamUtil.getHeaderSize(sFormName));
UserSession oUser = getUserSessionBean(request);
String sComponentName = getComponentName(sFormName);
checkAccessInfo(oUser, sComponentName, oBaseForm.getScreenMode(), "", 8, oBaseForm.getWorkListId());
UserInfo oUserInfo = oUser.getUserInfo();
SecurityBD oSecBD = new SecurityBD();
System.out.println(oBaseForm.getHeaderPrimaryKey());
String sNewPK = oBaseBD.getInsertDataImpl(oBaseQueryVO);
oBaseQueryVO = getQueryVO(form);
BeanUtils.copyProperties(oBaseQueryVO, form);
oBaseQueryVO.setHeaderPrimaryKey(sNewPK);
oBaseQueryVO.setMaxHeaderSize(ParamUtil.getHeaderSize(sFormName));
oUser = getUserSessionBean(request);
BaseHeaderVO oBaseHeaderVO = oBaseBD.getHeaderRecord(oBaseQueryVO, sFormName, oUser);
oUser.putBaseHeaderVO(sFormName, oBaseHeaderVO);
oUser.putBaseQueryVO(sFormName, oBaseQueryVO);
BeanUtils.copyProperties(form, oBaseHeaderVO.getHeaderRecord(1));
BeanUtils.copyProperties(form, oBaseHeaderVO);
DetailSizeValues oDetailSizeValues = new DetailSizeValues();
oDetailSizeValues.setDetailRecordPerPage(ParamUtil.getDetailRecordPerPage(sFormName, sScreenName));
oDetailSizeValues.setMaxPages(ParamUtil.getMaxDetailPages(sFormName, sScreenName));
System.out.println(oBaseHeaderVO.getHeaderRecord(1).getHeaderPrimaryKey());
BaseDetailVO oBaseDetailVO = getDetailData(oBaseForm, sFormName, sScreenName, 1L, request, oBaseBD, true, oUser);
oBaseForm.setDetailStartPage(1);
oBaseDetailVO.setCurrentPage(1L);
oBaseForm.setThisPageDetailCount((null != oBaseDetailVO.getOThisPageData()) ? oBaseDetailVO.getOThisPageData().size() : 0);
if (oBaseDetailVO.getOThisPageData() != null)
BeanUtils.setProperty(oBaseForm, ParamUtil.getDetailArrayName(sFormName, sScreenName), oBaseDetailVO.getOThisPageData());
BeanUtils.copyProperties(oBaseForm, oBaseDetailVO);
oBaseForm.setHeaderDataChanged(false);
oBaseForm.setDetailDataChanged(false);
oBaseForm.setScreenMode("U");
enableAll(oBaseForm);
enableDisable(oBaseForm, nextHeaderClicked(), "D");
controlHeaderNavigation(oBaseForm);
enableDisable(oBaseForm, getDetailClicked(), "D");
controlDetailNavigation(oBaseForm);
Map oSecMap = oSecBD.getDisabledFields(String.valueOf(oBaseForm.getScreenName()).concat(String.valueOf(".jsp")), "ALL", oBaseForm.getScreenMode(), oBaseForm.getHeaderStatus());
if (null != oSecMap)
enableDisable(oBaseForm, (ArrayList)oSecMap.get("D"), "D");
BaseHeaderBean oBaseHeaderBean = getBaseHeaderBean(sFormName);
BeanUtils.copyProperties(oBaseHeaderBean, form);
ThisPageVO oThisPageVO = new ThisPageVO();
oThisPageVO.setOHeaderBean(oBaseHeaderBean);
oThisPageVO.setScreenMode(oBaseForm.getScreenMode());
oThisPageVO.setScreenName(oBaseForm.getScreenName());
oThisPageVO.setActionName(23);
oBaseDetailVO = null;
oBaseDetailVO = oUser.getBaseDetailVO(sFormName, oBaseForm.getScreenName());
if (null != oBaseDetailVO) {
ArrayList oDetailList = (oBaseDetailVO.getOThisPageData() != null) ? oBaseDetailVO.getOThisPageData() : new ArrayList();
oThisPageVO.setODetailList(oDetailList);
}
Map oMap = oBaseBD.getDisabledFields(oThisPageVO);
if (oMap != null) {
if (oMap.containsKey("D"))
enableDisable(oBaseForm, (ArrayList)oMap.get("D"), "D");
if (oMap.containsKey("E"))
enableDisable(oBaseForm, (ArrayList)oMap.get("E"), "E");
}
if (oThisPageVO.getODetailList() != null) {
oBaseForm.setThisPageDetailCount(oThisPageVO.getODetailList().size());
BeanUtils.setProperty(oBaseForm, ParamUtil.getDetailArrayName(sFormName, sScreenName), oThisPageVO.getODetailList());
}
onLoad(form, request, 23);
return mapping.findForward("success");
}
}

View File

@@ -0,0 +1,72 @@
package WEB-INF.classes.wenrgise.common.webtier.action;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Map;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import wenrgise.common.bean.BaseHeaderBean;
import wenrgise.common.businessdelegate.BaseBD;
import wenrgise.common.businessdelegate.SecurityBD;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.vo.BaseHeaderVO;
import wenrgise.common.vo.BaseQueryVO;
import wenrgise.common.vo.ThisPageVO;
import wenrgise.common.webtier.action.BaseAction;
import wenrgise.common.webtier.form.BaseForm;
import wenrgise.ejb.common.session.UserSession;
import wenrgise.ejb.common.utility.ParamUtil;
public class GetNextHeaderAction extends BaseAction {
public ActionForward executeImpl(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException, EnrgiseApplicationException, EnrgiseSystemException, ServletException, IOException {
BaseForm oBaseForm = (BaseForm)form;
if (oBaseForm.isHeaderDataChanged() || oBaseForm.isDetailDataChanged())
throw new EnrgiseApplicationException("wenrgise.common.datashouldbesaved", "M");
String sFormName = form.getClass().getName();
String sScreenName = oBaseForm.getScreenName();
UserSession oUser = getUserSessionBean(request);
checkHeaderNavigation(oBaseForm, oUser.getBaseHeaderVO(sFormName));
BaseBD oBaseBD = getHeaderBusinessDelegate(form, request);
BaseQueryVO oBaseQueryVO = oUser.getBaseQueryVO(sFormName);
BaseHeaderVO oBaseHeaderVO = oBaseBD.getNextHeaderRecord(oBaseQueryVO, oBaseForm.getPositionRequested(), sFormName, false, oUser);
int iRelativePosition = (int)(oBaseHeaderVO.getPositionRequested() - oBaseHeaderVO.getHeaderStartPosition() + 1L);
BeanUtils.copyProperties(form, oBaseHeaderVO.getHeaderRecord(iRelativePosition));
oBaseForm.setTotalDetailRecord(0L);
clearDetailLists(oBaseForm, ParamUtil.getDetailList(sFormName));
oUser.removeAllDetailVO(sFormName);
oBaseForm.setDetailStartPage(0);
BeanUtils.copyProperties(form, oBaseHeaderVO);
oBaseForm.setNewPositionRequested(null);
resetDetailPageData(oBaseForm);
enableAll(oBaseForm);
enableDisable(oBaseForm, nextHeaderClicked(), "D");
controlHeaderNavigation(oBaseForm);
SecurityBD oSecBD = new SecurityBD();
Map oSecMap = oSecBD.getDisabledFields(String.valueOf(oBaseForm.getScreenName()).concat(String.valueOf(".jsp")), "HEADER", oBaseForm.getScreenMode(), oBaseForm.getHeaderStatus());
if (null != oSecMap)
enableDisable(oBaseForm, (ArrayList)oSecMap.get("D"), "D");
BaseHeaderBean oBaseHeaderBean = getBaseHeaderBean(sFormName);
BeanUtils.copyProperties(oBaseHeaderBean, form);
ThisPageVO oThisPageVO = new ThisPageVO();
oThisPageVO.setOHeaderBean(oBaseHeaderBean);
oThisPageVO.setScreenMode(oBaseForm.getScreenMode());
oThisPageVO.setScreenName(oBaseForm.getScreenName());
oThisPageVO.setActionName(1);
Map oMap = oBaseBD.getDisabledFields(oThisPageVO);
if (oMap != null) {
if (oMap.containsKey("D"))
enableDisable(oBaseForm, (ArrayList)oMap.get("D"), "D");
if (oMap.containsKey("E"))
enableDisable(oBaseForm, (ArrayList)oMap.get("E"), "E");
}
onLoad(form, request, 1);
return mapping.findForward("success");
}
}

View File

@@ -0,0 +1,105 @@
package WEB-INF.classes.wenrgise.common.webtier.action;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Map;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import wenrgise.common.bean.BaseHeaderBean;
import wenrgise.common.businessdelegate.BaseBD;
import wenrgise.common.businessdelegate.SecurityBD;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.vo.BaseDetailVO;
import wenrgise.common.vo.DetailSizeValues;
import wenrgise.common.vo.ThisPageVO;
import wenrgise.common.webtier.action.BaseAction;
import wenrgise.common.webtier.form.BaseForm;
import wenrgise.ejb.common.session.UserSession;
import wenrgise.ejb.common.utility.ParamUtil;
public class GetRefreshTabAction extends BaseAction {
public ActionForward executeImpl(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws EnrgiseApplicationException, EnrgiseSystemException, IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException, ServletException, IOException {
BaseForm oBaseForm = (BaseForm)form;
String sFormName = form.getClass().getName();
String sScreenName = oBaseForm.getScreenName();
if (oBaseForm.isHeaderDataChanged() || oBaseForm.isDetailDataChanged()) {
if (oBaseForm.isDetailDataChanged()) {
ArrayList arrayList = getDetailArray(oBaseForm);
BeanUtils.setProperty(oBaseForm, ParamUtil.getDetailArrayName(sFormName, sScreenName), arrayList);
}
throw new EnrgiseApplicationException("wenrgise.common.datashouldbesaved", "M");
}
BaseBD oBaseBD = getDetailBusinessDelegate(form, request);
UserSession oUser = getUserSessionBean(request);
String sForwardedPage = oBaseForm.getForwardedPage();
BaseDetailVO oPresentBaseDetailVO = oUser.getBaseDetailVO(sFormName, sScreenName);
if (null != oPresentBaseDetailVO)
oPresentBaseDetailVO.setCurrentPage(oBaseForm.getPageRequested());
oUser.putBaseDetailVO(sFormName, sScreenName, oPresentBaseDetailVO);
BaseDetailVO oNextBaseDetailVO = oUser.getBaseDetailVO(sFormName, sForwardedPage);
if (oPresentBaseDetailVO != null) {
DetailSizeValues oDetailSizeValues = new DetailSizeValues();
oDetailSizeValues.setDetailRecordPerPage(ParamUtil.getDetailRecordPerPage(sFormName, sForwardedPage));
oDetailSizeValues.setMaxPages(ParamUtil.getMaxDetailPages(sFormName, sForwardedPage));
oNextBaseDetailVO = getDetailData(oBaseForm, sFormName, sForwardedPage, 1L, request, oBaseBD, true, oUser);
if (oNextBaseDetailVO.getOThisPageData() != null)
BeanUtils.setProperty(oBaseForm, ParamUtil.getDetailArrayName(sFormName, sForwardedPage), oNextBaseDetailVO.getOThisPageData());
oBaseForm.setPageRequested(oNextBaseDetailVO.getCurrentPage());
oBaseForm.setThisPageDetailCount((null != oNextBaseDetailVO.getOThisPageData()) ? oNextBaseDetailVO.getOThisPageData().size() : 0);
long lTotDetRecord = oNextBaseDetailVO.getTotalDetailRecord();
oBaseForm.setTotalPageCount(calculateTotalDetailPage(sFormName, oBaseForm.getForwardedPage(), lTotDetRecord));
oUser.putBaseDetailVO(sFormName, sForwardedPage, oNextBaseDetailVO);
ArrayList oClicked = getDetailClicked();
if (lTotDetRecord == 0L) {
oBaseForm.setPageRequested(0L);
oClicked.add("butDelRow");
}
enableDisable(oBaseForm, oClicked, "D");
controlDetailNavigation(oBaseForm);
}
SecurityBD oSecBD = new SecurityBD();
Map oSecMap = oSecBD.getDisabledFields(String.valueOf(sForwardedPage).concat(String.valueOf(".jsp")), "DETAIL", oBaseForm.getScreenMode(), oBaseForm.getHeaderStatus());
if (null != oSecMap) {
if (null != oSecMap.get("D"))
enableDisable(oBaseForm, (ArrayList)oSecMap.get("D"), "D");
if (null != oSecMap.get("E"))
enableDisable(oBaseForm, (ArrayList)oSecMap.get("E"), "E");
}
BaseHeaderBean oBaseHeaderBean = getBaseHeaderBean(sFormName);
ArrayList oDetailList = null;
BeanUtils.copyProperties(oBaseHeaderBean, form);
ThisPageVO oThisPageVO = new ThisPageVO();
if (oNextBaseDetailVO != null) {
oDetailList = (oNextBaseDetailVO.getOThisPageData() != null) ? oNextBaseDetailVO.getOThisPageData() : new ArrayList();
oThisPageVO.setODetailList(oDetailList);
}
oThisPageVO.setOHeaderBean(oBaseHeaderBean);
oThisPageVO.setScreenMode(oBaseForm.getScreenMode());
oThisPageVO.setScreenName(oBaseForm.getForwardedPage());
oThisPageVO.setActionName(22);
Map oMap = oBaseBD.getDisabledFields(oThisPageVO);
if (oMap != null) {
if (oMap.containsKey("D"))
enableDisable(oBaseForm, (ArrayList)oMap.get("D"), "D");
if (oMap.containsKey("E"))
enableDisable(oBaseForm, (ArrayList)oMap.get("E"), "E");
}
if (oThisPageVO.getODetailList() != null) {
oBaseForm.setThisPageDetailCount(oThisPageVO.getODetailList().size());
BeanUtils.setProperty(oBaseForm, ParamUtil.getDetailArrayName(sFormName, sScreenName), oThisPageVO.getODetailList());
}
if (sForwardedPage != null)
oBaseForm.setScreenName(sForwardedPage);
onLoad(form, request, 22);
if (sForwardedPage != null)
return mapping.findForward(sForwardedPage);
return mapping.findForward("success");
}
}

View File

@@ -0,0 +1,140 @@
package WEB-INF.classes.wenrgise.common.webtier.action;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Map;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import wenrgise.common.bean.BaseHeaderBean;
import wenrgise.common.businessdelegate.BaseBD;
import wenrgise.common.businessdelegate.SecurityBD;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.vo.BaseDetailVO;
import wenrgise.common.vo.ThisPageVO;
import wenrgise.common.webtier.action.BaseAction;
import wenrgise.common.webtier.form.BaseForm;
import wenrgise.ejb.common.session.UserSession;
import wenrgise.ejb.common.utility.ParamUtil;
public class GetTabAction extends BaseAction {
public ActionForward executeImpl(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws EnrgiseApplicationException, EnrgiseSystemException, IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException, ServletException, IOException {
BaseForm oBaseForm = (BaseForm)form;
String sFormName = form.getClass().getName();
String sScreenName = oBaseForm.getScreenName();
if (oBaseForm.isHeaderDataChanged() || oBaseForm.isDetailDataChanged()) {
if (oBaseForm.isDetailDataChanged()) {
ArrayList oDetailList = getDetailArray(oBaseForm);
BeanUtils.setProperty(oBaseForm, ParamUtil.getDetailArrayName(sFormName, sScreenName), oDetailList);
}
throw new EnrgiseApplicationException("wenrgise.common.datashouldbesaved", "M");
}
BaseBD oBaseBD = getDetailBusinessDelegate(form, request);
UserSession oUser = getUserSessionBean(request);
String sForwardedPage = oBaseForm.getForwardedPage();
BaseDetailVO oPresentBaseDetailVO = oUser.getBaseDetailVO(sFormName, sScreenName);
if (null != oPresentBaseDetailVO)
oPresentBaseDetailVO.setCurrentPage(oBaseForm.getPageRequested());
oUser.putBaseDetailVO(sFormName, sScreenName, oPresentBaseDetailVO);
BaseDetailVO oNextBaseDetailVO = oUser.getBaseDetailVO(sFormName, sForwardedPage);
if (null != oNextBaseDetailVO) {
oBaseForm.setPageRequested(oNextBaseDetailVO.getCurrentPage());
oBaseForm.setThisPageDetailCount((null != oNextBaseDetailVO.getOThisPageData()) ? oNextBaseDetailVO.getOThisPageData().size() : 0);
long lTotDetRecord = oNextBaseDetailVO.getTotalDetailRecord();
oBaseForm.setTotalPageCount(calculateTotalDetailPage(sFormName, oBaseForm.getForwardedPage(), lTotDetRecord));
ArrayList oClicked = getDetailClicked();
if (lTotDetRecord == 0L) {
oBaseForm.setPageRequested(0L);
oClicked.add("butDelRow");
}
enableDisable(oBaseForm, oClicked, "D");
controlDetailNavigation(oBaseForm);
SecurityBD oSecBD = new SecurityBD();
Map oSecMap = oSecBD.getDisabledFields(String.valueOf(sForwardedPage).concat(String.valueOf(".jsp")), "DETAIL", oBaseForm.getScreenMode(), oBaseForm.getHeaderStatus());
if (null != oSecMap) {
if (null != oSecMap.get("D"))
enableDisable(oBaseForm, (ArrayList)oSecMap.get("D"), "D");
if (null != oSecMap.get("E"))
enableDisable(oBaseForm, (ArrayList)oSecMap.get("E"), "E");
}
BaseHeaderBean oBaseHeaderBean = getBaseHeaderBean(sFormName);
BeanUtils.copyProperties(oBaseHeaderBean, form);
ThisPageVO oThisPageVO = new ThisPageVO();
oThisPageVO.setOHeaderBean(oBaseHeaderBean);
oThisPageVO.setScreenMode(oBaseForm.getScreenMode());
oThisPageVO.setScreenName(sForwardedPage);
oThisPageVO.setActionName(22);
ArrayList oDetailList = (oNextBaseDetailVO.getOThisPageData() != null) ? oNextBaseDetailVO.getOThisPageData() : new ArrayList();
oThisPageVO.setODetailList(oDetailList);
Map oMap = oBaseBD.getDisabledFields(oThisPageVO);
if (oMap != null) {
if (oMap.containsKey("D"))
enableDisable(oBaseForm, (ArrayList)oMap.get("D"), "D");
if (oMap.containsKey("E"))
enableDisable(oBaseForm, (ArrayList)oMap.get("E"), "E");
}
if (oThisPageVO.getODetailList() != null) {
oBaseForm.setThisPageDetailCount(oThisPageVO.getODetailList().size());
BeanUtils.setProperty(oBaseForm, ParamUtil.getDetailArrayName(sFormName, sForwardedPage), oThisPageVO.getODetailList());
}
} else {
if (oBaseForm.getHeaderPrimaryKey() == null)
throw new EnrgiseApplicationException("wenrgise.common.bringheaderdata", "M");
if (oPresentBaseDetailVO != null) {
oNextBaseDetailVO = getDetailData(oBaseForm, sFormName, sForwardedPage, 1L, request, oBaseBD, true, oUser);
long lTotDetRecord = oNextBaseDetailVO.getTotalDetailRecord();
oBaseForm.setTotalPageCount(calculateTotalDetailPage(sFormName, oBaseForm.getForwardedPage(), lTotDetRecord));
oUser.putBaseDetailVO(sFormName, sForwardedPage, oNextBaseDetailVO);
ArrayList oClicked = getDetailClicked();
if (lTotDetRecord == 0L) {
oBaseForm.setPageRequested(0L);
oClicked.add("butDelRow");
}
enableDisable(oBaseForm, oClicked, "D");
controlDetailNavigation(oBaseForm);
SecurityBD oSecBD = new SecurityBD();
Map oSecMap = oSecBD.getDisabledFields(String.valueOf(sForwardedPage).concat(String.valueOf(".jsp")), "DETAIL", oBaseForm.getScreenMode(), oBaseForm.getHeaderStatus());
if (null != oSecMap) {
if (null != oSecMap.get("D"))
enableDisable(oBaseForm, (ArrayList)oSecMap.get("D"), "D");
if (null != oSecMap.get("E"))
enableDisable(oBaseForm, (ArrayList)oSecMap.get("E"), "E");
}
BaseHeaderBean oBaseHeaderBean = getBaseHeaderBean(sFormName);
ArrayList oDetailList = null;
BeanUtils.copyProperties(oBaseHeaderBean, form);
oDetailList = (oNextBaseDetailVO.getOThisPageData() != null) ? oNextBaseDetailVO.getOThisPageData() : new ArrayList();
ThisPageVO oThisPageVO = new ThisPageVO();
oThisPageVO.setODetailList(oDetailList);
oThisPageVO.setOHeaderBean(oBaseHeaderBean);
oThisPageVO.setScreenMode(oBaseForm.getScreenMode());
oThisPageVO.setScreenName(oBaseForm.getForwardedPage());
Map oMap = oBaseBD.getDisabledFields(oThisPageVO);
if (oMap != null) {
if (oMap.containsKey("D"))
enableDisable(oBaseForm, (ArrayList)oMap.get("D"), "D");
if (oMap.containsKey("E"))
enableDisable(oBaseForm, (ArrayList)oMap.get("E"), "E");
}
if (oThisPageVO.getODetailList() != null) {
oBaseForm.setThisPageDetailCount(oThisPageVO.getODetailList().size());
BeanUtils.setProperty(oBaseForm, ParamUtil.getDetailArrayName(sFormName, sForwardedPage), oThisPageVO.getODetailList());
}
}
}
if (sForwardedPage != null)
oBaseForm.setScreenName(sForwardedPage);
onLoad(form, request, 22);
if (sForwardedPage != null) {
oUser.setForwardedPage(sFormName, sForwardedPage);
return mapping.findForward(sForwardedPage);
}
return mapping.findForward("success");
}
}

View File

@@ -0,0 +1,139 @@
package WEB-INF.classes.wenrgise.common.webtier.action;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.StringTokenizer;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import wenrgise.common.businessdelegate.LOVBD;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.utility.EnrgiseUtil;
import wenrgise.common.utility.UserInfo;
import wenrgise.common.vo.LovQueryVO;
import wenrgise.common.vo.LovVO;
import wenrgise.common.webtier.action.BaseAction;
import wenrgise.common.webtier.form.BaseLOVForm;
import wenrgise.common.xml.vo.LOVInfo;
import wenrgise.ejb.common.session.UserSession;
import wenrgise.ejb.common.utility.LOVManager;
public class LOVAction extends BaseAction {
public ActionForward executeImpl(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws EnrgiseApplicationException, EnrgiseSystemException, IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException, ServletException, IOException {
BaseLOVForm oBaseLOVForm = (BaseLOVForm)form;
System.out.println(oBaseLOVForm.getLovKey());
UserSession oUser = getUserSessionBean(request);
LOVInfo oLOVInfo = LOVManager.getInstance().getCachedObject(oBaseLOVForm.getLovKey());
if (oLOVInfo != null)
if (EnrgiseUtil.checkString(oLOVInfo.getRecursiveFlag())) {
if (oLOVInfo.getRecursiveFlag().equalsIgnoreCase("Y")) {
processRecursiveLov(oBaseLOVForm, oLOVInfo, mapping);
oBaseLOVForm.setRecursiveFlag("Y");
} else {
processSimpleLov(oBaseLOVForm, oLOVInfo, mapping, oUser.getUserInfo());
oBaseLOVForm.setRecursiveFlag("N");
}
} else {
processSimpleLov(oBaseLOVForm, oLOVInfo, mapping, oUser.getUserInfo());
oBaseLOVForm.setRecursiveFlag("N");
}
return mapping.findForward("success");
}
private ActionForward processSimpleLov(BaseLOVForm oBaseLOVForm, LOVInfo oLOVInfo, ActionMapping mapping, UserInfo oUserInfo) throws EnrgiseApplicationException, EnrgiseSystemException, IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException, ServletException, IOException {
if (oBaseLOVForm.getTxtHidAction().equals("FirstTime")) {
oBaseLOVForm.setTxtHidTotCols(-1);
oBaseLOVForm.setTxtHidSubmitFirst("true");
oBaseLOVForm.setLevel(0);
oBaseLOVForm.setFinalLevel(0);
return mapping.findForward("success");
}
if (oBaseLOVForm.getTxtHidAction().equals("SearchRecords")) {
LOVBD oLOVBD = new LOVBD();
LovVO oLovVO = new LovVO();
LovQueryVO oLOVQueryVO = new LovQueryVO();
StringTokenizer stParameters = new StringTokenizer(oBaseLOVForm.getQueryParam(), ",");
while (stParameters.hasMoreTokens()) {
String[] sKeyValuePair = stParameters.nextToken().split("=");
oLOVQueryVO.setProperty(sKeyValuePair[0], sKeyValuePair[1]);
}
oLOVQueryVO.setProperty("LoginSiteId", oUserInfo.getSiteId());
oLOVQueryVO.setProperty("ListSiteId", String.valueOf(String.valueOf("(").concat(String.valueOf(oUserInfo.getSiteId()))).concat(String.valueOf(")")));
oLOVQueryVO.setSearchField1(oBaseLOVForm.getSearchField1());
oLOVQueryVO.setSearchField2(oBaseLOVForm.getSearchField2());
oLOVQueryVO.setSearchField2(oBaseLOVForm.getSearchField2());
oLOVQueryVO.setSearchField3(oBaseLOVForm.getSearchField3());
oLOVQueryVO.setSearchField4(oBaseLOVForm.getSearchField4());
oLOVQueryVO.setSearchField5(oBaseLOVForm.getSearchField5());
oLOVQueryVO.setSearchField6(oBaseLOVForm.getSearchField6());
oLOVQueryVO.setLevel(0);
oBaseLOVForm.setFinalLevel(-1);
oLovVO = oLOVBD.getLOVData(oLOVInfo, oLOVQueryVO);
if (oBaseLOVForm.getLevel() == 0)
oBaseLOVForm.setLevel(oLovVO.getFinalLevel());
if (oLovVO.getDetailList().size() > 0) {
BeanUtils.copyProperties(oBaseLOVForm, oLovVO);
oBaseLOVForm.setTxtHidTotRows(oLovVO.getDetailList().size());
oBaseLOVForm.setTxtHidTotCols(oLovVO.getHeaderList().size());
} else {
oBaseLOVForm.setTxtHidTotRows(0);
oBaseLOVForm.setTxtHidTotCols(-1);
}
oBaseLOVForm.setTxtHidSubmitFirst("false");
oBaseLOVForm.setInsertFlag(oLOVInfo.getInsertFlag());
}
return null;
}
private ActionForward processRecursiveLov(BaseLOVForm oBaseLOVForm, LOVInfo oLOVInfo, ActionMapping mapping) throws EnrgiseApplicationException, EnrgiseSystemException, IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException, ServletException, IOException {
if (oBaseLOVForm.getTxtHidAction().equals("FirstTime")) {
oBaseLOVForm.setTxtHidTotCols(-1);
oBaseLOVForm.setTxtHidSubmitFirst("true");
oBaseLOVForm.setLevel(-999);
return mapping.findForward("success");
}
if (oBaseLOVForm.getTxtHidAction().equals("SearchRecords")) {
LOVBD oLOVBD = new LOVBD();
LovVO oLovVO = new LovVO();
LovQueryVO oLOVQueryVO = new LovQueryVO();
StringTokenizer stParameters = new StringTokenizer(oBaseLOVForm.getQueryParam(), ",");
while (stParameters.hasMoreTokens()) {
String[] sKeyValuePair = stParameters.nextToken().split("=");
oLOVQueryVO.setProperty(sKeyValuePair[0], sKeyValuePair[1]);
}
oLOVQueryVO.setSearchField1(oBaseLOVForm.getSearchField1());
oLOVQueryVO.setSearchField2(oBaseLOVForm.getSearchField2());
oLOVQueryVO.setLevel(oBaseLOVForm.getLevel());
int iLevel = oBaseLOVForm.getLevel();
int iFinalLevel = oBaseLOVForm.getFinalLevel();
int iInitialLevel = oBaseLOVForm.getInitialLevel();
oLOVQueryVO.setFinalLevel(iFinalLevel);
oLovVO = oLOVBD.getLOVData(oLOVInfo, oLOVQueryVO);
if (oLovVO.getDetailList().size() > 0) {
BeanUtils.copyProperties(oBaseLOVForm, oLovVO);
oBaseLOVForm.setTxtHidTotRows(oLovVO.getDetailList().size());
oBaseLOVForm.setTxtHidTotCols(oLovVO.getHeaderList().size());
} else {
oBaseLOVForm.setTxtHidTotRows(0);
oBaseLOVForm.setTxtHidTotCols(-1);
}
oBaseLOVForm.setTxtHidSubmitFirst("false");
if (oLOVQueryVO.getLevel() == -999) {
oBaseLOVForm.setLevel(oLovVO.getInitialLevel());
oBaseLOVForm.setFinalLevel(oLovVO.getFinalLevel());
oBaseLOVForm.setInitialLevel(oLovVO.getInitialLevel());
} else {
oBaseLOVForm.setLevel(iLevel);
oBaseLOVForm.setFinalLevel(iFinalLevel);
oBaseLOVForm.setInitialLevel(iInitialLevel);
}
oBaseLOVForm.setInsertFlag(oLOVInfo.getInsertFlag());
}
return null;
}
}

View File

@@ -0,0 +1,44 @@
package WEB-INF.classes.wenrgise.common.webtier.action;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import javax.servlet.ServletException;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.webtier.action.BaseAction;
public class LogOutAction extends BaseAction {
public ActionForward executeImpl(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws EnrgiseApplicationException, EnrgiseSystemException, IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException, ServletException, IOException {
Cookie cookieEmpId = null;
Cookie cookieSiteId = null;
String target = "success";
String sEmpId = null;
String sSiteId = null;
cookieEmpId = new Cookie("EmpId", sEmpId);
cookieSiteId = new Cookie("SiteId", sSiteId);
setCookieAttributes(cookieEmpId, false);
setCookieAttributes(cookieSiteId, false);
response.addCookie(cookieEmpId);
response.addCookie(cookieSiteId);
System.out.println("The cookie has been created");
HttpSession session = request.getSession();
session.setAttribute("status", "LOGOUT");
return mapping.findForward("success");
}
private void setCookieAttributes(Cookie c, boolean bValid) {
c.setPath("/");
if (bValid) {
c.setMaxAge(1800);
} else {
c.setMaxAge(0);
}
}
}

View File

@@ -0,0 +1,67 @@
package WEB-INF.classes.wenrgise.common.webtier.action;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import wenrgise.common.bean.BaseHeaderBean;
import wenrgise.common.businessdelegate.BaseBD;
import wenrgise.common.businessdelegate.SecurityBD;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.vo.ThisPageVO;
import wenrgise.common.webtier.action.BaseAction;
import wenrgise.common.webtier.form.BaseForm;
import wenrgise.ejb.common.session.UserSession;
import wenrgise.ejb.common.utility.ParamUtil;
public class NewModeAction extends BaseAction {
public ActionForward executeImpl(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws EnrgiseApplicationException, EnrgiseSystemException, IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException, ServletException, IOException {
BaseForm oBaseForm = (BaseForm)form;
String sFormName = form.getClass().getName();
String sScreenName = oBaseForm.getScreenName();
if (oBaseForm.isHeaderDataChanged() || oBaseForm.isDetailDataChanged())
throw new EnrgiseApplicationException("wenrgise.common.datashouldbesaved", "M");
String sComponentName = getComponentName(sFormName);
UserSession oUser = getUserSessionBean(request);
checkAccessInfo(oUser, sComponentName, oBaseForm.getScreenMode(), "", 10, oBaseForm.getWorkListId());
changeMode(oBaseForm, request);
oBaseForm.setQueried(false);
oBaseForm.setScreenMode("N");
enableAll(oBaseForm);
enableDisable(oBaseForm, insertClicked(), "D");
SecurityBD oSecBD = new SecurityBD();
HashMap oMap = oSecBD.getDisabledFields(String.valueOf(oBaseForm.getScreenName()).concat(String.valueOf(".jsp")), "HEADER", oBaseForm.getScreenMode(), "N");
if (null != oMap)
enableDisable(oBaseForm, (ArrayList)oMap.get("D"), "D");
BaseBD oBaseBD = getHeaderBusinessDelegate(form, request);
BaseHeaderBean oBaseHeaderBean = getBaseHeaderBean(sFormName);
BeanUtils.copyProperties(oBaseHeaderBean, form);
ThisPageVO oThisPageVO = new ThisPageVO();
oThisPageVO.setOHeaderBean(oBaseHeaderBean);
oThisPageVO.setScreenMode(oBaseForm.getScreenMode());
oThisPageVO.setScreenName(oBaseForm.getScreenName());
oThisPageVO.setActionName(10);
Map oBDMap = oBaseBD.getDisabledFields(oThisPageVO);
if (oBDMap != null) {
if (oBDMap.containsKey("D"))
enableDisable(oBaseForm, (ArrayList)oBDMap.get("D"), "D");
if (oBDMap.containsKey("E"))
enableDisable(oBaseForm, (ArrayList)oBDMap.get("E"), "E");
}
if (oThisPageVO.getODetailList() != null) {
oBaseForm.setThisPageDetailCount(oThisPageVO.getODetailList().size());
BeanUtils.setProperty(oBaseForm, ParamUtil.getDetailArrayName(sFormName, sScreenName), oThisPageVO.getODetailList());
}
onLoad(form, request, 10);
return mapping.findForward("success");
}
}

View File

@@ -0,0 +1,88 @@
package WEB-INF.classes.wenrgise.common.webtier.action;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import wenrgise.common.bean.BaseHeaderBean;
import wenrgise.common.businessdelegate.BaseBD;
import wenrgise.common.businessdelegate.SecurityBD;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.utility.EnrgiseUtil;
import wenrgise.common.vo.ThisPageVO;
import wenrgise.common.webtier.action.BaseAction;
import wenrgise.common.webtier.form.BaseForm;
import wenrgise.ejb.common.session.UserSession;
import wenrgise.hrms.webtier.form.HrmBaseForm;
public class OnLoadAction extends BaseAction {
public ActionForward executeImpl(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws EnrgiseApplicationException, EnrgiseSystemException, IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException, ServletException, IOException {
BaseForm oBaseForm = (BaseForm)form;
String sFormName = form.getClass().getName();
String sScreenName = oBaseForm.getScreenName();
HrmBaseForm oHrmBaseForm = (HrmBaseForm)oBaseForm;
HttpSession oSes = request.getSession();
String sSesId = oSes.getId();
if (null == sSesId)
throw new EnrgiseApplicationException("wenrgise.common.session.expire", "E");
String sUserId = (String)oSes.getAttribute("userId");
if (null == sUserId) {
oBaseForm.setFirstLoad("false");
throw new EnrgiseApplicationException("wenrgise.common.session.expire", "E");
}
oHrmBaseForm.setEmpId(sUserId);
UserSession oUser = getUserSessionBean(request);
String sForwardedPage = oUser.getForwardedPage(sFormName);
if (EnrgiseUtil.checkString(oUser.getForwardedPage(sFormName))) {
sForwardedPage = oUser.getForwardedPage(sFormName);
oBaseForm.setScreenName(sForwardedPage);
return mapping.findForward(sForwardedPage);
}
sScreenName = request.getParameter("screenName");
if (sScreenName.equalsIgnoreCase("HrmLvAppln")) {
changeMode(oBaseForm, request);
oBaseForm.setQueried(true);
oBaseForm.setScreenMode("N");
oBaseForm.setFirstLoad("false");
enableAll(oBaseForm);
enableDisable(oBaseForm, insertClicked(), "D");
} else {
changeMode(oBaseForm, request);
oBaseForm.setQueried(true);
oBaseForm.setScreenMode("Q");
oBaseForm.setFirstLoad("false");
enableAll(oBaseForm);
enableDisable(oBaseForm, queryClicked(), "D");
}
SecurityBD oSecBD = new SecurityBD();
HashMap oMap = oSecBD.getDisabledFields(String.valueOf(oBaseForm.getScreenName()).concat(String.valueOf(".jsp")), "HEADER", oBaseForm.getScreenMode(), null);
if (null != oMap)
enableDisable(oBaseForm, (ArrayList)oMap.get("D"), "D");
BaseBD oBaseBD = getHeaderBusinessDelegate(form, request);
BaseHeaderBean oBaseHeaderBean = getBaseHeaderBean(sFormName);
BeanUtils.copyProperties(oBaseHeaderBean, form);
ThisPageVO oThisPageVO = new ThisPageVO();
oThisPageVO.setOHeaderBean(oBaseHeaderBean);
oThisPageVO.setScreenMode(oBaseForm.getScreenMode());
oThisPageVO.setScreenName(oBaseForm.getScreenName());
Map oBDMap = oBaseBD.getDisabledFields(oThisPageVO);
if (oBDMap != null) {
if (oBDMap.containsKey("D"))
enableDisable(oBaseForm, (ArrayList)oBDMap.get("D"), "D");
if (oBDMap.containsKey("E"))
enableDisable(oBaseForm, (ArrayList)oBDMap.get("E"), "E");
}
onLoad(form, request, 13);
return mapping.findForward("success");
}
}

View File

@@ -0,0 +1,83 @@
package WEB-INF.classes.wenrgise.common.webtier.action;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import wenrgise.common.bean.BaseHeaderBean;
import wenrgise.common.businessdelegate.BaseBD;
import wenrgise.common.businessdelegate.SecurityBD;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.vo.ThisPageVO;
import wenrgise.common.webtier.action.BaseAction;
import wenrgise.common.webtier.form.BaseForm;
import wenrgise.ejb.common.utility.ParamUtil;
public class QueryModeAction extends BaseAction {
public ActionForward executeImpl(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws EnrgiseApplicationException, EnrgiseSystemException, IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException, ServletException, IOException {
BaseForm oBaseForm = (BaseForm)form;
String sFormName = form.getClass().getName();
String sScreenName = oBaseForm.getScreenName();
if (oBaseForm.isHeaderDataChanged() || oBaseForm.isDetailDataChanged())
throw new EnrgiseApplicationException("wenrgise.common.datashouldbesaved", "M");
changeMode(oBaseForm, request);
oBaseForm.setQueried(true);
oBaseForm.setScreenMode("Q");
BaseBD oBaseBD = getHeaderBusinessDelegate((ActionForm)oBaseForm, request);
setComboValues(oBaseBD.getComboDetails(), request.getSession());
setComboValues(oBaseBD.getDetailComboDetails(), request.getSession());
enableAll(oBaseForm);
enableDisable(oBaseForm, queryClicked(), "D");
SecurityBD oSecBD = new SecurityBD();
HashMap oMap = oSecBD.getDisabledFields(String.valueOf(oBaseForm.getScreenName()).concat(String.valueOf(".jsp")), "HEADER", oBaseForm.getScreenMode(), null);
if (null != oMap)
enableDisable(oBaseForm, (ArrayList)oMap.get("D"), "D");
BaseHeaderBean oBaseHeaderBean = getBaseHeaderBean(sFormName);
BeanUtils.copyProperties(oBaseHeaderBean, form);
ThisPageVO oThisPageVO = new ThisPageVO();
oThisPageVO.setOHeaderBean(oBaseHeaderBean);
oThisPageVO.setScreenMode(oBaseForm.getScreenMode());
oThisPageVO.setScreenName(oBaseForm.getScreenName());
oThisPageVO.setActionName(10);
Map oBDMap = oBaseBD.getDisabledFields(oThisPageVO);
if (oBDMap != null) {
if (oBDMap.containsKey("D"))
enableDisable(oBaseForm, (ArrayList)oBDMap.get("D"), "D");
if (oBDMap.containsKey("E"))
enableDisable(oBaseForm, (ArrayList)oBDMap.get("E"), "E");
}
if (oThisPageVO.getODetailList() != null) {
oBaseForm.setThisPageDetailCount(oThisPageVO.getODetailList().size());
BeanUtils.setProperty(oBaseForm, ParamUtil.getDetailArrayName(sFormName, sScreenName), oThisPageVO.getODetailList());
}
onLoad(form, request, 10);
return mapping.findForward("success");
}
private void setComboValues(HashMap oComboMap, HttpSession session) {
if (null == oComboMap)
return;
if (oComboMap.size() <= 0)
return;
Set oKeySet = oComboMap.keySet();
Iterator oIt = oKeySet.iterator();
while (oIt.hasNext()) {
String sKey = oIt.next();
session.setAttribute(sKey, oComboMap.get(sKey));
}
oKeySet.clear();
oComboMap.clear();
}
}

View File

@@ -0,0 +1,112 @@
package WEB-INF.classes.wenrgise.common.webtier.action;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Map;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import wenrgise.common.bean.BaseHeaderBean;
import wenrgise.common.businessdelegate.BaseBD;
import wenrgise.common.businessdelegate.SecurityBD;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.vo.BaseDetailVO;
import wenrgise.common.vo.BaseHeaderVO;
import wenrgise.common.vo.BaseQueryVO;
import wenrgise.common.vo.ThisPageVO;
import wenrgise.common.webtier.action.BaseAction;
import wenrgise.common.webtier.form.BaseForm;
import wenrgise.ejb.common.session.UserSession;
import wenrgise.ejb.common.utility.ParamUtil;
public class RefreshAction extends BaseAction {
public ActionForward executeImpl(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws EnrgiseApplicationException, EnrgiseSystemException, IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException, ServletException, IOException {
BaseForm oBaseForm = (BaseForm)form;
String sFormName = form.getClass().getName();
String sScreenName = oBaseForm.getScreenName();
UserSession oUser = getUserSessionBean(request);
BaseBD oBaseBD = getDetailBusinessDelegate(form, request);
BaseDetailVO oBaseDetailVO = null;
oBaseForm.setHeaderDataChanged(false);
oBaseForm.setDetailDataChanged(false);
String sScreenMode = oBaseForm.getScreenMode();
oBaseForm.setUserPositionRequested(null);
oBaseForm.setUserPageRequested(null);
if (sScreenMode.equals("N") || sScreenMode.equals("Q")) {
changeMode(oBaseForm, request);
oBaseForm.setScreenMode(sScreenMode);
} else {
BaseQueryVO oBaseQueryVO = null;
BaseHeaderVO oBaseHeaderVO = null;
if (oBaseForm.isQueried()) {
oBaseQueryVO = oUser.getBaseQueryVO(sFormName);
if (oBaseQueryVO != null) {
BeanUtils.copyProperties(oBaseQueryVO, form);
oBaseQueryVO.setHeaderPrimaryKey(null);
oBaseHeaderVO = oBaseBD.getNextHeaderRecord(oBaseQueryVO, oBaseForm.getPositionRequested(), sFormName, false, oUser);
int iRelativePosition = (int)(oBaseHeaderVO.getPositionRequested() - oBaseHeaderVO.getHeaderStartPosition() + 1L);
BeanUtils.copyProperties(form, oBaseHeaderVO.getHeaderRecord(iRelativePosition));
BeanUtils.copyProperties(form, oBaseHeaderVO);
}
} else {
oBaseQueryVO = getQueryVO(form);
BeanUtils.copyProperties(oBaseQueryVO, form);
if (oBaseForm.getHeaderPrimaryKey() != null) {
oBaseQueryVO.setHeaderPrimaryKey(oBaseForm.getHeaderPrimaryKey());
oBaseHeaderVO = oBaseBD.getHeaderRecord(oBaseQueryVO, sFormName, oUser);
BeanUtils.copyProperties(form, oBaseHeaderVO.getHeaderRecord(1));
BeanUtils.copyProperties(form, oBaseHeaderVO);
}
}
oBaseDetailVO = oUser.getBaseDetailVO(sFormName, sScreenName);
if (null != oBaseDetailVO) {
oBaseDetailVO = getDetailData(oBaseForm, sFormName, sScreenName, 1L, request, oBaseBD, false, oUser);
if (oBaseDetailVO.getOThisPageData() != null) {
oBaseForm.setThisPageDetailCount(oBaseDetailVO.getOThisPageData().size());
BeanUtils.setProperty(oBaseForm, ParamUtil.getDetailArrayName(sFormName, sScreenName), oBaseDetailVO.getOThisPageData());
} else {
oBaseForm.setThisPageDetailCount(0);
}
long totDetRecord = oBaseDetailVO.getTotalDetailRecord();
oBaseForm.setTotalPageCount(calculateTotalDetailPage(sFormName, sScreenName, totDetRecord));
controlDetailNavigation(oBaseForm);
}
}
SecurityBD oSecBD = new SecurityBD();
Map oSecMap = oSecBD.getDisabledFields(String.valueOf(oBaseForm.getScreenName()).concat(String.valueOf(".jsp")), "ALL", oBaseForm.getScreenMode(), oBaseForm.getHeaderStatus());
if (null != oSecMap)
enableDisable(oBaseForm, (ArrayList)oSecMap.get("D"), "D");
BaseHeaderBean oThisBaseHeaderBean = getBaseHeaderBean(sFormName);
BeanUtils.copyProperties(oThisBaseHeaderBean, form);
ThisPageVO oThisPageVO = new ThisPageVO();
oThisPageVO.setOHeaderBean(oThisBaseHeaderBean);
oThisPageVO.setScreenMode(oBaseForm.getScreenMode());
oThisPageVO.setScreenName(oBaseForm.getScreenName());
oThisPageVO.setActionName(19);
oBaseDetailVO = null;
oBaseDetailVO = oUser.getBaseDetailVO(sFormName, oBaseForm.getScreenName());
if (null != oBaseDetailVO) {
ArrayList oDetailList = (oBaseDetailVO.getOThisPageData() != null) ? oBaseDetailVO.getOThisPageData() : new ArrayList();
oThisPageVO.setODetailList(oDetailList);
}
Map oMap = oBaseBD.getDisabledFields(oThisPageVO);
if (oMap != null) {
if (oMap.containsKey("D"))
enableDisable(oBaseForm, (ArrayList)oMap.get("D"), "D");
if (oMap.containsKey("E"))
enableDisable(oBaseForm, (ArrayList)oMap.get("E"), "E");
}
if (oThisPageVO.getODetailList() != null) {
oBaseForm.setThisPageDetailCount(oThisPageVO.getODetailList().size());
BeanUtils.setProperty(oBaseForm, ParamUtil.getDetailArrayName(sFormName, sScreenName), oThisPageVO.getODetailList());
}
onLoad(form, request, 19);
return mapping.findForward("success");
}
}

View File

@@ -0,0 +1,133 @@
package WEB-INF.classes.wenrgise.common.webtier.action;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Map;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import wenrgise.common.bean.BaseHeaderBean;
import wenrgise.common.businessdelegate.BaseBD;
import wenrgise.common.businessdelegate.SecurityBD;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.vo.BaseDetailVO;
import wenrgise.common.vo.BaseHeaderVO;
import wenrgise.common.vo.BaseQueryVO;
import wenrgise.common.vo.ThisPageVO;
import wenrgise.common.webtier.action.BaseAction;
import wenrgise.common.webtier.form.BaseForm;
import wenrgise.ejb.common.session.UserSession;
import wenrgise.ejb.common.utility.ParamUtil;
public class SaveAction extends BaseAction {
public ActionForward executeImpl(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws EnrgiseApplicationException, EnrgiseSystemException, IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException, ServletException, IOException {
BaseForm oBaseForm = (BaseForm)form;
String sFormName = form.getClass().getName();
String sScreenName = oBaseForm.getScreenName();
BaseBD oBaseBD = getHeaderBusinessDelegate(form, request);
UserSession oUser = getUserSessionBean(request);
String sComponentName = getComponentName(sFormName);
String wlId = oBaseForm.getWorkListId();
checkAccessInfo(oUser, sComponentName, oBaseForm.getScreenMode(), "", 8, oBaseForm.getWorkListId());
BaseHeaderBean oBaseHeaderBean = getBaseHeaderBean(sFormName);
ArrayList oDetailBeanArray = null;
BaseDetailVO oBaseDetailVO = null;
BaseHeaderVO oBaseHeaderVO = null;
Timestamp oHeaderPicked = null;
Timestamp oDetailPicked = null;
if (!oBaseForm.isDetailDataChanged() && !oBaseForm.isHeaderDataChanged())
return mapping.findForward("success");
BeanUtils.copyProperties(oBaseHeaderBean, form);
if (oBaseForm.getScreenMode().equals("N")) {
oHeaderPicked = null;
} else {
if (oBaseForm.isHeaderDataChanged()) {
oBaseHeaderVO = oUser.getBaseHeaderVO(sFormName);
if (oBaseHeaderVO != null) {
oHeaderPicked = oBaseHeaderVO.getOWhenPicked();
oBaseHeaderBean = getBaseHeaderBean(sFormName);
}
BeanUtils.copyProperties(oBaseHeaderBean, form);
}
oBaseDetailVO = oUser.getBaseDetailVO(sFormName, sScreenName);
if (oBaseDetailVO != null)
oDetailPicked = oBaseDetailVO.getOWhenPicked();
if (oBaseForm.isDetailDataChanged())
oDetailBeanArray = getDetailArray(oBaseForm);
}
String sHeaderPrimaryKey = oBaseBD.saveRecord(oBaseHeaderBean, oHeaderPicked, oBaseForm.getScreenName(), oBaseForm.getScreenMode(), oBaseForm.isHeaderDataChanged(), oDetailBeanArray, oBaseForm.isDetailDataChanged(), oDetailPicked);
oBaseForm.setHeaderDataChanged(false);
oBaseForm.setDetailDataChanged(false);
oBaseForm.setHeaderPrimaryKey(sHeaderPrimaryKey);
BaseQueryVO oBaseQueryVO = getQueryVO(form);
BeanUtils.copyProperties(oBaseQueryVO, form);
oBaseQueryVO.setHeaderPrimaryKey(sHeaderPrimaryKey);
oBaseQueryVO.setMaxHeaderSize(ParamUtil.getHeaderSize(sFormName));
oBaseHeaderVO = oBaseBD.getHeaderRecord(oBaseQueryVO, sFormName, oUser);
BeanUtils.copyProperties(form, oBaseHeaderVO.getHeaderRecord(1));
BeanUtils.copyProperties(form, oBaseHeaderVO);
oUser.putBaseHeaderVO(sFormName, oBaseHeaderVO);
if (!oBaseForm.getScreenMode().equals("N"))
if (null != oBaseDetailVO) {
if (oBaseDetailVO.getTotalDetailRecord() + oBaseDetailVO.getRowAdded() - oBaseDetailVO.getRowDeleted() >= 0L) {
oBaseDetailVO.setRowDeleted(0);
oBaseDetailVO.setRowAdded(0);
oBaseDetailVO = getDetailData(oBaseForm, sFormName, sScreenName, 1L, request, oBaseBD, true, oUser);
oBaseForm.setPageRequested(1L);
long totDetRecord = oBaseDetailVO.getTotalDetailRecord();
oBaseForm.setTotalPageCount(calculateTotalDetailPage(sFormName, sScreenName, totDetRecord));
if (oBaseDetailVO.getOThisPageData() != null) {
oBaseForm.setThisPageDetailCount(oBaseDetailVO.getOThisPageData().size());
BeanUtils.setProperty(oBaseForm, ParamUtil.getDetailArrayName(sFormName, sScreenName), oBaseDetailVO.getOThisPageData());
} else {
oBaseForm.setThisPageDetailCount(0);
}
checkDetailNavigation(oBaseForm, oUser.getBaseDetailVO(sFormName, sScreenName));
BeanUtils.copyProperties(oBaseForm, oBaseDetailVO);
}
oUser.putBaseDetailVO(sFormName, sScreenName, oBaseDetailVO);
}
oBaseForm.setScreenMode("U");
enableAll(oBaseForm);
enableDisable(oBaseForm, saveClicked(), "D");
controlHeaderNavigation(oBaseForm);
controlDetailNavigation(oBaseForm);
SecurityBD oSecBD = new SecurityBD();
Map oSecMap = oSecBD.getDisabledFields(String.valueOf(oBaseForm.getScreenName()).concat(String.valueOf(".jsp")), "ALL", oBaseForm.getScreenMode(), oBaseForm.getHeaderStatus());
if (null != oSecMap)
enableDisable(oBaseForm, (ArrayList)oSecMap.get("D"), "D");
BaseHeaderBean oThisBaseHeaderBean = getBaseHeaderBean(sFormName);
BeanUtils.copyProperties(oThisBaseHeaderBean, form);
ThisPageVO oThisPageVO = new ThisPageVO();
oThisPageVO.setOHeaderBean(oThisBaseHeaderBean);
oThisPageVO.setScreenMode(oBaseForm.getScreenMode());
oThisPageVO.setScreenName(oBaseForm.getScreenName());
oThisPageVO.setActionName(8);
oBaseDetailVO = null;
oBaseDetailVO = oUser.getBaseDetailVO(sFormName, oBaseForm.getScreenName());
if (null != oBaseDetailVO) {
ArrayList oDetailList = (oBaseDetailVO.getOThisPageData() != null) ? oBaseDetailVO.getOThisPageData() : new ArrayList();
oThisPageVO.setODetailList(oDetailList);
}
Map oMap = oBaseBD.getDisabledFields(oThisPageVO);
if (oMap != null) {
if (oMap.containsKey("D"))
enableDisable(oBaseForm, (ArrayList)oMap.get("D"), "D");
if (oMap.containsKey("E"))
enableDisable(oBaseForm, (ArrayList)oMap.get("E"), "E");
}
if (oThisPageVO.getODetailList() != null) {
oBaseForm.setThisPageDetailCount(oThisPageVO.getODetailList().size());
BeanUtils.setProperty(oBaseForm, ParamUtil.getDetailArrayName(sFormName, sScreenName), oThisPageVO.getODetailList());
}
onLoad(form, request, 8);
throw new EnrgiseApplicationException("wenrgise.common.datasaved", "M");
}
}

View File

@@ -0,0 +1,111 @@
package WEB-INF.classes.wenrgise.common.webtier.action;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Map;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import wenrgise.common.bean.BaseHeaderBean;
import wenrgise.common.businessdelegate.BaseBD;
import wenrgise.common.businessdelegate.SecurityBD;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.vo.BaseDetailVO;
import wenrgise.common.vo.BaseQueryVO;
import wenrgise.common.vo.DetailSizeValues;
import wenrgise.common.vo.ThisPageVO;
import wenrgise.common.webtier.action.BaseAction;
import wenrgise.common.webtier.form.BaseForm;
import wenrgise.ejb.common.session.UserSession;
import wenrgise.ejb.common.utility.ParamUtil;
public class SaveDetailAction extends BaseAction {
public ActionForward executeImpl(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws EnrgiseApplicationException, EnrgiseSystemException, IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException, ServletException, IOException {
BaseForm oBaseForm = (BaseForm)form;
String sFormName = form.getClass().getName();
String sScreenName = oBaseForm.getScreenName();
BaseBD oBaseBD = getDetailBusinessDelegate(form, request);
UserSession oUser = getUserSessionBean(request);
String sComponentName = getComponentName(sFormName);
checkAccessInfo(oUser, sComponentName, oBaseForm.getScreenMode(), "", 8, oBaseForm.getWorkListId());
ArrayList oDetailBeanArray = null;
BaseDetailVO oBaseDetailVO = null;
Timestamp oDetailPicked = null;
if (!oBaseForm.isDetailDataChanged())
return mapping.findForward("success");
oBaseDetailVO = oUser.getBaseDetailVO(sFormName, sScreenName);
if (oBaseDetailVO != null)
oDetailPicked = oBaseDetailVO.getOWhenPicked();
oDetailBeanArray = getDetailArray(oBaseForm);
BaseHeaderBean oBaseHeaderBean = getBaseHeaderBean(sFormName);
BeanUtils.copyProperties(oBaseHeaderBean, form);
String sHeaderPrimaryKey = oBaseBD.saveRecord(oBaseHeaderBean, null, oBaseForm.getScreenName(), oBaseForm.getScreenMode(), false, oDetailBeanArray, true, oDetailPicked);
oBaseForm.setDetailDataChanged(false);
if (null != oBaseDetailVO) {
oBaseDetailVO.setRowDeleted(0);
oBaseDetailVO.setRowAdded(0);
}
BaseQueryVO oBaseQueryVO = null;
DetailSizeValues oDetailSizeValues = new DetailSizeValues();
oDetailSizeValues.setDetailRecordPerPage(ParamUtil.getDetailRecordPerPage(sFormName, sScreenName));
oDetailSizeValues.setMaxPages(ParamUtil.getMaxDetailPages(sFormName, sScreenName));
oBaseDetailVO = getDetailData(oBaseForm, sFormName, sScreenName, 1L, request, oBaseBD, true, oUser);
oBaseForm.setPageRequested(1L);
oBaseDetailVO.setRowAdded(0);
oBaseDetailVO.setRowDeleted(0);
if (oBaseDetailVO.getOThisPageData() != null) {
oBaseForm.setThisPageDetailCount(oBaseDetailVO.getOThisPageData().size());
BeanUtils.setProperty(oBaseForm, ParamUtil.getDetailArrayName(sFormName, sScreenName), oBaseDetailVO.getOThisPageData());
} else {
oBaseForm.setThisPageDetailCount(0);
}
if (oBaseDetailVO != null) {
long totDetRecord = oBaseDetailVO.getTotalDetailRecord();
oBaseForm.setTotalPageCount(calculateTotalDetailPage(sFormName, sScreenName, totDetRecord));
}
BeanUtils.copyProperties(oBaseForm, oBaseDetailVO);
oUser.putBaseDetailVO(sFormName, sScreenName, oBaseDetailVO);
oBaseForm.setScreenMode("U");
enableAll(oBaseForm);
enableDisable(oBaseForm, saveClicked(), "D");
controlHeaderNavigation(oBaseForm);
controlDetailNavigation(oBaseForm);
SecurityBD oSecBD = new SecurityBD();
Map oSecMap = oSecBD.getDisabledFields(String.valueOf(oBaseForm.getScreenName()).concat(String.valueOf(".jsp")), "ALL", oBaseForm.getScreenMode(), oBaseForm.getHeaderStatus());
if (null != oSecMap)
enableDisable(oBaseForm, (ArrayList)oSecMap.get("D"), "D");
BaseHeaderBean oThisBaseHeaderBean = getBaseHeaderBean(sFormName);
BeanUtils.copyProperties(oThisBaseHeaderBean, form);
ThisPageVO oThisPageVO = new ThisPageVO();
oThisPageVO.setOHeaderBean(oThisBaseHeaderBean);
oThisPageVO.setScreenMode(oBaseForm.getScreenMode());
oThisPageVO.setScreenName(oBaseForm.getScreenName());
oThisPageVO.setActionName(8);
oBaseDetailVO = null;
oBaseDetailVO = oUser.getBaseDetailVO(sFormName, oBaseForm.getScreenName());
if (null != oBaseDetailVO) {
ArrayList oDetailList = (oBaseDetailVO.getOThisPageData() != null) ? oBaseDetailVO.getOThisPageData() : new ArrayList();
oThisPageVO.setODetailList(oDetailList);
}
Map oMap = oBaseBD.getDisabledFields(oThisPageVO);
if (oMap != null) {
if (oMap.containsKey("D"))
enableDisable(oBaseForm, (ArrayList)oMap.get("D"), "D");
if (oMap.containsKey("E"))
enableDisable(oBaseForm, (ArrayList)oMap.get("E"), "E");
}
if (oThisPageVO.getODetailList() != null) {
oBaseForm.setThisPageDetailCount(oThisPageVO.getODetailList().size());
BeanUtils.setProperty(oBaseForm, ParamUtil.getDetailArrayName(sFormName, sScreenName), oThisPageVO.getODetailList());
}
onLoad(form, request, 8);
throw new EnrgiseApplicationException("wenrgise.common.datasaved", "M");
}
}

View File

@@ -0,0 +1,53 @@
package WEB-INF.classes.wenrgise.common.webtier.action;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Map;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import wenrgise.common.bean.BaseHeaderBean;
import wenrgise.common.businessdelegate.BaseBD;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.vo.BaseDetailVO;
import wenrgise.common.vo.ThisPageVO;
import wenrgise.common.webtier.action.BaseAction;
import wenrgise.common.webtier.form.BaseForm;
import wenrgise.ejb.common.session.UserSession;
public class ValidateAction extends BaseAction {
public ActionForward executeImpl(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws EnrgiseApplicationException, EnrgiseSystemException, IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException, ServletException, IOException {
BaseForm oBaseForm = (BaseForm)form;
String sFormName = form.getClass().getName();
String sScreenName = oBaseForm.getScreenName();
BaseBD oBaseBD = getHeaderBusinessDelegate(form, request);
BaseHeaderBean oBaseHeaderBean = getBaseHeaderBean(sFormName);
BeanUtils.copyProperties(oBaseHeaderBean, form);
ThisPageVO oThisPageVO = new ThisPageVO();
oThisPageVO.setOHeaderBean(oBaseHeaderBean);
oThisPageVO.setScreenMode(oBaseForm.getScreenMode());
oThisPageVO.setScreenName(oBaseForm.getScreenName());
oThisPageVO.setActionName(21);
UserSession oUser = getUserSessionBean(request);
BaseDetailVO oBaseDetailVO = oUser.getBaseDetailVO(sFormName, oBaseForm.getScreenName());
if (null != oBaseDetailVO) {
ArrayList oDetailList = getDetailArray(oBaseForm);
oThisPageVO.setODetailList(oDetailList);
}
Map oMap = oBaseBD.getDisabledFields(oThisPageVO);
if (oMap != null) {
if (oMap.containsKey("D"))
enableDisable(oBaseForm, (ArrayList)oMap.get("D"), "D");
if (oMap.containsKey("E"))
enableDisable(oBaseForm, (ArrayList)oMap.get("E"), "E");
}
onLoad(form, request, 21);
return mapping.findForward("success");
}
}

View File

@@ -0,0 +1,295 @@
package WEB-INF.classes.wenrgise.ejb.common.business;
import java.rmi.RemoteException;
import java.sql.Timestamp;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Locale;
import java.util.logging.Logger;
import javax.ejb.CreateException;
import wenrgise.common.bean.BaseHeaderBean;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseMessageKeyException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.common.utility.EnrgiseUtil;
import wenrgise.common.utility.UserInfo;
import wenrgise.ejb.common.helper.DBObject;
import wenrgise.ejb.common.session.UserSession;
import wenrgise.ejb.common.session.UserSessionHome;
import wenrgise.ejb.common.utility.DBUtilitiesBean;
import wenrgise.ejb.common.utility.ServiceLocator;
public abstract class BaseBO {
public static Logger log = Logger.getLogger("wenrgise.ejb.common.business.BaseBO");
protected String headerTable = null;
private String headerPKColumnName = null;
private String detailTable = null;
private String detailPKColumnName = null;
protected DateFormat userDateFormat;
protected DateFormat defaultDateFormat;
protected Locale userLocale;
protected Locale defaultLocale;
protected UserInfo oUserInfo;
public BaseBO() {}
public BaseBO(UserInfo oUserInfo) {
this.oUserInfo = oUserInfo;
}
private void setDateFormatAndLocale() throws EnrgiseSystemException {
this.userDateFormat = new SimpleDateFormat("dd/MM/yyyy");
this.defaultDateFormat = new SimpleDateFormat("dd/MM/yyyy");
try {
UserSessionHome oHome = (UserSessionHome)ServiceLocator.getLocator().getService("UserSession");
UserSession oUser = oHome.create();
this.userDateFormat = oUser.getUserDateFormat();
this.defaultDateFormat = oUser.getDefaultDateFormat();
this.userLocale = oUser.getUserLocale();
this.defaultLocale = oUser.getDefaultLocale();
this.oUserInfo = oUser.getUserInfo();
} catch (RemoteException oEx) {
log.severe(oEx.getMessage());
throw new EnrgiseSystemException();
} catch (CreateException oCrt) {
log.severe(oCrt.getMessage());
throw new EnrgiseSystemException();
}
}
public String saveData(BaseHeaderBean oBaseHeaderBean, Timestamp oWhenPicked, String sScreenName, String sScreenMode, boolean bHeaderDataChanged, ArrayList oDetailBeanArray, boolean bDetailDataChanged, Timestamp oDetailPicked) throws EnrgiseApplicationException, EnrgiseSystemException {
String sScreenHeaderPrimaryKey = (null != oBaseHeaderBean) ? oBaseHeaderBean.getHeaderPrimaryKey() : "";
String sHeaderPrimaryKey = sScreenHeaderPrimaryKey;
if (sScreenMode.equals("U"))
initializeBOImpl();
if (sScreenMode.equals("U"))
if (bHeaderDataChanged || bDetailDataChanged)
if (oWhenPicked != null) {
if (!checkHeaderTimeStamp(oBaseHeaderBean.getHeaderPrimaryKey(), oDetailPicked))
throw new EnrgiseApplicationException("wenrgise.common.changed", "M");
} else if (!checkHeaderTimeStamp(null, oDetailPicked)) {
throw new EnrgiseApplicationException("wenrgise.common.changed", "M");
}
additionalFieldValidationImpl(oBaseHeaderBean, oWhenPicked, sScreenName, sScreenMode, bHeaderDataChanged, oDetailBeanArray, bDetailDataChanged, oDetailPicked);
additionalTimestampValidationImpl(oBaseHeaderBean, oWhenPicked, sScreenName, sScreenMode, bHeaderDataChanged, oDetailBeanArray, bDetailDataChanged, oDetailPicked);
additionalBusinessValidationImpl(oBaseHeaderBean, oWhenPicked, sScreenName, sScreenMode, bHeaderDataChanged, oDetailBeanArray, bDetailDataChanged, oDetailPicked);
if (bHeaderDataChanged) {
sHeaderPrimaryKey = saveHeaderImpl(oBaseHeaderBean, sScreenMode);
if (sHeaderPrimaryKey == null && !sScreenMode.equalsIgnoreCase("D"))
sHeaderPrimaryKey = sScreenHeaderPrimaryKey;
}
if (bDetailDataChanged && !sScreenMode.equalsIgnoreCase("D"))
if (oBaseHeaderBean == null) {
saveDetailImpl(sHeaderPrimaryKey, sScreenName, oDetailBeanArray);
if (oWhenPicked != null)
updateHeaderTimeStamp(sHeaderPrimaryKey);
} else if (!EnrgiseUtil.checkString(oBaseHeaderBean.getPseudoHeader())) {
saveDetailImpl(sHeaderPrimaryKey, sScreenName, oDetailBeanArray);
if (oWhenPicked != null)
updateHeaderTimeStamp(sHeaderPrimaryKey);
} else {
saveDetailImpl(oBaseHeaderBean, sScreenName, oDetailBeanArray);
}
return sHeaderPrimaryKey;
}
private boolean updateHeaderTimeStamp(String sPrimaryKey) throws EnrgiseSystemException {
ArrayList oParameters = new ArrayList();
DBUtilitiesBean oBean = new DBUtilitiesBean();
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, this.headerTable));
oParameters.add(new DBObject(2, 1, 12, sPrimaryKey));
oParameters.add(new DBObject(3, 2, 12));
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, "COMMONPROCEDURES.proc_UpdateHeaderTimeStamp(?,?,?,?,?,?)");
DBObject oOutObject = oOutArray.get(0);
String sSuccessFlag = (String)oOutObject.getObject();
if (!sSuccessFlag.trim().equals("Y"))
return false;
return true;
}
public void initializeBO(String sHeaderTable, String sDetailTable) {
this.headerTable = sHeaderTable;
}
public void initializeBO(String sHeaderTable) {
this.headerTable = sHeaderTable;
}
private boolean checkHeaderTimeStamp(String sPrimaryKey, Timestamp oWhenPicked) throws EnrgiseSystemException {
ArrayList oParameters = new ArrayList();
DBUtilitiesBean oBean = new DBUtilitiesBean();
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, this.headerTable));
oParameters.add(new DBObject(2, 1, 12, sPrimaryKey));
oParameters.add(new DBObject(3, 1, 93, oWhenPicked));
oParameters.add(new DBObject(4, 2, 12));
oParameters.add(new DBObject(5, 2, 12));
oParameters.add(new DBObject(6, 2, 12));
oParameters.add(new DBObject(7, 2, 4));
ArrayList oOutArray = oBean.callProc(oParameters, "COMMONPROCEDURES.proc_CheckHeaderTimeStamp(?,?,?,?,?,?,?)");
DBObject oOutObject = oOutArray.get(0);
String sSuccessFlag = (String)oOutObject.getObject();
if (!sSuccessFlag.trim().equals("Y"))
return false;
return true;
}
private boolean checkDetailTimeStamp(String sPrimaryKey, Timestamp oWhenDetailPicked) throws EnrgiseSystemException {
ArrayList oParameters = new ArrayList();
DBUtilitiesBean oBean = new DBUtilitiesBean();
oParameters = new ArrayList();
oParameters.add(new DBObject(1, 1, 12, this.headerTable));
oParameters.add(new DBObject(2, 1, 12, this.detailTable));
oParameters.add(new DBObject(3, 1, 12, sPrimaryKey));
oParameters.add(new DBObject(4, 1, 93, oWhenDetailPicked));
oParameters.add(new DBObject(5, 2, 12));
oParameters.add(new DBObject(6, 2, 12));
oParameters.add(new DBObject(7, 2, 12));
oParameters.add(new DBObject(8, 2, 4));
ArrayList oOutArray = oBean.callProc(oParameters, "COMMONPROCEDURES.proc_CheckDetailTimeStamp(?,?,?,?,?,?,?,?)");
DBObject oOutObject = oOutArray.get(0);
String sSuccessFlag = (String)oOutObject.getObject();
if (!sSuccessFlag.trim().equals("Y"))
return false;
return true;
}
public void reportError(ArrayList oList) throws EnrgiseSystemException, EnrgiseApplicationException {
if (oList.size() > 0) {
boolean bFirstTime = true;
EnrgiseApplicationException oApp = null;
EnrgiseSystemException oSys = null;
Object obj = null;
Iterator oIt = oList.iterator();
while (oIt.hasNext()) {
obj = oIt.next();
if (obj instanceof EnrgiseApplicationException || obj instanceof EnrgiseMessageKeyException) {
if (!bFirstTime) {
oApp.addToList((EnrgiseApplicationException)obj);
continue;
}
bFirstTime = false;
oApp = (EnrgiseApplicationException)obj;
continue;
}
oSys = (EnrgiseSystemException)obj;
throw oSys;
}
throw oApp;
}
}
public abstract String saveHeaderImpl(BaseHeaderBean paramBaseHeaderBean, String paramString) throws EnrgiseMessageKeyException, EnrgiseApplicationException, EnrgiseSystemException;
public abstract void saveDetailImpl(String paramString1, String paramString2, ArrayList paramArrayList) throws EnrgiseApplicationException, EnrgiseSystemException;
public void saveDetailImpl(BaseHeaderBean oBaseHeaderBean, String sScreenName, ArrayList oDetailBeanArray) throws EnrgiseApplicationException, EnrgiseSystemException {}
public abstract void initializeBOImpl();
public abstract void additionalFieldValidationImpl(BaseHeaderBean paramBaseHeaderBean, Timestamp paramTimestamp1, String paramString1, String paramString2, boolean paramBoolean1, ArrayList paramArrayList, boolean paramBoolean2, Timestamp paramTimestamp2) throws EnrgiseApplicationException, EnrgiseSystemException;
public abstract void additionalTimestampValidationImpl(BaseHeaderBean paramBaseHeaderBean, Timestamp paramTimestamp1, String paramString1, String paramString2, boolean paramBoolean1, ArrayList paramArrayList, boolean paramBoolean2, Timestamp paramTimestamp2) throws EnrgiseApplicationException, EnrgiseSystemException;
public abstract void additionalBusinessValidationImpl(BaseHeaderBean paramBaseHeaderBean, Timestamp paramTimestamp1, String paramString1, String paramString2, boolean paramBoolean1, ArrayList paramArrayList, boolean paramBoolean2, Timestamp paramTimestamp2) throws EnrgiseApplicationException, EnrgiseSystemException;
public UserInfo getOUserInfo() {
return this.oUserInfo;
}
public void setOUserInfo(UserInfo newOUserInfo) {
this.oUserInfo = newOUserInfo;
}
public String approve(String sTableName, BaseHeaderBean oBaseHeaderBean, Timestamp oWhenPicked, ArrayList oDetailBeanArray, Timestamp oDetailPicked) throws EnrgiseApplicationException, EnrgiseSystemException {
String sHeaderPrimaryKey = (null != oBaseHeaderBean) ? oBaseHeaderBean.getHeaderPrimaryKey() : "";
initializeBOImpl();
if (sHeaderPrimaryKey != null) {
if (oWhenPicked != null &&
!checkHeaderTimeStamp(sHeaderPrimaryKey, oWhenPicked))
throw new EnrgiseApplicationException("wenrgise.common.changed", "M");
validateApprove(sHeaderPrimaryKey);
if (EnrgiseUtil.checkString(sTableName)) {
DBUtilitiesBean oBean = new DBUtilitiesBean();
String sQuery = String.valueOf(String.valueOf(String.valueOf(String.valueOf(String.valueOf("update ").concat(String.valueOf(sTableName))).concat(String.valueOf(" set status_flag='"))).concat(String.valueOf("A"))).concat(String.valueOf("',modified_site_id = 100, user_id_modified = 100, modified_time_stamp = sysdate where id="))).concat(String.valueOf(sHeaderPrimaryKey));
int i = oBean.executeUpsert(sQuery);
}
} else {
throw new EnrgiseApplicationException("wenrgise.common.norecordfound", "M");
}
return sHeaderPrimaryKey;
}
public String callWorkFlow(BaseHeaderBean oBaseHeaderBean, ArrayList arylstDetailBeanArray, String activity) throws EnrgiseApplicationException, EnrgiseSystemException {
if (activity.equals("A"))
return "FinallyApproved";
if (activity.equals("R"))
return "R";
return "success";
}
public void validateApprove(String sHeaderPrimaryKey) {}
public void validateReject(String sHeaderPrimaryKey) {}
public void validateRevise(String sHeaderPrimaryKey) {}
public String submit(String sTableName, BaseHeaderBean oBaseHeaderBean, Timestamp oWhenPicked, ArrayList oDetailBeanArray, Timestamp oDetailPicked) throws EnrgiseApplicationException, EnrgiseSystemException {
String sHeaderPrimaryKey = (null != oBaseHeaderBean) ? oBaseHeaderBean.getHeaderPrimaryKey() : "";
initializeBOImpl();
if (sHeaderPrimaryKey != null)
if (oWhenPicked != null)
if (!checkHeaderTimeStamp(sHeaderPrimaryKey, oWhenPicked))
throw new EnrgiseApplicationException("wenrgise.common.changed", "M");
return oBaseHeaderBean.getHeaderPrimaryKey();
}
public String reject(String sTableName, BaseHeaderBean oBaseHeaderBean, Timestamp oWhenPicked, ArrayList oDetailBeanArray, Timestamp oDetailPicked) throws EnrgiseApplicationException, EnrgiseSystemException {
String sHeaderPrimaryKey = (null != oBaseHeaderBean) ? oBaseHeaderBean.getHeaderPrimaryKey() : "";
if (sHeaderPrimaryKey != null) {
initializeBOImpl();
if (!checkHeaderTimeStamp(sHeaderPrimaryKey, oWhenPicked))
throw new EnrgiseApplicationException("wenrgise.common.changed", "M");
validateReject(sHeaderPrimaryKey);
if (EnrgiseUtil.checkString(sTableName)) {
DBUtilitiesBean oBean = new DBUtilitiesBean();
String sQuery = String.valueOf(String.valueOf(String.valueOf(String.valueOf(String.valueOf("update ").concat(String.valueOf(sTableName))).concat(String.valueOf(" set status_flag='"))).concat(String.valueOf("R"))).concat(String.valueOf("',modified_site_id = 100, user_id_modified = 100, modified_time_stamp = sysdate where id="))).concat(String.valueOf(sHeaderPrimaryKey));
int i = oBean.executeUpsert(sQuery);
}
} else {
throw new EnrgiseApplicationException("wenrgise.common.norecordfound", "M");
}
return sHeaderPrimaryKey;
}
public String revise(String sTableName, BaseHeaderBean oBaseHeaderBean, Timestamp oWhenPicked, ArrayList oDetailBeanArray, Timestamp oDetailPicked) throws EnrgiseApplicationException, EnrgiseSystemException {
String sHeaderPrimaryKey = (null != oBaseHeaderBean) ? oBaseHeaderBean.getHeaderPrimaryKey() : "";
if (sHeaderPrimaryKey != null) {
initializeBOImpl();
if (!checkHeaderTimeStamp(sHeaderPrimaryKey, oWhenPicked))
throw new EnrgiseApplicationException("wenrgise.common.changed", "M");
validateRevise(sHeaderPrimaryKey);
DBUtilitiesBean oBean = new DBUtilitiesBean();
String sQuery = String.valueOf(String.valueOf(String.valueOf(String.valueOf(String.valueOf(String.valueOf(String.valueOf(String.valueOf("update ").concat(String.valueOf(sTableName))).concat(String.valueOf(" sTablename set sTablename.status_flag = '"))).concat(String.valueOf("V"))).concat(String.valueOf("', sTablename.rev_no=sTablename.rev_no+1,sTablename.modified_site_id = 200, sTablename.user_id_modified = 200, sTablename.modified_time_stamp = sysdate where sTablename.code in (select code from "))).concat(String.valueOf(sTableName))).concat(String.valueOf(" where id="))).concat(String.valueOf(sHeaderPrimaryKey))).concat(String.valueOf(")"));
int i = oBean.executeUpsert(sQuery);
} else {
throw new EnrgiseApplicationException("wenrgise.common.norecordfound", "M");
}
return sHeaderPrimaryKey;
}
}

View File

@@ -0,0 +1,17 @@
package WEB-INF.classes.wenrgise.ejb.common.facade;
import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.HashMap;
import javax.ejb.EJBObject;
import wenrgise.common.bean.EmpInfoBean;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
public interface SecurityFacade extends EJBObject {
HashMap getDisabledFields(String paramString1, String paramString2, String paramString3, String paramString4) throws RemoteException, EnrgiseSystemException, EnrgiseApplicationException;
ArrayList addMenuList(EmpInfoBean paramEmpInfoBean) throws RemoteException, EnrgiseSystemException, EnrgiseApplicationException;
HashMap getAccessInfo(EmpInfoBean paramEmpInfoBean) throws RemoteException, EnrgiseSystemException, EnrgiseApplicationException;
}

View File

@@ -0,0 +1,10 @@
package WEB-INF.classes.wenrgise.ejb.common.facade;
import java.rmi.RemoteException;
import javax.ejb.CreateException;
import javax.ejb.EJBHome;
import wenrgise.ejb.common.facade.SecurityFacade;
public interface SecurityFacadeHome extends EJBHome {
SecurityFacade create() throws CreateException, RemoteException;
}

View File

@@ -0,0 +1,38 @@
package WEB-INF.classes.wenrgise.ejb.common.helper;
import java.io.Serializable;
import wenrgise.ejb.common.helper.InputDBObject;
public class DBObject extends InputDBObject implements Serializable {
private int iInputOutput;
public static final int IN = 1;
public static final int OUT = 2;
public static final int INOUT = 3;
public DBObject() {}
public DBObject(int iPosition, int iDataType) {
this.iPosition = iPosition;
this.iDataType = iDataType;
}
public DBObject(int iPosition, int iInputOutput, int iDataType) {
this.iPosition = iPosition;
this.iInputOutput = iInputOutput;
this.iDataType = iDataType;
}
public DBObject(int iPosition, int iInputOutput, int iDataType, Object oValue) {
this.iPosition = iPosition;
this.iInputOutput = iInputOutput;
this.iDataType = iDataType;
this.oValue = oValue;
}
public int getDirection() {
return this.iInputOutput;
}
}

View File

@@ -0,0 +1,43 @@
package WEB-INF.classes.wenrgise.ejb.common.helper;
import java.io.Serializable;
public class InputDBObject implements Serializable {
protected int iPosition;
protected int iDataType;
protected Object oValue;
public InputDBObject() {}
public InputDBObject(int iPosition, int iDataType, Object oValue) {
this.iPosition = iPosition;
this.iDataType = iDataType;
this.oValue = oValue;
}
public int getDataType() {
return this.iDataType;
}
public void setDataType(int newIDataType) {
this.iDataType = newIDataType;
}
public int getPosition() {
return this.iPosition;
}
public void setPosition(int newIPosition) {
this.iPosition = newIPosition;
}
public Object getObject() {
return this.oValue;
}
public void setObject(Object newOValue) {
this.oValue = newOValue;
}
}

View File

@@ -0,0 +1,27 @@
package WEB-INF.classes.wenrgise.ejb.common.helper;
import java.io.Serializable;
import java.util.HashMap;
import wenrgise.ejb.common.helper.QueryValue;
public class QueryRow implements Serializable {
private HashMap row = null;
public QueryRow(int iCapacity) {
this.row = new HashMap(iCapacity);
}
public HashMap getRow() {
return this.row;
}
public void setRow(HashMap newRow) {
this.row = newRow;
}
public QueryValue get(String sColumnName) {
if (this.row != null)
return (QueryValue)this.row.get(sColumnName.toUpperCase());
return null;
}
}

View File

@@ -0,0 +1,166 @@
package WEB-INF.classes.wenrgise.ejb.common.helper;
import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Blob;
import java.sql.Clob;
import java.sql.Date;
import java.sql.Time;
import java.sql.Timestamp;
import java.util.Date;
public class QueryValue implements Serializable {
private String stringValue = null;
private BigDecimal bigDecimalValue = BigDecimal.valueOf(0L);
private short shortValue = 0;
private int intValue = 0;
private long longValue = 0L;
private float floatValue = 0.0F;
private double doubleValue = 0.0D;
private Date dateValue = null;
private Blob blobValue = null;
private Clob clobValue = null;
public void setString(String value) {
this.stringValue = value;
}
public String getString() {
return this.stringValue;
}
public void setBigDecimal(BigDecimal value) {
this.bigDecimalValue = value;
this.stringValue = (null != value) ? value.toString() : null;
}
public BigDecimal getBigDecimal() {
return this.bigDecimalValue;
}
public void setShort(short value) {
this.shortValue = value;
Short shrt = new Short(value);
this.stringValue = (null != shrt) ? shrt.toString() : null;
}
public short getShort() {
return this.shortValue;
}
public void setInt(int value) {
this.intValue = value;
Integer iValue = new Integer(value);
this.stringValue = (null != iValue) ? iValue.toString() : null;
}
public int getInt() {
return this.intValue;
}
public void setLong(long value) {
this.longValue = value;
Long lValue = new Long(value);
this.stringValue = (null != lValue) ? lValue.toString() : null;
}
public long getLong() {
return this.longValue;
}
public void setFloat(float value) {
this.floatValue = value;
Float fValue = new Float(value);
this.stringValue = (null != fValue) ? fValue.toString() : null;
}
public float getFloat() {
return this.floatValue;
}
public void setDouble(double value) {
this.doubleValue = value;
Double dValue = new Double(value);
this.stringValue = (null != dValue) ? dValue.toString() : null;
}
public double getDouble() {
return this.doubleValue;
}
public void setDate(Date value) {
this.dateValue = value;
this.stringValue = (null != value) ? value.toString() : null;
}
public void setDate(Date value) {
if (null == value) {
this.stringValue = null;
this.dateValue = null;
return;
}
this.dateValue = new Date(value.getTime());
this.stringValue = this.dateValue.toString();
}
public Date getDate() {
return this.dateValue;
}
public void setTime(Date value) {
setDate(value);
}
public void setTime(Time value) {
if (null == value) {
this.stringValue = null;
this.dateValue = null;
return;
}
this.dateValue = new Date(value.getTime());
this.stringValue = this.dateValue.toString();
}
public Date getTime() {
return this.dateValue;
}
public void setTimestamp(Timestamp value) {
if (null == value) {
this.stringValue = null;
this.dateValue = null;
return;
}
this.dateValue = new Date(value.getTime() + (value.getNanos() / 1000000));
this.stringValue = this.dateValue.toString();
}
public Date getTimestamp() {
return this.dateValue;
}
public void setBlob(Blob value) {
this.blobValue = value;
}
public Blob getBlob() {
return this.blobValue;
}
public void setClob(Clob value) {
this.clobValue = value;
}
public Clob getClob() {
return this.clobValue;
}
}

View File

@@ -0,0 +1,59 @@
package WEB-INF.classes.wenrgise.ejb.common.session;
import java.rmi.RemoteException;
import java.text.DateFormat;
import java.util.HashMap;
import java.util.Locale;
import javax.ejb.EJBObject;
import wenrgise.common.utility.UserInfo;
import wenrgise.common.vo.BaseDetailVO;
import wenrgise.common.vo.BaseHeaderVO;
import wenrgise.common.vo.BaseQueryVO;
public interface UserSession extends EJBObject {
void putBaseHeaderVO(String paramString, BaseHeaderVO paramBaseHeaderVO) throws RemoteException;
void removeAllIfExists(String paramString1, String paramString2) throws RemoteException;
void putBaseQueryVO(String paramString, BaseQueryVO paramBaseQueryVO) throws RemoteException;
void putBaseDetailVO(String paramString1, String paramString2, BaseDetailVO paramBaseDetailVO) throws RemoteException;
BaseHeaderVO getBaseHeaderVO(String paramString) throws RemoteException;
BaseQueryVO getBaseQueryVO(String paramString) throws RemoteException;
BaseDetailVO getBaseDetailVO(String paramString1, String paramString2) throws RemoteException;
UserInfo getUserInfo() throws RemoteException;
void setUserInfo(UserInfo paramUserInfo) throws RemoteException;
Locale getUserLocale() throws RemoteException;
void setUserLocale(Locale paramLocale) throws RemoteException;
Locale getDefaultLocale() throws RemoteException;
DateFormat getUserDateFormat() throws RemoteException;
DateFormat getDefaultDateFormat() throws RemoteException;
HashMap getModuleFacade() throws RemoteException;
void removeAllDetailVO(String paramString) throws RemoteException;
void setModuleFacade(HashMap paramHashMap) throws RemoteException;
void setModuleName(String paramString) throws RemoteException;
EJBObject getModuleEJBObject() throws RemoteException;
void setForwardedPage(String paramString1, String paramString2) throws RemoteException;
String getForwardedPage(String paramString) throws RemoteException;
HashMap getAccessInfo() throws RemoteException;
void setAccessInfo(HashMap paramHashMap) throws RemoteException;
}

View File

@@ -0,0 +1,10 @@
package WEB-INF.classes.wenrgise.ejb.common.session;
import java.rmi.RemoteException;
import javax.ejb.CreateException;
import javax.ejb.EJBHome;
import wenrgise.ejb.common.session.UserSession;
public interface UserSessionHome extends EJBHome {
UserSession create() throws CreateException, RemoteException;
}

View File

@@ -0,0 +1,145 @@
package WEB-INF.classes.wenrgise.ejb.common.utility;
import java.util.ArrayList;
import java.util.Iterator;
import wenrgise.common.exception.EnrgiseApplicationException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.ejb.common.helper.QueryRow;
import wenrgise.ejb.common.utility.DBUtilitiesBean;
public class CommonAdditionalUtility {
public String getUserGroup(String empId) throws EnrgiseApplicationException, EnrgiseSystemException {
String groupId = new String();
String sQuery = String.valueOf(" select group_id from sys_user_group_map m where m.user_system_id = ").concat(String.valueOf(empId));
DBUtilitiesBean oBean = new DBUtilitiesBean();
ArrayList oList = oBean.executeQuery(sQuery);
if (oList.size() != 0) {
QueryRow oRow = null;
Iterator oIt = oList.iterator();
while (oIt.hasNext()) {
oRow = oIt.next();
groupId = oRow.get("group_id").getString();
}
}
return groupId;
}
public String getHOD(String empId) throws EnrgiseApplicationException, EnrgiseSystemException {
String hodId = new String();
String sQuery = String.valueOf(String.valueOf(" select m.contact_person_id from gen_wrkgrp_mst m where m.id = (select dtl.wkgp_mst_id from hrm_emp_wrkgrp_dtl dtl where dtl.e_per_dtl_id =").concat(String.valueOf(empId))).concat(String.valueOf(")"));
DBUtilitiesBean oBean = new DBUtilitiesBean();
ArrayList oList = oBean.executeQuery(sQuery);
if (oList.size() != 0) {
QueryRow oRow = null;
Iterator oIt = oList.iterator();
while (oIt.hasNext()) {
oRow = oIt.next();
hodId = oRow.get("CONTACT_PERSON_ID").getString();
}
}
return hodId;
}
public boolean checkValidEmail(String email) throws EnrgiseApplicationException, EnrgiseSystemException {
int atCount = 0;
int dotCount = 0;
boolean flag = true;
int i;
for (i = 0; i < email.length(); i++) {
if (email.charAt(i) == '@')
atCount++;
if (email.charAt(i) == '.')
dotCount++;
}
if (atCount == 1 && dotCount > 0 && email.indexOf("@") != 0 && email.charAt(email.length() - 1) != '.' && email.charAt(email.length() - 1) != '@') {
dotCount = 0;
for (i = email.indexOf("@"); i < email.length(); i++) {
if (email.charAt(i) == '.')
dotCount++;
if (email.indexOf("@") - email.indexOf(".") == -1 || email.lastIndexOf(".") - email.indexOf(".") == 1) {
flag = false;
break;
}
}
} else {
flag = false;
}
if (dotCount == 0 || dotCount > 2)
flag = false;
return flag;
}
public boolean checkValidPan(String panNo) throws EnrgiseApplicationException, EnrgiseSystemException {
boolean flag = true;
panNo = panNo.toUpperCase();
if (panNo.length() != 10) {
flag = false;
} else {
String first = panNo.substring(0, 5);
String second = panNo.substring(5, 9);
int i;
for (i = 0; i < first.length(); i++) {
if (first.charAt(i) < 'A' || first.charAt(i) > 'Z') {
flag = false;
break;
}
}
for (i = 0; i < second.length(); i++) {
if (second.charAt(i) < '0' || second.charAt(i) > '9') {
flag = false;
break;
}
}
if (panNo.charAt(9) < 'A' || panNo.charAt(9) > 'Z')
flag = false;
}
return flag;
}
public ArrayList getDelegatedEmp_Level(String empId, String HdrPrKey, String docTypeId) throws EnrgiseApplicationException, EnrgiseSystemException {
ArrayList outArray = new ArrayList();
String sQuery = "select wt.level_no, wt.delegated_emp_id ";
sQuery = String.valueOf(sQuery).concat(String.valueOf(" from workflow_tasklist wt,workflow_dtl wd,wfl_doc_type_mst wm "));
sQuery = String.valueOf(sQuery).concat(String.valueOf(" where status='P' "));
sQuery = String.valueOf(String.valueOf(sQuery).concat(String.valueOf(" and delegator_emp_id = "))).concat(String.valueOf(empId));
sQuery = String.valueOf(String.valueOf(sQuery).concat(String.valueOf(" and doc_dtl_id = "))).concat(String.valueOf(HdrPrKey));
sQuery = String.valueOf(sQuery).concat(String.valueOf(" and wt.workflow_dtl_id=wd.id "));
sQuery = String.valueOf(sQuery).concat(String.valueOf(" and wd.doc_type_mst_id=wm.id "));
sQuery = String.valueOf(String.valueOf(sQuery).concat(String.valueOf(" and wm.id = "))).concat(String.valueOf(docTypeId));
DBUtilitiesBean oBean = new DBUtilitiesBean();
ArrayList oList = oBean.executeQuery(sQuery);
if (oList.size() != 0) {
QueryRow oRow = null;
Iterator oIt = oList.iterator();
while (oIt.hasNext()) {
oRow = oIt.next();
outArray.add(oRow.get("level_no").getString());
outArray.add(oRow.get("delegated_emp_id").getString());
}
}
return outArray;
}
public ArrayList getEmp_Level(String HdrPrKey, String docTypeId) throws EnrgiseApplicationException, EnrgiseSystemException {
ArrayList outArray = new ArrayList();
String sQuery = "select wt.level_no, wt.delegated_emp_id ";
sQuery = String.valueOf(sQuery).concat(String.valueOf(" from workflow_tasklist wt,workflow_dtl wd,wfl_doc_type_mst wm "));
sQuery = String.valueOf(sQuery).concat(String.valueOf(" where status='P' "));
sQuery = String.valueOf(String.valueOf(sQuery).concat(String.valueOf(" and doc_dtl_id = "))).concat(String.valueOf(HdrPrKey));
sQuery = String.valueOf(sQuery).concat(String.valueOf(" and wt.workflow_dtl_id=wd.id "));
sQuery = String.valueOf(sQuery).concat(String.valueOf(" and wd.doc_type_mst_id=wm.id "));
sQuery = String.valueOf(String.valueOf(sQuery).concat(String.valueOf(" and wm.id = "))).concat(String.valueOf(docTypeId));
DBUtilitiesBean oBean = new DBUtilitiesBean();
ArrayList oList = oBean.executeQuery(sQuery);
if (oList.size() != 0) {
QueryRow oRow = null;
Iterator oIt = oList.iterator();
while (oIt.hasNext()) {
oRow = oIt.next();
outArray.add(oRow.get("level_no").getString());
outArray.add(oRow.get("delegated_emp_id").getString());
}
}
return outArray;
}
}

View File

@@ -0,0 +1,612 @@
package WEB-INF.classes.wenrgise.ejb.common.utility;
import java.sql.BatchUpdateException;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.Date;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Iterator;
import javax.naming.InitialContext;
import javax.sql.DataSource;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.ejb.common.helper.DBObject;
import wenrgise.ejb.common.helper.InputDBObject;
import wenrgise.ejb.common.helper.QueryRow;
import wenrgise.ejb.common.helper.QueryValue;
import wenrgise.ejb.common.utility.ServiceLocator;
public class DBUtilitiesBean {
private String sDbName = "jdbc/conDS";
private ArrayList oOutParameters = null;
private Connection oCon;
private ResultSet oRs;
private Connection oConn = null;
private DataSource oDataSource = null;
private PreparedStatement oDynamicBatchCall = null;
private CallableStatement oBatchCall = null;
private Connection oBatchCon = null;
private Connection oPreParameterCon = null;
private PreparedStatement oPreParameter = null;
private Connection oPreUpsertCon = null;
private PreparedStatement oPreUpsert = null;
private boolean bDynamic = false;
public DBUtilitiesBean() {}
public DBUtilitiesBean(boolean bDynamic) {
this.bDynamic = bDynamic;
}
public void createBatch(String sProcName) throws EnrgiseSystemException {
InitialContext oInitCont = null;
String sParam = String.valueOf(String.valueOf("{ call ").concat(String.valueOf(sProcName))).concat(String.valueOf("}"));
boolean bCreateCoonectionError = false;
try {
Object dataSourceObj = ServiceLocator.getLocator().getLocalService(this.sDbName);
this.oDataSource = (DataSource)dataSourceObj;
this.oBatchCon = this.oDataSource.getConnection();
bCreateCoonectionError = true;
if (!this.bDynamic) {
if (this.oBatchCall != null) {
this.oBatchCall.close();
this.oBatchCall = null;
}
this.oBatchCall = this.oBatchCon.prepareCall(sParam);
bCreateCoonectionError = false;
} else {
if (this.oDynamicBatchCall != null) {
this.oDynamicBatchCall.close();
this.oDynamicBatchCall = null;
}
this.oDynamicBatchCall = this.oBatchCon.prepareStatement(sParam);
bCreateCoonectionError = false;
}
} catch (SQLException oExc) {
System.out.println(oExc.getMessage());
throw new EnrgiseSystemException(oExc);
} finally {
try {
if (this.oBatchCon != null && bCreateCoonectionError) {
if (!this.oBatchCon.isClosed())
this.oBatchCon.close();
this.oBatchCon = null;
}
} catch (SQLException sQLException) {}
}
}
public void addToBatch(ArrayList oParameters) throws EnrgiseSystemException {
if (!this.bDynamic) {
addToProcBatch(oParameters);
} else {
addToDynamicBatch(oParameters);
}
}
private void addToDynamicBatch(ArrayList oParameters) throws EnrgiseSystemException {
try {
Iterator oIter = oParameters.iterator();
while (oIter.hasNext()) {
InputDBObject oObject = oIter.next();
inspectExecuteParameter(oObject, this.oDynamicBatchCall);
}
this.oBatchCall.addBatch();
} catch (SQLException oSqlEx) {
System.out.println(oSqlEx.getMessage());
throw new EnrgiseSystemException(oSqlEx);
} finally {
try {
if (this.oBatchCon != null) {
if (!this.oBatchCon.isClosed())
this.oBatchCon.close();
this.oBatchCon = null;
}
} catch (SQLException sQLException) {}
}
}
private void addToProcBatch(ArrayList oParameters) throws EnrgiseSystemException {
try {
Iterator oIter = oParameters.iterator();
while (oIter.hasNext()) {
DBObject oObject = oIter.next();
inspectParameter(oObject, this.oBatchCall);
}
this.oBatchCall.addBatch();
} catch (SQLException oSqlEx) {
oSqlEx.printStackTrace();
System.out.println(oSqlEx.getMessage());
try {
if (this.oBatchCon != null)
if (!this.oBatchCon.isClosed())
this.oBatchCon.close();
this.oBatchCon = null;
} catch (SQLException sQLException) {}
throw new EnrgiseSystemException(oSqlEx);
}
}
public void executeBatch() throws EnrgiseSystemException {
try {
if (!this.bDynamic) {
this.oBatchCall.executeBatch();
} else {
this.oDynamicBatchCall.executeBatch();
}
} catch (BatchUpdateException oBatchEx) {
System.out.println("Batch Update Failed");
System.out.println(String.valueOf(String.valueOf(String.valueOf(String.valueOf(String.valueOf(String.valueOf(String.valueOf(String.valueOf(String.valueOf("Casue ").concat(String.valueOf(oBatchEx.getCause()))).concat(String.valueOf(" Message "))).concat(String.valueOf(oBatchEx.getMessage()))).concat(String.valueOf(" SQL State "))).concat(String.valueOf(oBatchEx.getSQLState()))).concat(String.valueOf(" Update Count "))).concat(String.valueOf(oBatchEx.getUpdateCounts()))).concat(String.valueOf(" SQL Trace "))).concat(String.valueOf(oBatchEx.getStackTrace())));
throw new EnrgiseSystemException(oBatchEx);
} catch (SQLException oSqlEx) {
System.out.println(String.valueOf("dbutilities").concat(String.valueOf(oSqlEx.getMessage())));
oSqlEx.printStackTrace();
throw new EnrgiseSystemException(oSqlEx);
} finally {
try {
if (this.oBatchCon != null)
if (!this.oBatchCon.isClosed())
this.oBatchCon.close();
} catch (SQLException sQLException) {}
}
}
public int executeUpsert(ArrayList oParameters, String sQuery) throws EnrgiseSystemException {
int iCount = 0;
try {
this.oDataSource = (DataSource)ServiceLocator.getLocator().getLocalService(this.sDbName);
if (this.oPreUpsert != null)
this.oPreUpsert.close();
if (this.oPreUpsertCon != null) {
this.oPreUpsertCon.close();
this.oPreUpsertCon = null;
}
this.oPreUpsertCon = this.oDataSource.getConnection();
this.oPreUpsert = this.oPreUpsertCon.prepareStatement(sQuery);
Iterator oIter = oParameters.iterator();
while (oIter.hasNext()) {
InputDBObject oObject = oIter.next();
inspectExecuteParameter(oObject, this.oPreUpsert);
}
iCount = this.oPreUpsert.executeUpdate();
while (true);
} catch (Exception oExc) {
System.out.println(oExc.getMessage());
oExc.printStackTrace();
throw new EnrgiseSystemException(oExc);
} finally {
try {
if (this.oPreUpsertCon != null) {
if (!this.oPreUpsertCon.isClosed())
this.oPreUpsertCon.close();
this.oPreUpsertCon = null;
}
} catch (SQLException oSqlEx) {
System.out.println(oSqlEx.getMessage());
throw new EnrgiseSystemException(oSqlEx);
}
return iCount;
}
}
public ArrayList executeQuery(ArrayList oParameters, String sQuery) throws EnrgiseSystemException {
ResultSet oRs = null;
ArrayList oResult = null;
try {
this.oDataSource = (DataSource)ServiceLocator.getLocator().getLocalService(this.sDbName);
if (oRs != null) {
oRs.close();
oRs = null;
}
if (this.oPreParameter != null)
this.oPreParameter.close();
if (this.oPreParameterCon != null) {
this.oPreParameterCon.close();
this.oPreParameterCon = null;
}
this.oPreParameterCon = this.oDataSource.getConnection();
this.oPreParameter = this.oPreParameterCon.prepareStatement(sQuery);
Iterator oIter = oParameters.iterator();
while (oIter.hasNext()) {
InputDBObject oObject = oIter.next();
inspectExecuteParameter(oObject, this.oPreParameter);
}
oRs = this.oPreParameter.executeQuery();
if (oRs == null)
throw new EnrgiseSystemException();
oResult = convertToList(oRs);
while (true);
} catch (Exception oExc) {
System.out.println(oExc.getMessage());
oExc.printStackTrace();
throw new EnrgiseSystemException(oExc);
} finally {
try {
if (this.oPreParameterCon != null)
if (this.oPreParameterCon.isClosed())
this.oPreParameterCon.close();
} catch (SQLException oSqlEx) {
System.out.println(oSqlEx.getMessage());
throw new EnrgiseSystemException(oSqlEx);
}
return oResult;
}
}
public ArrayList callProc(ArrayList oParameters, String sProcName) throws EnrgiseSystemException {
CallableStatement oCall = null;
if (this.oOutParameters == null) {
this.oOutParameters = new ArrayList();
} else {
this.oOutParameters.clear();
}
try {
Object datasourceObj = null;
datasourceObj = ServiceLocator.getLocator().getLocalService(this.sDbName);
this.oDataSource = (DataSource)datasourceObj;
Object conObj = this.oDataSource.getConnection();
this.oCon = (Connection)conObj;
if (oCall != null)
oCall.close();
String sParam = String.valueOf(String.valueOf("{ call ").concat(String.valueOf(sProcName))).concat(String.valueOf("}"));
Object callObj = this.oCon.prepareCall(sParam);
oCall = (CallableStatement)callObj;
Iterator oIter = oParameters.iterator();
while (oIter.hasNext()) {
DBObject oObject = oIter.next();
inspectParameter(oObject, oCall);
}
oCall.execute();
Iterator oOutIter = this.oOutParameters.iterator();
while (oOutIter.hasNext())
getOutParameters(oOutIter.next(), oCall);
if (this.oOutParameters.size() >= 3) {
DBObject oErrLog = this.oOutParameters.get(this.oOutParameters.size() - 3);
String sErrorLog = (String)oErrLog.getObject();
DBObject oErrMessage = this.oOutParameters.get(this.oOutParameters.size() - 2);
String sErrorMessage = (String)oErrLog.getObject();
DBObject oErr = this.oOutParameters.get(this.oOutParameters.size() - 1);
Integer oErrorCode = (Integer)oErr.getObject();
if (null != oErrorCode && !oErrorCode.equals(new Integer(0))) {
System.out.println(String.valueOf("Error calling procedure ").concat(String.valueOf(sProcName)));
if (null != sErrorLog)
System.out.println(String.valueOf("Error Log ").concat(String.valueOf(sErrorLog)));
if (null != sErrorMessage)
System.out.println(String.valueOf("Error Message ").concat(String.valueOf(sErrorMessage)));
throw new EnrgiseSystemException();
}
}
return this.oOutParameters;
} catch (Exception oExc) {
System.out.println(oExc.getMessage());
oExc.printStackTrace();
throw new EnrgiseSystemException(oExc);
} finally {
try {
if (this.oCon != null) {
if (!this.oCon.isClosed())
this.oCon.close();
this.oCon = null;
}
} catch (Exception exception) {}
}
}
public ArrayList executeQuery(String sQuery) throws EnrgiseSystemException {
PreparedStatement oPre = null;
ArrayList oResult = null;
try {
this.oDataSource = (DataSource)ServiceLocator.getLocator().getLocalService(this.sDbName);
if (this.oRs != null) {
this.oRs.close();
this.oRs = null;
}
if (oPre != null)
oPre.close();
if (this.oConn != null) {
this.oConn.close();
this.oConn = null;
}
this.oConn = this.oDataSource.getConnection();
oPre = this.oConn.prepareStatement(sQuery);
this.oRs = oPre.executeQuery();
oResult = convertToList(this.oRs);
while (true);
} catch (SQLException oExc) {
System.out.println(String.valueOf(String.valueOf(String.valueOf("From DBUtility ").concat(String.valueOf(oExc.getClass().getName()))).concat(String.valueOf(" "))).concat(String.valueOf(oExc.getMessage())));
throw new EnrgiseSystemException(oExc);
} finally {
try {
if (this.oConn != null)
if (!this.oConn.isClosed())
this.oConn.close();
} catch (SQLException oSqEx) {
throw new EnrgiseSystemException(oSqEx);
}
return oResult;
}
}
public int executeUpsert(String sQuery) throws EnrgiseSystemException {
PreparedStatement oPre = null;
Connection oPreCon = null;
int iCount = 0;
try {
this.oDataSource = (DataSource)ServiceLocator.getLocator().getLocalService(this.sDbName);
if (oPre != null)
oPre.close();
oPreCon = this.oDataSource.getConnection();
oPre = oPreCon.prepareStatement(sQuery);
iCount = oPre.executeUpdate();
while (true);
} catch (SQLException oExc) {
System.out.println(String.valueOf(String.valueOf(String.valueOf("From DBUtility ").concat(String.valueOf(oExc.getClass().getName()))).concat(String.valueOf(" "))).concat(String.valueOf(oExc.getMessage())));
throw new EnrgiseSystemException(oExc);
} finally {
try {
if (oPreCon != null)
if (!oPreCon.isClosed())
oPreCon.close();
} catch (SQLException oSqEx) {
throw new EnrgiseSystemException(oSqEx);
}
return iCount;
}
}
private void inspectParameter(DBObject oDBObject, CallableStatement oCall) throws SQLException {
int iPosition = oDBObject.getPosition();
int iDirection = oDBObject.getDirection();
int iDataType = oDBObject.getDataType();
if (iDirection == 1 || iDirection == 3) {
Object oObject = oDBObject.getObject();
switch (iDataType) {
case 12:
if (oObject != null) {
oCall.setString(iPosition, oObject.toString());
break;
}
oCall.setString(iPosition, (String)null);
break;
case 4:
if (oObject != null) {
oCall.setInt(iPosition, Integer.parseInt(oObject.toString()));
break;
}
oCall.setInt(iPosition, 0);
break;
case 8:
if (oObject != null) {
oCall.setDouble(iPosition, Double.parseDouble(oObject.toString()));
break;
}
oCall.setDouble(iPosition, 0.0D);
break;
case -5:
if (oObject != null) {
oCall.setLong(iPosition, ((Long)oObject).longValue());
break;
}
oCall.setLong(iPosition, 0L);
break;
case 91:
if (oObject != null) {
oCall.setDate(iPosition, (Date)oObject);
break;
}
oCall.setDate(iPosition, (Date)null);
break;
case 93:
if (oObject != null) {
oCall.setTimestamp(iPosition, (Timestamp)oObject);
break;
}
oCall.setTimestamp(iPosition, (Timestamp)null);
break;
case 2000:
if (oObject != null) {
oCall.setObject(iPosition, oObject);
break;
}
oCall.setObject(iPosition, (Object)null);
break;
}
}
if (iDirection == 2 || iDirection == 3) {
oCall.registerOutParameter(iPosition, iDataType);
this.oOutParameters.add(new DBObject(iPosition, iDataType));
}
}
private void inspectExecuteParameter(InputDBObject oDBObject, PreparedStatement oCall) throws SQLException {
int iPosition = oDBObject.getPosition();
int iDataType = oDBObject.getDataType();
Object oObject = oDBObject.getObject();
switch (iDataType) {
case 12:
if (oObject != null) {
oCall.setString(iPosition, oObject.toString());
break;
}
oCall.setString(iPosition, (String)null);
break;
case 1:
if (oObject != null) {
oCall.setString(iPosition, oObject.toString());
break;
}
oCall.setString(iPosition, (String)null);
break;
case 4:
if (oObject != null) {
oCall.setInt(iPosition, Integer.parseInt(oObject.toString()));
break;
}
oCall.setInt(iPosition, 0);
break;
case 8:
if (oObject != null) {
oCall.setDouble(iPosition, Double.parseDouble(oObject.toString()));
break;
}
oCall.setDouble(iPosition, 0.0D);
break;
case -5:
if (oObject != null) {
oCall.setLong(iPosition, ((Long)oObject).longValue());
break;
}
oCall.setLong(iPosition, 0L);
break;
case 91:
if (oObject != null) {
oCall.setDate(iPosition, (Date)oObject);
break;
}
oCall.setDate(iPosition, (Date)null);
break;
case 93:
if (oObject != null) {
oCall.setTimestamp(iPosition, (Timestamp)oObject);
break;
}
oCall.setTimestamp(iPosition, (Timestamp)null);
break;
case 2000:
oCall.setObject(iPosition, oObject);
break;
}
}
private void getOutParameters(DBObject oOutDBObject, CallableStatement oCall) throws SQLException {
int iPosition = oOutDBObject.getPosition();
int iDataType = oOutDBObject.getDataType();
switch (iDataType) {
case 12:
oOutDBObject.setObject(oCall.getString(iPosition));
break;
case 1:
oOutDBObject.setObject(oCall.getString(iPosition));
break;
case 4:
oOutDBObject.setObject(new Integer(oCall.getInt(iPosition)));
break;
case -5:
oOutDBObject.setObject(new Long(oCall.getLong(iPosition)));
break;
case 8:
oOutDBObject.setObject(new Double(oCall.getDouble(iPosition)));
break;
case 91:
oOutDBObject.setObject(oCall.getDate(iPosition));
break;
case 93:
oOutDBObject.setObject(oCall.getTimestamp(iPosition));
break;
case 2000:
oOutDBObject.setObject(oCall.getObject(iPosition));
break;
case -10:
oOutDBObject.setObject(convertToList((ResultSet)oCall.getObject(iPosition)));
break;
}
}
private ArrayList convertToList(ResultSet oRs2) throws SQLException {
if (null == oRs2)
return null;
ResultSetMetaData oRsMt = oRs2.getMetaData();
int iColumnCount = oRsMt.getColumnCount();
int iIndex = 0;
ArrayList oList = new ArrayList();
String[] sColumnName = new String[iColumnCount];
int[] iColumnType = new int[iColumnCount];
for (iIndex = 0; iIndex < iColumnCount; iIndex++) {
sColumnName[iIndex] = oRsMt.getColumnName(iIndex + 1);
iColumnType[iIndex] = oRsMt.getColumnType(iIndex + 1);
}
while (oRs2.next()) {
QueryRow oRow = new QueryRow(iColumnCount);
for (iIndex = 0; iIndex < iColumnCount; iIndex++) {
QueryValue oValue = new QueryValue();
setValue(sColumnName[iIndex], iColumnType[iIndex], oValue, oRs2);
oRow.getRow().put(sColumnName[iIndex].toUpperCase(), oValue);
}
oList.add(oRow);
}
oRs2.close();
oRs2 = null;
return oList;
}
private void setValue(String sColumnName, int iColumnType, QueryValue oValue, ResultSet oRs2) throws SQLException {
switch (iColumnType) {
case 2:
oValue.setString(oRs2.getString(sColumnName));
break;
case 12:
oValue.setString(oRs2.getString(sColumnName));
break;
case 1:
oValue.setString(oRs2.getString(sColumnName));
break;
case 4:
oValue.setInt(oRs2.getInt(sColumnName));
break;
case -5:
oValue.setLong(oRs2.getLong(sColumnName));
break;
case 8:
oValue.setDouble(oRs2.getDouble(sColumnName));
break;
case 91:
oValue.setDate(oRs2.getDate(sColumnName));
break;
case 93:
oValue.setTimestamp(oRs2.getTimestamp(sColumnName));
break;
case 2004:
oValue.setBlob(oRs2.getBlob(sColumnName));
break;
case 2005:
oValue.setClob(oRs2.getClob(sColumnName));
break;
}
}
protected void finalize() {
try {
close();
} catch (SQLException sQLException) {}
}
private void close() throws SQLException {
if (this.oCon != null) {
if (!this.oCon.isClosed())
this.oCon.close();
this.oCon = null;
}
if (this.oConn != null) {
if (!this.oConn.isClosed())
this.oConn.close();
this.oConn = null;
}
}
}

View File

@@ -0,0 +1,39 @@
package WEB-INF.classes.wenrgise.ejb.common.utility;
import java.util.logging.Logger;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.BodyTagSupport;
import org.apache.struts.util.RequestUtils;
import org.apache.struts.util.ResponseUtils;
import wenrgise.common.utility.UserInfo;
import wenrgise.ejb.common.utility.ParamUtil;
public class EnrgiseDisplayUserTag extends BodyTagSupport {
public static Logger log = Logger.getLogger("wenrgise.common.taglib.enrgise.EnrgiseDisplayUserTag");
public int doStartTag() throws JspException {
try {
String sessionBeanName = ParamUtil.getSessionBeanName();
UserInfo oUserInfo = (UserInfo)RequestUtils.lookup(this.pageContext, sessionBeanName, "userInfo", "session");
if (null != oUserInfo) {
String sEmp = RequestUtils.message(this.pageContext, null, "org.apache.struts.action.LOCALE", "wenrgise.common.user.name", null);
StringBuffer sbOutString = new StringBuffer(sEmp);
sbOutString.append(oUserInfo.getUserName());
sbOutString.append("(");
sbOutString.append(oUserInfo.getUserId());
sbOutString.append(")");
sbOutString.append(" ");
String sSite = RequestUtils.message(this.pageContext, null, "org.apache.struts.action.LOCALE", "wenrgise.common.site.name", null);
sbOutString.append(sSite);
sbOutString.append(oUserInfo.getSiteName());
sbOutString.append("(");
sbOutString.append(oUserInfo.getSiteCode());
sbOutString.append(")");
ResponseUtils.write(this.pageContext, sbOutString.toString());
}
} catch (Exception oEx) {
log.info(oEx.getMessage());
}
return 2;
}
}

View File

@@ -0,0 +1,54 @@
package WEB-INF.classes.wenrgise.ejb.common.utility;
import java.rmi.RemoteException;
import java.util.Locale;
import java.util.logging.Logger;
import javax.ejb.CreateException;
import javax.ejb.RemoveException;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;
import wenrgise.common.utility.UserInfo;
import wenrgise.ejb.common.session.UserSession;
import wenrgise.ejb.common.session.UserSessionHome;
import wenrgise.ejb.common.utility.ParamUtil;
import wenrgise.ejb.common.utility.ServiceLocator;
public class EnrgiseListener implements HttpSessionListener {
static final Logger log = Logger.getLogger("wenrgise.common.utility.EnrgiseListener");
public void sessionCreated(HttpSessionEvent sEvent) {
try {
System.out.println("Creating Session---->");
HttpSession session = sEvent.getSession();
UserSession oUser = (UserSession)session.getAttribute(ParamUtil.getSessionBeanName());
if (oUser == null) {
UserSessionHome oUserHome = (UserSessionHome)ServiceLocator.getLocator().getService("UserSession");
oUser = oUserHome.create();
UserInfo oUserInfo = new UserInfo();
oUser.setUserInfo(oUserInfo);
Locale oLocale = (Locale)session.getAttribute("locale");
oUser.setUserLocale((Locale)session.getAttribute("locale"));
session.setAttribute(ParamUtil.getSessionBeanName(), oUser);
}
} catch (RemoteException oRmt) {
log.severe(oRmt.getMessage());
} catch (CreateException oCrt) {
log.severe(oCrt.getMessage());
} catch (Exception oExCc) {
log.severe(oExCc.getMessage());
}
}
public void sessionDestroyed(HttpSessionEvent sEvent) {
try {
HttpSession session = sEvent.getSession();
if (session != null) {
UserSession oUser = (UserSession)session.getAttribute(ParamUtil.getSessionBeanName());
oUser.remove();
}
} catch (RemoveException removeException) {
} catch (RemoteException remoteException) {}
}
}

View File

@@ -0,0 +1,66 @@
package WEB-INF.classes.wenrgise.ejb.common.utility;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import wenrgise.common.xml.vo.DetailScreen;
import wenrgise.common.xml.vo.DetailScreens;
import wenrgise.common.xml.vo.EnrgiseApp;
import wenrgise.common.xml.vo.EnrgiseForms;
import wenrgise.common.xml.vo.HashedEnrgiseForms;
import wenrgise.common.xml.vo.SingleForm;
public class EnrgiseManager {
private static wenrgise.ejb.common.utility.EnrgiseManager me;
private HashMap oEnrgiseMap = new HashMap();
private HashMap appMap = new HashMap();
public static wenrgise.ejb.common.utility.EnrgiseManager getInstance() {
if (me == null)
me = new wenrgise.ejb.common.utility.EnrgiseManager();
return me;
}
public HashedEnrgiseForms getCachedObject(String name_) {
if (name_ == null || name_.trim().length() <= 0)
return null;
return (HashedEnrgiseForms)this.oEnrgiseMap.get(name_);
}
public void init(EnrgiseForms oEnrgiseForms) {
if (oEnrgiseForms == null)
return;
ArrayList oFormsList = oEnrgiseForms.get_SingleForm();
Iterator oIt = oFormsList.iterator();
while (oIt.hasNext()) {
SingleForm oSingleForm = oIt.next();
String sFormName = oSingleForm.get_FormName();
HashedEnrgiseForms oHashedEnrgiseForms = new HashedEnrgiseForms();
oHashedEnrgiseForms.setSingleForm(oSingleForm);
DetailScreens oDetailScreens = oSingleForm.get_DetailScreens();
ArrayList oDetailList = oDetailScreens.get_DetailScreen();
Iterator oDetailIt = oDetailList.iterator();
while (oDetailIt.hasNext()) {
DetailScreen oDetailScreen = oDetailIt.next();
String sDetailName = oDetailScreen.get_DetailScreenName();
if (!oHashedEnrgiseForms.getDetailMap().containsKey(sDetailName))
oHashedEnrgiseForms.getDetailMap().put(sDetailName, oDetailScreen);
}
if (!this.oEnrgiseMap.containsKey(sFormName))
this.oEnrgiseMap.put(sFormName, oHashedEnrgiseForms);
}
}
public void setEnrApp(EnrgiseApp oEnrApp) {
System.out.println(String.valueOf("DBname---->").concat(String.valueOf(oEnrApp.get_DBName())));
System.out.println(String.valueOf("Module---->").concat(String.valueOf(oEnrApp.get_Module())));
this.appMap.put("DBName", oEnrApp.get_DBName());
this.appMap.put("Module", oEnrApp.get_Module());
}
public HashMap getAppMap() {
return this.appMap;
}
}

View File

@@ -0,0 +1,58 @@
package WEB-INF.classes.wenrgise.ejb.common.utility;
import com.tcs.wenrgise.util.common.FWXMLUtility;
import java.util.logging.Logger;
import javax.servlet.ServletException;
import org.apache.struts.action.ActionServlet;
import org.apache.struts.action.PlugIn;
import org.apache.struts.config.ModuleConfig;
import wenrgise.common.xml.vo.EnrgiseApp;
import wenrgise.common.xml.vo.EnrgiseForms;
import wenrgise.common.xml.vo.LOVClass;
import wenrgise.ejb.common.utility.EnrgiseManager;
import wenrgise.ejb.common.utility.LOVManager;
public class EnrgisePlugIn implements PlugIn {
static final Logger log = Logger.getLogger("wenrgise.ejb.common.utility.EnrgisePlugIn");
private String formPathName = "/WEB-INF/EnrgiseConfig.xml";
private String pathName = "/WEB-INF/EnrgiseLOV.xml";
private String appPath = "/WEB-INF/EnrgiseApp.xml";
private String reportPathName = "/WEB-INF/EnrgiseReport.xml";
private String wflImplPathName = "/WEB-INF/WflDocParameters.xml";
public void init(ActionServlet servlet, ModuleConfig config) throws ServletException {
try {
System.out.println("I am in enrgise plugIn for HRMS--->");
String appPathTest = calculatePath(servlet, this.appPath);
String configPathTest = calculatePath(servlet, this.formPathName);
String lovPathTest = calculatePath(servlet, this.pathName);
EnrgiseForms oEnrgiseForms = (EnrgiseForms)FWXMLUtility.xmlToObject("wenrgise.common.xml.vo.EnrgiseForms", configPathTest);
EnrgiseManager.getInstance().init(oEnrgiseForms);
LOVClass oLOVClass = (LOVClass)FWXMLUtility.xmlToObject("wenrgise.common.xml.vo.LOVClass", lovPathTest);
LOVManager.getInstance().init(oLOVClass);
EnrgiseApp oEnrgiseApp = (EnrgiseApp)FWXMLUtility.xmlToObject("wenrgise.common.xml.vo.EnrgiseApp", appPathTest);
EnrgiseManager.getInstance().setEnrApp(oEnrgiseApp);
} catch (Exception oEx) {
log.severe(oEx.getMessage());
}
}
public void destroy() {}
private String calculatePath(ActionServlet servlet, String sPath) {
return servlet.getServletContext().getRealPath(sPath);
}
public String getFormPathName() {
return this.formPathName;
}
public void setFormPathName(String newFormPathName) {
this.formPathName = newFormPathName;
}
}

View File

@@ -0,0 +1,29 @@
package WEB-INF.classes.wenrgise.ejb.common.utility;
import java.rmi.RemoteException;
import java.util.logging.Logger;
import javax.ejb.RemoveException;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpSessionActivationListener;
import javax.servlet.http.HttpSessionEvent;
import wenrgise.ejb.common.session.UserSession;
import wenrgise.ejb.common.utility.ParamUtil;
public class EnrgiseSessionListener implements HttpSessionActivationListener {
static final Logger log = Logger.getLogger("wenrgise.common.Utility.EnrgiseSessionListener");
public void sessionDidActivate(HttpSessionEvent sessionEvent) {}
public void sessionWillPassivate(HttpSessionEvent sessionEvent) {
try {
HttpSession oS = sessionEvent.getSession();
UserSession oUser = (UserSession)oS.getAttribute(ParamUtil.getSessionBeanName());
if (oUser != null)
oUser.remove();
} catch (RemoteException oExc) {
log.severe(String.valueOf("The reason ").concat(String.valueOf(oExc.getMessage())));
} catch (RemoveException oEx) {
log.severe(String.valueOf("The reason ").concat(String.valueOf(oEx.getMessage())));
}
}
}

View File

@@ -0,0 +1,65 @@
package WEB-INF.classes.wenrgise.ejb.common.utility;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import wenrgise.common.xml.vo.LOV;
import wenrgise.common.xml.vo.LOVClass;
import wenrgise.common.xml.vo.LOVInfo;
import wenrgise.common.xml.vo.Screen;
import wenrgise.common.xml.vo.ScreenMode;
import wenrgise.common.xml.vo.ScreenModes;
import wenrgise.common.xml.vo.Screens;
public class LOVManager {
private static wenrgise.ejb.common.utility.LOVManager me;
private HashMap oMap = new HashMap();
public static wenrgise.ejb.common.utility.LOVManager getInstance() {
if (me == null)
me = new wenrgise.ejb.common.utility.LOVManager();
return me;
}
public LOVInfo getCachedObject(String name_) {
if (name_ == null || name_.trim().length() <= 0)
return null;
return (LOVInfo)this.oMap.get(name_);
}
public void init(LOVClass oLOVClass) {
if (oLOVClass == null)
return;
ArrayList oList = oLOVClass.get_LOV();
Iterator oIt = oList.iterator();
while (oIt.hasNext()) {
LOV oLOV = oIt.next();
String sLOVName = oLOV.get_LovKey();
Screens oScreens = oLOV.get_Screens();
Iterator oScreenIt = oScreens.get_Screen().iterator();
while (oScreenIt.hasNext()) {
Screen oScreen = oScreenIt.next();
String sScreenName = oScreen.get_ScreenName();
ScreenModes oScreenModes = oScreen.get_ScreenModes();
Iterator oScreenModeIt = oScreenModes.get_ScreenMode().iterator();
while (oScreenModeIt.hasNext()) {
ScreenMode oScreenMode = oScreenModeIt.next();
String sMode = oScreenMode.get_ModeName();
LOVInfo oLOVInfo = new LOVInfo();
oLOVInfo.setFacadeName(oScreenMode.get_FacadeName());
oLOVInfo.setFunctionName(oScreenMode.get_FunctionName());
oLOVInfo.setInsertFlag(oScreenMode.get_InsertFlag());
oLOVInfo.setRecursiveFlag(oScreenMode.get_RecursiveFlag());
String sCombinedKey = String.valueOf(String.valueOf(sLOVName).concat(String.valueOf(sScreenName))).concat(String.valueOf(sMode));
if (!this.oMap.containsKey(sCombinedKey))
this.oMap.put(sCombinedKey, oLOVInfo);
}
}
}
}
public static void main(String[] argv) {
wenrgise.ejb.common.utility.LOVManager oLov = new wenrgise.ejb.common.utility.LOVManager();
}
}

View File

@@ -0,0 +1,96 @@
package WEB-INF.classes.wenrgise.ejb.common.utility;
import java.util.ArrayList;
import wenrgise.common.xml.vo.DetailScreen;
import wenrgise.common.xml.vo.DetailScreens;
import wenrgise.common.xml.vo.HashedEnrgiseForms;
import wenrgise.common.xml.vo.SingleForm;
import wenrgise.ejb.common.utility.EnrgiseManager;
public class ParamUtil {
public static String getDBName() {
return (String)EnrgiseManager.getInstance().getAppMap().get("DBName");
}
public static String getModuleName() {
return (String)EnrgiseManager.getInstance().getAppMap().get("Module");
}
public static String getQueryVO(String sFormName) {
HashedEnrgiseForms oHashedEnrgiseForms = EnrgiseManager.getInstance().getCachedObject(sFormName);
return oHashedEnrgiseForms.getSingleForm().get_EnrgiseQueryVO();
}
public static String getHeaderBD(String sFormName) {
HashedEnrgiseForms oHashedEnrgiseForms = EnrgiseManager.getInstance().getCachedObject(sFormName);
return oHashedEnrgiseForms.getSingleForm().get_HeaderBD();
}
public static String getHeaderSaveRequired(String sFormName) {
HashedEnrgiseForms oHashedEnrgiseForms = EnrgiseManager.getInstance().getCachedObject(sFormName);
return oHashedEnrgiseForms.getSingleForm().get_HeaderSave();
}
public static String getPseudoHeaderFlag(String sFormName) {
HashedEnrgiseForms oHashedEnrgiseForms = EnrgiseManager.getInstance().getCachedObject(sFormName);
return oHashedEnrgiseForms.getSingleForm().get_PseudoHeader();
}
public static String getDetailBD(String sFormName, String sScreenName) {
HashedEnrgiseForms oHashedEnrgiseForms = EnrgiseManager.getInstance().getCachedObject(sFormName);
DetailScreen oDetailScreen = (DetailScreen)oHashedEnrgiseForms.getDetailMap().get(sScreenName);
return oDetailScreen.get_DetailBD();
}
public static String getDetailArrayName(String sFormName, String sScreenName) {
HashedEnrgiseForms oHashedEnrgiseForms = EnrgiseManager.getInstance().getCachedObject(sFormName);
DetailScreen oDetailScreen = (DetailScreen)oHashedEnrgiseForms.getDetailMap().get(sScreenName);
return oDetailScreen.get_DetailArrayName();
}
public static String getDetailBeanName(String sFormName, String sScreenName) {
HashedEnrgiseForms oHashedEnrgiseForms = EnrgiseManager.getInstance().getCachedObject(sFormName);
DetailScreen oDetailScreen = (DetailScreen)oHashedEnrgiseForms.getDetailMap().get(sScreenName);
return oDetailScreen.get_DetailBean();
}
public static String getSessionBeanName() {
String s = String.valueOf(getModuleName()).concat(String.valueOf("_UserSession"));
return String.valueOf(getModuleName()).concat(String.valueOf("_UserSession"));
}
public static String getHeaderBean(String sFormName) {
try {
System.out.println(String.valueOf("I am in paramUtil-->").concat(String.valueOf(sFormName)));
HashedEnrgiseForms oHashedEnrgiseForms = EnrgiseManager.getInstance().getCachedObject(sFormName);
return oHashedEnrgiseForms.getSingleForm().get_HeaderBean();
} catch (Exception ex) {
ex.printStackTrace();
return null;
}
}
public static int getHeaderSize(String sFormName) {
HashedEnrgiseForms oHashedEnrgiseForms = EnrgiseManager.getInstance().getCachedObject(sFormName);
return Integer.parseInt(oHashedEnrgiseForms.getSingleForm().get_HeaderSize());
}
public static int getDetailRecordPerPage(String sFormName, String sScreenName) {
HashedEnrgiseForms oHashedEnrgiseForms = EnrgiseManager.getInstance().getCachedObject(sFormName);
DetailScreen oDetailScreen = (DetailScreen)oHashedEnrgiseForms.getDetailMap().get(sScreenName);
return Integer.parseInt(oDetailScreen.get_DetailRecordPerPage());
}
public static int getMaxDetailPages(String sFormName, String sScreenName) {
HashedEnrgiseForms oHashedEnrgiseForms = EnrgiseManager.getInstance().getCachedObject(sFormName);
DetailScreen oDetailScreen = (DetailScreen)oHashedEnrgiseForms.getDetailMap().get(sScreenName);
return Integer.parseInt(oDetailScreen.get_DetailPagesPerSlot());
}
public static ArrayList getDetailList(String sFormName) {
HashedEnrgiseForms oHashedEnrgiseForms = EnrgiseManager.getInstance().getCachedObject(sFormName);
SingleForm oSingleForm = oHashedEnrgiseForms.getSingleForm();
DetailScreens oDetailScreens = oSingleForm.get_DetailScreens();
return oDetailScreens.get_DetailScreen();
}
}

View File

@@ -0,0 +1,92 @@
package WEB-INF.classes.wenrgise.ejb.common.utility;
import java.util.HashMap;
import javax.ejb.EJBLocalHome;
import javax.naming.Context;
import javax.naming.NamingException;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.ejb.common.utility.myContextProvider;
public class ServiceLocator {
private HashMap homeCache;
private final HashMap cacheMap = new HashMap();
private static wenrgise.ejb.common.utility.ServiceLocator serviceLocator = new wenrgise.ejb.common.utility.ServiceLocator();
private ServiceLocator() {
try {
this.homeCache = new HashMap();
} catch (Throwable e) {
e.printStackTrace();
}
}
public static wenrgise.ejb.common.utility.ServiceLocator getLocator() {
return serviceLocator;
}
public Object getService(String jndiName) throws EnrgiseSystemException {
try {
if (!this.homeCache.containsKey(jndiName.trim())) {
System.out.println("Test For Service Locator ---->");
System.out.println(String.valueOf("JNDI Name ---->").concat(String.valueOf(jndiName)));
Context context = myContextProvider.getContext();
System.out.println(String.valueOf("Context Name ---->").concat(String.valueOf(context.getNameInNamespace())));
System.out.println(String.valueOf("Context").concat(String.valueOf(context.getEnvironment())));
System.out.println("Context security java.naming.security.credentials");
System.out.println("Context url is java.naming.provider.url");
System.out.println(String.valueOf("jndiName : ").concat(String.valueOf(context.lookup(jndiName))));
this.homeCache.put(jndiName.trim(), context.lookup(jndiName.trim()));
System.out.println(String.valueOf("After JNDI Name ---->").concat(String.valueOf(jndiName)));
}
} catch (NamingException oNa) {
oNa.printStackTrace();
System.out.println(oNa.getExplanation());
throw new EnrgiseSystemException(oNa);
} catch (Exception oEx) {
oEx.printStackTrace();
throw new EnrgiseSystemException(oEx);
}
return this.homeCache.get(jndiName.trim());
}
public Object getLocalService(String jndiHomeName) throws EnrgiseSystemException {
Object obj = null;
try {
Context context = myContextProvider.getLocalContext();
if (this.cacheMap.containsKey(jndiHomeName)) {
obj = this.cacheMap.get(jndiHomeName);
} else {
obj = context.lookup(jndiHomeName);
this.cacheMap.put(jndiHomeName, obj);
}
} catch (NamingException ne) {
ne.printStackTrace();
throw new EnrgiseSystemException(ne);
}
return obj;
}
public EJBLocalHome getLocalHome(String jndiHomeName) throws EnrgiseSystemException {
System.out.println(String.valueOf("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").concat(String.valueOf(jndiHomeName)));
EJBLocalHome home = null;
try {
Context context = myContextProvider.getLocalContext();
if (this.cacheMap.containsKey(jndiHomeName)) {
home = (EJBLocalHome)this.cacheMap.get(jndiHomeName);
} else {
home = (EJBLocalHome)context.lookup(String.valueOf("java:comp/env/").concat(String.valueOf(jndiHomeName)));
this.cacheMap.put(jndiHomeName, home);
}
} catch (NamingException ne) {
System.out.println(ne);
ne.printStackTrace();
throw new EnrgiseSystemException(ne);
} catch (Exception oEx) {
oEx.printStackTrace();
throw new EnrgiseSystemException(oEx);
}
return home;
}
}

View File

@@ -0,0 +1,44 @@
package WEB-INF.classes.wenrgise.ejb.common.utility;
import java.util.Hashtable;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
public class myContextProvider {
private Context ctx = null;
public static InitialContext localContext;
static {
try {
localContext = new InitialContext();
} catch (NamingException oNx) {
oNx.printStackTrace();
}
}
private static wenrgise.ejb.common.utility.myContextProvider objContextProvider = new wenrgise.ejb.common.utility.myContextProvider();
private myContextProvider() {
try {
Hashtable env = new Hashtable();
System.out.println("Test for ContextProvider -->");
env.put("java.naming.factory.initial", "weblogic.jndi.WLInitialContextFactory");
env.put("java.naming.provider.url", "t3://weblogicServer:7001");
env.put("java.naming.security.principal", "weblogic");
env.put("java.naming.security.credentials", "weblogic");
this.ctx = new InitialContext();
} catch (Throwable e) {
e.printStackTrace();
}
}
public static Context getContext() {
return objContextProvider.ctx;
}
public static InitialContext getLocalContext() {
return localContext;
}
}

View File

@@ -0,0 +1,65 @@
package WEB-INF.classes.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;
}
}

View File

@@ -0,0 +1,11 @@
package WEB-INF.classes.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;
}

View File

@@ -0,0 +1,25 @@
package WEB-INF.classes.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);
}
}

View File

@@ -0,0 +1,10 @@
package WEB-INF.classes.wenrgise.ejb.help.facade;
import java.rmi.RemoteException;
import javax.ejb.CreateException;
import javax.ejb.EJBHome;
import wenrgise.ejb.help.facade.HelpFacade;
public interface HelpFacadeHome extends EJBHome {
HelpFacade create() throws CreateException, RemoteException;
}

View File

@@ -0,0 +1,65 @@
package WEB-INF.classes.wenrgise.help.bean;
import wenrgise.common.bean.BaseDetailBean;
public class SearchBean extends BaseDetailBean {
private String chapterId;
private String chapterName;
private String partName;
private String txtModuleName;
private String txtScreenName;
private String txtAction;
public String getChapterId() {
return this.chapterId;
}
public void setChapterId(String newChapterId) {
this.chapterId = newChapterId;
}
public String getChapterName() {
return this.chapterName;
}
public void setChapterName(String newChapterName) {
this.chapterName = newChapterName;
}
public String getPartName() {
return this.partName;
}
public void setPartName(String newPartName) {
this.partName = newPartName;
}
public String getTxtModuleName() {
return this.txtModuleName;
}
public void setTxtModuleName(String newTxtModuleName) {
this.txtModuleName = newTxtModuleName;
}
public String getTxtScreenName() {
return this.txtScreenName;
}
public void setTxtScreenName(String newTxtScreenName) {
this.txtScreenName = newTxtScreenName;
}
public String getTxtAction() {
return this.txtAction;
}
public void setTxtAction(String newTxtAction) {
this.txtAction = newTxtAction;
}
}

View File

@@ -0,0 +1,21 @@
package WEB-INF.classes.wenrgise.help.businessdelegate;
import java.util.ArrayList;
import wenrgise.common.exception.EnrgiseSystemException;
import wenrgise.ejb.common.utility.ServiceLocator;
import wenrgise.ejb.help.facade.HelpFacade;
import wenrgise.ejb.help.facade.HelpFacadeHome;
public class HelpBD {
public ArrayList getChapters(String sText, String sModuleId) throws EnrgiseSystemException {
try {
HelpFacadeHome oHome = (HelpFacadeHome)ServiceLocator.getLocator().getService("HrmHelpFacade");
HelpFacade oHelpFacade = oHome.create();
return oHelpFacade.getChapterList(sText, sModuleId);
} catch (Exception oe) {
System.out.println(String.valueOf(String.valueOf(String.valueOf("Debug For Help").concat(String.valueOf(oe.getClass().getName()))).concat(String.valueOf(" "))).concat(String.valueOf(oe.getMessage())));
oe.printStackTrace();
return new ArrayList();
}
}
}

View File

@@ -0,0 +1,226 @@
package WEB-INF.classes.wenrgise.hrms.bean;
import java.io.Serializable;
import wenrgise.common.bean.BaseHeaderBean;
public class HrmATDDeputChrgRptHdrBean extends BaseHeaderBean implements Serializable {
private String dptOrderNo;
private String empName;
private String deputationDate;
private String chargeCode;
private String handOverDate;
private String chargeType;
private String fromWorkGroupCode;
private String fromSiteCode;
private String noonFlag;
private String remarks;
private String dptOrderNoId;
private String depOrdrDtlId;
private String chargeCodeId;
private String chargeStatus;
private String fromSiteId;
private String toSiteCode;
private String toSiteId;
private String fromWrkGrpId;
private String toWorkGroupCode;
private String toWrkGrpId;
private String empId;
private String deputType;
public String getDptOrderNo() {
return this.dptOrderNo;
}
public void setDptOrderNo(String newDptOrderNo) {
this.dptOrderNo = newDptOrderNo;
}
public String getEmpName() {
return this.empName;
}
public void setEmpName(String newEmpName) {
this.empName = newEmpName;
}
public String getDeputationDate() {
return this.deputationDate;
}
public void setDeputationDate(String newDeputationDate) {
this.deputationDate = newDeputationDate;
}
public String getChargeCode() {
return this.chargeCode;
}
public void setChargeCode(String newChargeCode) {
this.chargeCode = newChargeCode;
}
public String getHandOverDate() {
return this.handOverDate;
}
public void setHandOverDate(String newHandOverDate) {
this.handOverDate = newHandOverDate;
}
public String getChargeType() {
return this.chargeType;
}
public void setChargeType(String newChargeType) {
this.chargeType = newChargeType;
}
public String getFromWorkGroupCode() {
return this.fromWorkGroupCode;
}
public void setFromWorkGroupCode(String newFromWorkGroupCode) {
this.fromWorkGroupCode = newFromWorkGroupCode;
}
public String getFromSiteCode() {
return this.fromSiteCode;
}
public void setFromSiteCode(String newFromSiteCode) {
this.fromSiteCode = newFromSiteCode;
}
public String getNoonFlag() {
return this.noonFlag;
}
public void setNoonFlag(String newNoonFlag) {
this.noonFlag = newNoonFlag;
}
public String getRemarks() {
return this.remarks;
}
public void setRemarks(String newRemarks) {
this.remarks = newRemarks;
}
public String getDptOrderNoId() {
return this.dptOrderNoId;
}
public void setDptOrderNoId(String newDptOrderNoId) {
this.dptOrderNoId = newDptOrderNoId;
}
public String getDepOrdrDtlId() {
return this.depOrdrDtlId;
}
public void setDepOrdrDtlId(String newDepOrdrDtlId) {
this.depOrdrDtlId = newDepOrdrDtlId;
}
public String getChargeCodeId() {
return this.chargeCodeId;
}
public void setChargeCodeId(String newChargeCodeId) {
this.chargeCodeId = newChargeCodeId;
}
public String getChargeStatus() {
return this.chargeStatus;
}
public void setChargeStatus(String newChargeStatus) {
this.chargeStatus = newChargeStatus;
}
public String getFromSiteId() {
return this.fromSiteId;
}
public void setFromSiteId(String newFromSiteId) {
this.fromSiteId = newFromSiteId;
}
public String getToSiteCode() {
return this.toSiteCode;
}
public void setToSiteCode(String newToSiteCode) {
this.toSiteCode = newToSiteCode;
}
public String getToSiteId() {
return this.toSiteId;
}
public void setToSiteId(String newToSiteId) {
this.toSiteId = newToSiteId;
}
public String getFromWrkGrpId() {
return this.fromWrkGrpId;
}
public void setFromWrkGrpId(String newFromWrkGrpId) {
this.fromWrkGrpId = newFromWrkGrpId;
}
public String getToWorkGroupCode() {
return this.toWorkGroupCode;
}
public void setToWorkGroupCode(String newToWorkGroupCode) {
this.toWorkGroupCode = newToWorkGroupCode;
}
public String getToWrkGrpId() {
return this.toWrkGrpId;
}
public void setToWrkGrpId(String newToWrkGrpId) {
this.toWrkGrpId = newToWrkGrpId;
}
public String getEmpId() {
return this.empId;
}
public void setEmpId(String newEmpId) {
this.empId = newEmpId;
}
public String getDeputType() {
return this.deputType;
}
public void setDeputType(String newDeputType) {
this.deputType = newDeputType;
}
}

View File

@@ -0,0 +1,6 @@
package WEB-INF.classes.wenrgise.hrms.bean;
import java.io.Serializable;
import wenrgise.common.bean.BaseDetailBean;
public class HrmATDDeputOrderSngEmpDtlBean extends BaseDetailBean implements Serializable {}

View File

@@ -0,0 +1,236 @@
package WEB-INF.classes.wenrgise.hrms.bean;
import java.io.Serializable;
import wenrgise.common.bean.BaseHeaderBean;
public class HrmATDDeputOrderSngEmpHdrBean extends BaseHeaderBean implements Serializable {
String orderNo;
String orderDate;
String deputType;
String orderStatus;
String applnNo;
String employeeName;
String applicationDate;
String toOrg;
String toPost;
String deptnEffectDate;
String reportingDate;
String remarks;
String applnNoId;
String headerPrimaryKey1;
String hdnOrderStatus;
String hdnDeputType;
private String deputStatus;
private String reptBackDate;
private String fax;
private String email;
private String phone;
private String mobilePhone;
String employeeNoId;
public String getOrderNo() {
return this.orderNo;
}
public void setOrderNo(String newOrderNo) {
this.orderNo = newOrderNo;
}
public String getOrderDate() {
return this.orderDate;
}
public void setOrderDate(String newOrderDate) {
this.orderDate = newOrderDate;
}
public String getDeputType() {
return this.deputType;
}
public void setDeputType(String newDeputType) {
this.deputType = newDeputType;
}
public String getOrderStatus() {
return this.orderStatus;
}
public void setOrderStatus(String newOrderStatus) {
this.orderStatus = newOrderStatus;
}
public String getApplnNo() {
return this.applnNo;
}
public void setApplnNo(String newApplnNo) {
this.applnNo = newApplnNo;
}
public String getEmployeeName() {
return this.employeeName;
}
public void setEmployeeName(String newEmployeeName) {
this.employeeName = newEmployeeName;
}
public String getApplicationDate() {
return this.applicationDate;
}
public void setApplicationDate(String newApplicationDate) {
this.applicationDate = newApplicationDate;
}
public String getToOrg() {
return this.toOrg;
}
public void setToOrg(String newToOrg) {
this.toOrg = newToOrg;
}
public String getToPost() {
return this.toPost;
}
public void setToPost(String newToPost) {
this.toPost = newToPost;
}
public String getDeptnEffectDate() {
return this.deptnEffectDate;
}
public void setDeptnEffectDate(String newDeptnEffectDate) {
this.deptnEffectDate = newDeptnEffectDate;
}
public String getReportingDate() {
return this.reportingDate;
}
public void setReportingDate(String newReportingDate) {
this.reportingDate = newReportingDate;
}
public String getRemarks() {
return this.remarks;
}
public void setRemarks(String newRemarks) {
this.remarks = newRemarks;
}
public String getApplnNoId() {
return this.applnNoId;
}
public void setApplnNoId(String newApplnNoId) {
this.applnNoId = newApplnNoId;
}
public String getHeaderPrimaryKey1() {
return this.headerPrimaryKey1;
}
public void setHeaderPrimaryKey1(String newHeaderPrimaryKey1) {
this.headerPrimaryKey1 = newHeaderPrimaryKey1;
}
public String getHdnOrderStatus() {
return this.hdnOrderStatus;
}
public void setHdnOrderStatus(String newHdnOrderStatus) {
this.hdnOrderStatus = newHdnOrderStatus;
}
public String getHdnDeputType() {
return this.hdnDeputType;
}
public void setHdnDeputType(String newHdnDeputType) {
this.hdnDeputType = newHdnDeputType;
}
public String getDeputStatus() {
return this.deputStatus;
}
public void setDeputStatus(String newDeputStatus) {
this.deputStatus = newDeputStatus;
}
public String getReptBackDate() {
return this.reptBackDate;
}
public void setReptBackDate(String newReptBackDate) {
this.reptBackDate = newReptBackDate;
}
public String getFax() {
return this.fax;
}
public void setFax(String newFax) {
this.fax = newFax;
}
public String getEmail() {
return this.email;
}
public void setEmail(String newEmail) {
this.email = newEmail;
}
public String getPhone() {
return this.phone;
}
public void setPhone(String newPhone) {
this.phone = newPhone;
}
public String getMobilePhone() {
return this.mobilePhone;
}
public void setMobilePhone(String newMobilePhone) {
this.mobilePhone = newMobilePhone;
}
public String getEmployeeNoId() {
return this.employeeNoId;
}
public void setEmployeeNoId(String newEmployeeNoId) {
this.employeeNoId = newEmployeeNoId;
}
}

View File

@@ -0,0 +1,316 @@
package WEB-INF.classes.wenrgise.hrms.bean;
import java.io.Serializable;
import wenrgise.common.bean.BaseHeaderBean;
public class HrmATDTransOrderForSingleEmpBean extends BaseHeaderBean implements Serializable {
private String orderNo;
private String orderDate;
private String orderStatus;
private String orderNoID;
private String orderType;
private String remarks;
private String noOfDays;
private String reportingDate;
private String trnsfrEffectDate;
private String reportingEmpId;
private String toSite;
private String fromSite;
private String applicationDate;
private String empName;
private String applnNo;
private String toSiteID;
private String empID;
private String applnNoID;
private String headerPrimaryKey1;
private String fromSiteID;
private String toDesignation;
private String reptEmpID;
private String reptEmpGrade;
private String fromDesignation;
private String approverNoId;
private String approverName;
private String selfOffice;
private String disabSelfOffice;
private String fromWorkGroup;
private String toWorkGroup;
private String toWorkGroupCode;
public String getOrderNo() {
return this.orderNo;
}
public void setOrderNo(String newOrderNo) {
this.orderNo = newOrderNo;
}
public String getOrderDate() {
return this.orderDate;
}
public void setOrderDate(String newOrderDate) {
this.orderDate = newOrderDate;
}
public String getOrderStatus() {
return this.orderStatus;
}
public void setOrderStatus(String newOrderStatus) {
this.orderStatus = newOrderStatus;
}
public String getOrderNoID() {
return this.orderNoID;
}
public void setOrderNoID(String newOrderNoID) {
this.orderNoID = newOrderNoID;
}
public String getOrderType() {
return this.orderType;
}
public void setOrderType(String newOrderType) {
this.orderType = newOrderType;
}
public String getRemarks() {
return this.remarks;
}
public void setRemarks(String newRemarks) {
this.remarks = newRemarks;
}
public String getNoOfDays() {
return this.noOfDays;
}
public void setNoOfDays(String newNoOfDays) {
this.noOfDays = newNoOfDays;
}
public String getReportingDate() {
return this.reportingDate;
}
public void setReportingDate(String newReportingDate) {
this.reportingDate = newReportingDate;
}
public String getTrnsfrEffectDate() {
return this.trnsfrEffectDate;
}
public void setTrnsfrEffectDate(String newTrnsfrEffectDate) {
this.trnsfrEffectDate = newTrnsfrEffectDate;
}
public String getReportingEmpId() {
return this.reportingEmpId;
}
public void setReportingEmpId(String newReportingEmpId) {
this.reportingEmpId = newReportingEmpId;
}
public String getToSite() {
return this.toSite;
}
public void setToSite(String newToSite) {
this.toSite = newToSite;
}
public String getFromSite() {
return this.fromSite;
}
public void setFromSite(String newFromSite) {
this.fromSite = newFromSite;
}
public String getApplicationDate() {
return this.applicationDate;
}
public void setApplicationDate(String newApplicationDate) {
this.applicationDate = newApplicationDate;
}
public String getEmpName() {
return this.empName;
}
public void setEmpName(String newEmpName) {
this.empName = newEmpName;
}
public String getApplnNo() {
return this.applnNo;
}
public void setApplnNo(String newApplnNo) {
this.applnNo = newApplnNo;
}
public String getToSiteID() {
return this.toSiteID;
}
public void setToSiteID(String newToSiteID) {
this.toSiteID = newToSiteID;
}
public String getEmpID() {
return this.empID;
}
public void setEmpID(String newEmpID) {
this.empID = newEmpID;
}
public String getApplnNoID() {
return this.applnNoID;
}
public void setApplnNoID(String newApplnNoID) {
this.applnNoID = newApplnNoID;
}
public String getHeaderPrimaryKey1() {
return this.headerPrimaryKey1;
}
public void setHeaderPrimaryKey1(String newHeaderPrimaryKey1) {
this.headerPrimaryKey1 = newHeaderPrimaryKey1;
}
public String getFromSiteID() {
return this.fromSiteID;
}
public void setFromSiteID(String newFromSiteID) {
this.fromSiteID = newFromSiteID;
}
public String getToDesignation() {
return this.toDesignation;
}
public void setToDesignation(String newToDesignation) {
this.toDesignation = newToDesignation;
}
public String getReptEmpID() {
return this.reptEmpID;
}
public void setReptEmpID(String newReptEmpID) {
this.reptEmpID = newReptEmpID;
}
public String getReptEmpGrade() {
return this.reptEmpGrade;
}
public void setReptEmpGrade(String newReptEmpGrade) {
this.reptEmpGrade = newReptEmpGrade;
}
public String getFromDesignation() {
return this.fromDesignation;
}
public void setFromDesignation(String newFromDesignation) {
this.fromDesignation = newFromDesignation;
}
public String getApproverNoId() {
return this.approverNoId;
}
public void setApproverNoId(String newApproverNoId) {
this.approverNoId = newApproverNoId;
}
public String getApproverName() {
return this.approverName;
}
public void setApproverName(String newApproverName) {
this.approverName = newApproverName;
}
public String getSelfOffice() {
return this.selfOffice;
}
public void setSelfOffice(String newSelfOffice) {
this.selfOffice = newSelfOffice;
}
public String getDisabSelfOffice() {
return this.disabSelfOffice;
}
public void setDisabSelfOffice(String newDisabSelfOffice) {
this.disabSelfOffice = newDisabSelfOffice;
}
public String getFromWorkGroup() {
return this.fromWorkGroup;
}
public void setFromWorkGroup(String newFromWorkGroup) {
this.fromWorkGroup = newFromWorkGroup;
}
public String getToWorkGroupCode() {
return this.toWorkGroupCode;
}
public void setToWorkGroupCode(String newToWorkGroupCode) {
this.toWorkGroupCode = newToWorkGroupCode;
}
public String getToWorkGroup() {
return this.toWorkGroup;
}
public void setToWorkGroup(String newToWorkGroup) {
this.toWorkGroup = newToWorkGroup;
}
}

View File

@@ -0,0 +1,266 @@
package WEB-INF.classes.wenrgise.hrms.bean;
import java.io.Serializable;
import wenrgise.common.bean.BaseHeaderBean;
public class HrmAdhocReportHdrBean extends BaseHeaderBean implements Serializable {
private String query;
private String id;
private String code;
private String query_desc;
private String category_tag;
private String param1;
private String param2;
private String param3;
private String param4;
private String param5;
private String param6;
private String param7;
private String param8;
private String param9;
private String param10;
private String paramval1;
private String paramval2;
private String paramval3;
private String paramval4;
private String paramval5;
private String paramval6;
private String paramval7;
private String paramval8;
private String paramval9;
private String paramval10;
private String resultrow;
public String getQuery() {
return this.query;
}
public void setQuery(String newQuery) {
this.query = newQuery;
}
public String getId() {
return this.id;
}
public void setId(String id) {
this.id = id;
}
public String getCode() {
return this.code;
}
public void setCode(String code) {
this.code = code;
}
public String getQuery_desc() {
return this.query_desc;
}
public void setQuery_desc(String query_desc) {
this.query_desc = query_desc;
}
public String getCategory_tag() {
return this.category_tag;
}
public void setCategory_tag(String category_tag) {
this.category_tag = category_tag;
}
public String getParam1() {
return this.param1;
}
public void setParam1(String param1) {
this.param1 = param1;
}
public String getParam2() {
return this.param2;
}
public void setParam2(String param2) {
this.param2 = param2;
}
public String getParam3() {
return this.param3;
}
public void setParam3(String param3) {
this.param3 = param3;
}
public String getParam4() {
return this.param4;
}
public void setParam4(String param4) {
this.param4 = param4;
}
public String getParam5() {
return this.param5;
}
public void setParam5(String param5) {
this.param5 = param5;
}
public String getParam6() {
return this.param6;
}
public void setParam6(String param6) {
this.param6 = param6;
}
public String getParam7() {
return this.param7;
}
public void setParam7(String param7) {
this.param7 = param7;
}
public String getParam8() {
return this.param8;
}
public void setParam8(String param8) {
this.param8 = param8;
}
public String getParam9() {
return this.param9;
}
public void setParam9(String param9) {
this.param9 = param9;
}
public String getParam10() {
return this.param10;
}
public void setParam10(String param10) {
this.param10 = param10;
}
public String getParamval1() {
return this.paramval1;
}
public void setParamval1(String paramval1) {
this.paramval1 = paramval1;
}
public String getParamval2() {
return this.paramval2;
}
public void setParamval2(String paramval2) {
this.paramval2 = paramval2;
}
public String getParamval3() {
return this.paramval3;
}
public void setParamval3(String paramval3) {
this.paramval3 = paramval3;
}
public String getParamval4() {
return this.paramval4;
}
public void setParamval4(String paramval4) {
this.paramval4 = paramval4;
}
public String getParamval5() {
return this.paramval5;
}
public void setParamval5(String paramval5) {
this.paramval5 = paramval5;
}
public String getParamval6() {
return this.paramval6;
}
public void setParamval6(String paramval6) {
this.paramval6 = paramval6;
}
public String getParamval7() {
return this.paramval7;
}
public void setParamval7(String paramval7) {
this.paramval7 = paramval7;
}
public String getParamval8() {
return this.paramval8;
}
public void setParamval8(String paramval8) {
this.paramval8 = paramval8;
}
public String getParamval9() {
return this.paramval9;
}
public void setParamval9(String paramval9) {
this.paramval9 = paramval9;
}
public String getParamval10() {
return this.paramval10;
}
public void setParamval10(String paramval10) {
this.paramval10 = paramval10;
}
public String getResultrow() {
return this.resultrow;
}
public void setResultrow(String resultrow) {
this.resultrow = resultrow;
}
}

View File

@@ -0,0 +1,246 @@
package WEB-INF.classes.wenrgise.hrms.bean;
import java.io.Serializable;
import wenrgise.common.bean.BaseHeaderBean;
public class HrmAdvSettleHdrBean extends BaseHeaderBean implements Serializable {
private String employeeNumber;
private String employeeName;
private String firstName;
private String middleName;
private String lastName;
private String designation;
private String advanceCode;
private String dateApplied;
private String fromDate;
private String toDate;
private String amountApplied;
private String settleAmount;
private String noOfIns;
private String reason;
private String employeeId;
String advanceCodeId;
private String grade;
private String location;
private String balance;
private String recoveredAmount;
private String paidInstallments;
private String sanctionedDate;
private String sanctionedAmount;
private String settleId;
public String getEmployeeNumber() {
return this.employeeNumber;
}
public void setEmployeeNumber(String newEmployeeNumber) {
this.employeeNumber = newEmployeeNumber;
}
public String getEmployeeName() {
return this.employeeName;
}
public void setEmployeeName(String newEmployeeName) {
this.employeeName = newEmployeeName;
}
public String getFirstName() {
return this.firstName;
}
public void setFirstName(String newFirstName) {
this.firstName = newFirstName;
}
public String getMiddleName() {
return this.middleName;
}
public void setMiddleName(String newMiddleName) {
this.middleName = newMiddleName;
}
public String getLastName() {
return this.lastName;
}
public void setLastName(String newLastName) {
this.lastName = newLastName;
}
public String getDesignation() {
return this.designation;
}
public void setDesignation(String newDesignation) {
this.designation = newDesignation;
}
public String getAdvanceCode() {
return this.advanceCode;
}
public void setAdvanceCode(String newAdvanceCode) {
this.advanceCode = newAdvanceCode;
}
public String getDateApplied() {
return this.dateApplied;
}
public void setDateApplied(String newDateApplied) {
this.dateApplied = newDateApplied;
}
public String getFromDate() {
return this.fromDate;
}
public void setFromDate(String newFromDate) {
this.fromDate = newFromDate;
}
public String getToDate() {
return this.toDate;
}
public void setToDate(String newToDate) {
this.toDate = newToDate;
}
public String getAmountApplied() {
return this.amountApplied;
}
public void setAmountApplied(String newAmountApplied) {
this.amountApplied = newAmountApplied;
}
public String getSettleAmount() {
return this.settleAmount;
}
public void setSettleAmount(String newSettleAmount) {
this.settleAmount = newSettleAmount;
}
public String getNoOfIns() {
return this.noOfIns;
}
public void setNoOfIns(String newNoOfIns) {
this.noOfIns = newNoOfIns;
}
public String getReason() {
return this.reason;
}
public void setReason(String newReason) {
this.reason = newReason;
}
public String getEmployeeId() {
return this.employeeId;
}
public void setEmployeeId(String newEmployeeId) {
this.employeeId = newEmployeeId;
}
public String getAdvanceCodeId() {
return this.advanceCodeId;
}
public void setAdvanceCodeId(String newAdvanceCodeId) {
this.advanceCodeId = newAdvanceCodeId;
}
public String getGrade() {
return this.grade;
}
public void setGrade(String newGrade) {
this.grade = newGrade;
}
public String getLocation() {
return this.location;
}
public void setLocation(String newLocation) {
this.location = newLocation;
}
public String getBalance() {
return this.balance;
}
public void setBalance(String newBalance) {
this.balance = newBalance;
}
public String getRecoveredAmount() {
return this.recoveredAmount;
}
public void setRecoveredAmount(String newRecoveredAmount) {
this.recoveredAmount = newRecoveredAmount;
}
public String getPaidInstallments() {
return this.paidInstallments;
}
public void setPaidInstallments(String newPaidInstallments) {
this.paidInstallments = newPaidInstallments;
}
public String getSanctionedDate() {
return this.sanctionedDate;
}
public void setSanctionedDate(String newSanctionedDate) {
this.sanctionedDate = newSanctionedDate;
}
public String getSanctionedAmount() {
return this.sanctionedAmount;
}
public void setSanctionedAmount(String newSanctionedAmount) {
this.sanctionedAmount = newSanctionedAmount;
}
public String getSettleId() {
return this.settleId;
}
public void setSettleId(String newSettleId) {
this.settleId = newSettleId;
}
}

View File

@@ -0,0 +1,66 @@
package WEB-INF.classes.wenrgise.hrms.bean;
import java.io.Serializable;
import wenrgise.common.bean.BaseDetailBean;
public class HrmAdvSettleHeadsDtlBean extends BaseDetailBean implements Serializable {
private String txtHeadName;
private String txtMaxLimit;
private String txtAmount;
String txtSettleHeadId;
String txtAdvancesId;
String txtSettleStatus;
public String getTxtHeadName() {
return this.txtHeadName;
}
public void setTxtHeadName(String newTxtHeadName) {
this.txtHeadName = newTxtHeadName;
}
public String getTxtMaxLimit() {
return this.txtMaxLimit;
}
public void setTxtMaxLimit(String newTxtMaxLimit) {
this.txtMaxLimit = newTxtMaxLimit;
}
public String getTxtAmount() {
return this.txtAmount;
}
public void setTxtAmount(String newTxtAmount) {
this.txtAmount = newTxtAmount;
}
public String getTxtSettleHeadId() {
return this.txtSettleHeadId;
}
public void setTxtSettleHeadId(String newTxtSettleHeadId) {
this.txtSettleHeadId = newTxtSettleHeadId;
}
public String getTxtAdvancesId() {
return this.txtAdvancesId;
}
public void setTxtAdvancesId(String newTxtAdvancesId) {
this.txtAdvancesId = newTxtAdvancesId;
}
public String getTxtSettleStatus() {
return this.txtSettleStatus;
}
public void setTxtSettleStatus(String newTxtSettleStatus) {
this.txtSettleStatus = newTxtSettleStatus;
}
}

View File

@@ -0,0 +1,36 @@
package WEB-INF.classes.wenrgise.hrms.bean;
import java.io.Serializable;
import wenrgise.common.bean.BaseHeaderBean;
public class HrmAdvSettleHeadsHdrBean extends BaseHeaderBean implements Serializable {
private String advanceDescription;
String settleId;
String advanceCodeId;
public String getAdvanceDescription() {
return this.advanceDescription;
}
public void setAdvanceDescription(String newAdvanceDescription) {
this.advanceDescription = newAdvanceDescription;
}
public String getSettleId() {
return this.settleId;
}
public void setSettleId(String newSettleId) {
this.settleId = newSettleId;
}
public String getAdvanceCodeId() {
return this.advanceCodeId;
}
public void setAdvanceCodeId(String newAdvanceCodeId) {
this.advanceCodeId = newAdvanceCodeId;
}
}

View File

@@ -0,0 +1,146 @@
package WEB-INF.classes.wenrgise.hrms.bean;
import java.io.Serializable;
import wenrgise.common.bean.BaseDetailBean;
public class HrmAdvanceMstDtlBean extends BaseDetailBean implements Serializable {
private String txtAdvanceDescription;
private String txtEffectiveFromDate;
private String txtEffectiveToDate;
private String txtMaxCalLimit;
private String txtNoOfTXN;
private String txtMaxLimitPerTXN;
private String txtFlatAmount;
private String txtSettlementUnit;
private String txtSettlementPeriod;
private String txtMoratoriumInMonths;
private String txtSettleThroughPayroll;
private String txtApplicableToAll;
private String txtNoOfMonSal;
private String txtEligibilityFactor;
public String getTxtAdvanceDescription() {
return this.txtAdvanceDescription;
}
public void setTxtAdvanceDescription(String newTxtAdvanceDescription) {
this.txtAdvanceDescription = newTxtAdvanceDescription;
}
public String getTxtEffectiveFromDate() {
return this.txtEffectiveFromDate;
}
public void setTxtEffectiveFromDate(String newTxtEffectiveFromDate) {
this.txtEffectiveFromDate = newTxtEffectiveFromDate;
}
public String getTxtEffectiveToDate() {
return this.txtEffectiveToDate;
}
public void setTxtEffectiveToDate(String newTxtEffectiveToDate) {
this.txtEffectiveToDate = newTxtEffectiveToDate;
}
public String getTxtMaxCalLimit() {
return this.txtMaxCalLimit;
}
public void setTxtMaxCalLimit(String newTxtMaxCalLimit) {
this.txtMaxCalLimit = newTxtMaxCalLimit;
}
public String getTxtNoOfTXN() {
return this.txtNoOfTXN;
}
public void setTxtNoOfTXN(String newTxtNoOfTXN) {
this.txtNoOfTXN = newTxtNoOfTXN;
}
public String getTxtMaxLimitPerTXN() {
return this.txtMaxLimitPerTXN;
}
public void setTxtMaxLimitPerTXN(String newTxtMaxLimitPerTXN) {
this.txtMaxLimitPerTXN = newTxtMaxLimitPerTXN;
}
public String getTxtFlatAmount() {
return this.txtFlatAmount;
}
public void setTxtFlatAmount(String newTxtFlatAmount) {
this.txtFlatAmount = newTxtFlatAmount;
}
public String getTxtSettlementUnit() {
return this.txtSettlementUnit;
}
public void setTxtSettlementUnit(String newTxtSettlementUnit) {
this.txtSettlementUnit = newTxtSettlementUnit;
}
public String getTxtSettlementPeriod() {
return this.txtSettlementPeriod;
}
public void setTxtSettlementPeriod(String newTxtSettlementPeriod) {
this.txtSettlementPeriod = newTxtSettlementPeriod;
}
public String getTxtMoratoriumInMonths() {
return this.txtMoratoriumInMonths;
}
public void setTxtMoratoriumInMonths(String newTxtMoratoriumInMonths) {
this.txtMoratoriumInMonths = newTxtMoratoriumInMonths;
}
public String getTxtSettleThroughPayroll() {
return this.txtSettleThroughPayroll;
}
public void setTxtSettleThroughPayroll(String newTxtSettleThroughPayroll) {
this.txtSettleThroughPayroll = newTxtSettleThroughPayroll;
}
public String getTxtApplicableToAll() {
return this.txtApplicableToAll;
}
public void setTxtApplicableToAll(String newTxtApplicableToAll) {
this.txtApplicableToAll = newTxtApplicableToAll;
}
public String getTxtNoOfMonSal() {
return this.txtNoOfMonSal;
}
public void setTxtNoOfMonSal(String newTxtNoOfMonSal) {
this.txtNoOfMonSal = newTxtNoOfMonSal;
}
public String getTxtEligibilityFactor() {
return this.txtEligibilityFactor;
}
public void setTxtEligibilityFactor(String newTxtEligibilityFactor) {
this.txtEligibilityFactor = newTxtEligibilityFactor;
}
}

View File

@@ -0,0 +1,56 @@
package WEB-INF.classes.wenrgise.hrms.bean;
import java.io.Serializable;
import wenrgise.common.bean.BaseHeaderBean;
public class HrmAdvanceMstHdrBean extends BaseHeaderBean implements Serializable {
private String advanceCode;
private String advanceCodeId;
private String description;
private String calendar;
private String calendarId;
public String getAdvanceCode() {
return this.advanceCode;
}
public void setAdvanceCode(String newAdvanceCode) {
this.advanceCode = newAdvanceCode;
}
public String getDescription() {
return this.description;
}
public void setDescription(String newDescription) {
this.description = newDescription;
}
public String getCalendar() {
return this.calendar;
}
public void setCalendar(String newCalendar) {
this.calendar = newCalendar;
}
public String getCalendarId() {
return this.calendarId;
}
public void setCalendarId(String newCalendarId) {
this.calendarId = newCalendarId;
}
public String getAdvanceCodeId() {
return this.advanceCodeId;
}
public void setAdvanceCodeId(String newAdvanceCodeId) {
this.advanceCodeId = newAdvanceCodeId;
}
}

View File

@@ -0,0 +1,76 @@
package WEB-INF.classes.wenrgise.hrms.bean;
import java.io.Serializable;
import wenrgise.common.bean.BaseHeaderBean;
public class HrmAppTempHdrBean extends BaseHeaderBean implements Serializable {
private String templateName;
private String obsolete;
private String applicableToAll;
private String ratingCode;
String ratingId;
String headerFlag;
String statusOfHeader;
public String getTemplateName() {
return this.templateName;
}
public void setTemplateName(String newTemplateName) {
this.templateName = newTemplateName;
}
public String getObsolete() {
return this.obsolete;
}
public void setObsolete(String newObsolete) {
this.obsolete = newObsolete;
}
public String getApplicableToAll() {
return this.applicableToAll;
}
public void setApplicableToAll(String newApplicableToAll) {
this.applicableToAll = newApplicableToAll;
}
public String getRatingCode() {
return this.ratingCode;
}
public void setRatingCode(String newRatingCode) {
this.ratingCode = newRatingCode;
}
public String getRatingId() {
return this.ratingId;
}
public void setRatingId(String newRatingId) {
this.ratingId = newRatingId;
}
public String getHeaderFlag() {
return this.headerFlag;
}
public void setHeaderFlag(String newHeaderFlag) {
this.headerFlag = newHeaderFlag;
}
public String getStatusOfHeader() {
return this.statusOfHeader;
}
public void setStatusOfHeader(String newStatusOfHeader) {
this.statusOfHeader = newStatusOfHeader;
}
}

View File

@@ -0,0 +1,116 @@
package WEB-INF.classes.wenrgise.hrms.bean;
import java.io.Serializable;
import wenrgise.common.bean.BaseDetailBean;
public class HrmAppraisalKPADtlBean extends BaseDetailBean implements Serializable {
private String txtSrlNo;
private String txtKpaCode;
private String txtDescription;
private String mandatoryFlag;
private String txtWeightage;
private String kpaCodeId;
private String disabtxtSrlNo;
private String disabtxtKpaCode;
private String disabtxtDescription;
private String disabmandatoryFlag;
private String disabtxtWeightage;
public String getTxtSrlNo() {
return this.txtSrlNo;
}
public void setTxtSrlNo(String newTxtSrlNo) {
this.txtSrlNo = newTxtSrlNo;
}
public String getTxtKpaCode() {
return this.txtKpaCode;
}
public void setTxtKpaCode(String newTxtKpaCode) {
this.txtKpaCode = newTxtKpaCode;
}
public String getTxtDescription() {
return this.txtDescription;
}
public void setTxtDescription(String newTxtDescription) {
this.txtDescription = newTxtDescription;
}
public String getMandatoryFlag() {
return this.mandatoryFlag;
}
public void setMandatoryFlag(String newMandatoryFlag) {
this.mandatoryFlag = newMandatoryFlag;
}
public String getTxtWeightage() {
return this.txtWeightage;
}
public void setTxtWeightage(String newTxtWeightage) {
this.txtWeightage = newTxtWeightage;
}
public String getKpaCodeId() {
return this.kpaCodeId;
}
public void setKpaCodeId(String newKpaCodeId) {
this.kpaCodeId = newKpaCodeId;
}
public String getDisabtxtSrlNo() {
return this.disabtxtSrlNo;
}
public void setDisabtxtSrlNo(String newDisabtxtSrlNo) {
this.disabtxtSrlNo = newDisabtxtSrlNo;
}
public String getDisabtxtKpaCode() {
return this.disabtxtKpaCode;
}
public void setDisabtxtKpaCode(String newDisabtxtKpaCode) {
this.disabtxtKpaCode = newDisabtxtKpaCode;
}
public String getDisabtxtDescription() {
return this.disabtxtDescription;
}
public void setDisabtxtDescription(String newDisabtxtDescription) {
this.disabtxtDescription = newDisabtxtDescription;
}
public String getDisabmandatoryFlag() {
return this.disabmandatoryFlag;
}
public void setDisabmandatoryFlag(String newDisabmandatoryFlag) {
this.disabmandatoryFlag = newDisabmandatoryFlag;
}
public String getDisabtxtWeightage() {
return this.disabtxtWeightage;
}
public void setDisabtxtWeightage(String newDisabtxtWeightage) {
this.disabtxtWeightage = newDisabtxtWeightage;
}
}

View File

@@ -0,0 +1,66 @@
package WEB-INF.classes.wenrgise.hrms.bean;
import java.io.Serializable;
import wenrgise.common.bean.BaseHeaderBean;
public class HrmAppraisalKPAHdrBean extends BaseHeaderBean implements Serializable {
String description;
String kpaGroupCode;
private String kpaGrpId;
private String txtAppraiserType;
private String ratingRequired;
private String statusOfHeader;
public String getDescription() {
return this.description;
}
public void setDescription(String newDescription) {
this.description = newDescription;
}
public String getKpaGroupCode() {
return this.kpaGroupCode;
}
public void setKpaGroupCode(String newKpaGroupCode) {
this.kpaGroupCode = newKpaGroupCode;
}
public String getKpaGrpId() {
return this.kpaGrpId;
}
public void setKpaGrpId(String newKpaGrpId) {
this.kpaGrpId = newKpaGrpId;
}
public String getTxtAppraiserType() {
return this.txtAppraiserType;
}
public void setTxtAppraiserType(String newTxtAppraiserType) {
this.txtAppraiserType = newTxtAppraiserType;
}
public String getRatingRequired() {
return this.ratingRequired;
}
public void setRatingRequired(String newRatingRequired) {
this.ratingRequired = newRatingRequired;
}
public String getStatusOfHeader() {
return this.statusOfHeader;
}
public void setStatusOfHeader(String newStatusOfHeader) {
this.statusOfHeader = newStatusOfHeader;
}
}

View File

@@ -0,0 +1,26 @@
package WEB-INF.classes.wenrgise.hrms.bean;
import java.io.Serializable;
import wenrgise.common.bean.BaseDetailBean;
public class HrmAppraisalTemplateGoalDtlBean extends BaseDetailBean implements Serializable {
String txtSlNo;
String txtGoalDescription;
public String getTxtSlNo() {
return this.txtSlNo;
}
public void setTxtSlNo(String newTxtSlNo) {
this.txtSlNo = newTxtSlNo;
}
public String getTxtGoalDescription() {
return this.txtGoalDescription;
}
public void setTxtGoalDescription(String newTxtGoalDescription) {
this.txtGoalDescription = newTxtGoalDescription;
}
}

View File

@@ -0,0 +1,56 @@
package WEB-INF.classes.wenrgise.hrms.bean;
import java.io.Serializable;
import wenrgise.common.bean.BaseHeaderBean;
public class HrmAppraisalTemplateHdrBean extends BaseHeaderBean implements Serializable {
String templateName;
String obsolete;
String applicableToAll;
String ratingCode;
String headerFlag = "P";
public String getTemplateName() {
return this.templateName;
}
public void setTemplateName(String newTemplateName) {
this.templateName = newTemplateName;
}
public String getObsolete() {
return this.obsolete;
}
public void setObsolete(String newObsolete) {
this.obsolete = newObsolete;
}
public String getApplicableToAll() {
return this.applicableToAll;
}
public void setApplicableToAll(String newApplicableToAll) {
this.applicableToAll = newApplicableToAll;
}
public String getRatingCode() {
return this.ratingCode;
}
public void setRatingCode(String newRatingCode) {
this.ratingCode = newRatingCode;
}
public String getHeaderFlag() {
return this.headerFlag;
}
public void setHeaderFlag(String newHeaderFlag) {
this.headerFlag = newHeaderFlag;
}
}

View File

@@ -0,0 +1,86 @@
package WEB-INF.classes.wenrgise.hrms.bean;
import java.io.Serializable;
import wenrgise.common.bean.BaseDetailBean;
public class HrmAppraisalTemplateKpaDtlBean extends BaseDetailBean implements Serializable {
String txtKpaGroupCode;
String txtApprKpa;
String txtKpaId;
String txtWeightage;
String disabtxtKpaGroupCode;
String disabtxtApprKpa;
String disabtxtWeightage;
String disabbutKPAGroupCode;
public String getTxtKpaGroupCode() {
return this.txtKpaGroupCode;
}
public void setTxtKpaGroupCode(String newTxtKpaGroupCode) {
this.txtKpaGroupCode = newTxtKpaGroupCode;
}
public String getTxtApprKpa() {
return this.txtApprKpa;
}
public void setTxtApprKpa(String newTxtApprKpa) {
this.txtApprKpa = newTxtApprKpa;
}
public String getTxtKpaId() {
return this.txtKpaId;
}
public void setTxtKpaId(String newTxtKpaId) {
this.txtKpaId = newTxtKpaId;
}
public String getTxtWeightage() {
return this.txtWeightage;
}
public void setTxtWeightage(String newTxtWeightage) {
this.txtWeightage = newTxtWeightage;
}
public String getDisabtxtKpaGroupCode() {
return this.disabtxtKpaGroupCode;
}
public void setDisabtxtKpaGroupCode(String newDisabtxtKpaGroupCode) {
this.disabtxtKpaGroupCode = newDisabtxtKpaGroupCode;
}
public String getDisabtxtApprKpa() {
return this.disabtxtApprKpa;
}
public void setDisabtxtApprKpa(String newDisabtxtApprKpa) {
this.disabtxtApprKpa = newDisabtxtApprKpa;
}
public String getDisabtxtWeightage() {
return this.disabtxtWeightage;
}
public void setDisabtxtWeightage(String newDisabtxtWeightage) {
this.disabtxtWeightage = newDisabtxtWeightage;
}
public String getDisabbutKPAGroupCode() {
return this.disabbutKPAGroupCode;
}
public void setDisabbutKPAGroupCode(String newDisabbutKPAGroupCode) {
this.disabbutKPAGroupCode = newDisabbutKPAGroupCode;
}
}

View File

@@ -0,0 +1,166 @@
package WEB-INF.classes.wenrgise.hrms.bean;
import java.io.Serializable;
import wenrgise.common.bean.BaseDetailBean;
public class HrmAppraisalTemplateSecDtlBean extends BaseDetailBean implements Serializable {
String txtSrlNo;
String txtSectionCode;
String txtAppraiserType;
String txtTemplateRemarks;
String txtParentSection;
String txtSectionWeightage;
String txtParentSecId;
String txtRatingReqd;
String disabtxtSrlNo;
String disabtxtSectionCode;
String disabbutParentSecCode;
String disabtxtSectionWeightage;
String disabtxtAppraiserType;
String disabtxtTemplateRemarks;
String disabtxtRatingReqd;
String disabtxtParentSection;
public String getTxtSrlNo() {
return this.txtSrlNo;
}
public void setTxtSrlNo(String newTxtSrlNo) {
this.txtSrlNo = newTxtSrlNo;
}
public String getTxtSectionCode() {
return this.txtSectionCode;
}
public void setTxtSectionCode(String newTxtSectionCode) {
this.txtSectionCode = newTxtSectionCode;
}
public String getTxtAppraiserType() {
return this.txtAppraiserType;
}
public void setTxtAppraiserType(String newTxtAppraiserType) {
this.txtAppraiserType = newTxtAppraiserType;
}
public String getTxtTemplateRemarks() {
return this.txtTemplateRemarks;
}
public void setTxtTemplateRemarks(String newTxtTemplateRemarks) {
this.txtTemplateRemarks = newTxtTemplateRemarks;
}
public String getTxtParentSection() {
return this.txtParentSection;
}
public void setTxtParentSection(String newTxtParentSection) {
this.txtParentSection = newTxtParentSection;
}
public String getTxtSectionWeightage() {
return this.txtSectionWeightage;
}
public void setTxtSectionWeightage(String newTxtSectionWeightage) {
this.txtSectionWeightage = newTxtSectionWeightage;
}
public String getTxtParentSecId() {
return this.txtParentSecId;
}
public void setTxtParentSecId(String newTxtParentSecId) {
this.txtParentSecId = newTxtParentSecId;
}
public String getTxtRatingReqd() {
return this.txtRatingReqd;
}
public void setTxtRatingReqd(String newTxtRatingReqd) {
this.txtRatingReqd = newTxtRatingReqd;
}
public String getDisabtxtSrlNo() {
return this.disabtxtSrlNo;
}
public void setDisabtxtSrlNo(String newDisabtxtSrlNo) {
this.disabtxtSrlNo = newDisabtxtSrlNo;
}
public String getDisabtxtSectionCode() {
return this.disabtxtSectionCode;
}
public void setDisabtxtSectionCode(String newDisabtxtSectionCode) {
this.disabtxtSectionCode = newDisabtxtSectionCode;
}
public String getDisabbutParentSecCode() {
return this.disabbutParentSecCode;
}
public void setDisabbutParentSecCode(String newDisabbutParentSecCode) {
this.disabbutParentSecCode = newDisabbutParentSecCode;
}
public String getDisabtxtSectionWeightage() {
return this.disabtxtSectionWeightage;
}
public void setDisabtxtSectionWeightage(String newDisabtxtSectionWeightage) {
this.disabtxtSectionWeightage = newDisabtxtSectionWeightage;
}
public String getDisabtxtAppraiserType() {
return this.disabtxtAppraiserType;
}
public void setDisabtxtAppraiserType(String newDisabtxtAppraiserType) {
this.disabtxtAppraiserType = newDisabtxtAppraiserType;
}
public String getDisabtxtTemplateRemarks() {
return this.disabtxtTemplateRemarks;
}
public void setDisabtxtTemplateRemarks(String newDisabtxtTemplateRemarks) {
this.disabtxtTemplateRemarks = newDisabtxtTemplateRemarks;
}
public String getDisabtxtRatingReqd() {
return this.disabtxtRatingReqd;
}
public void setDisabtxtRatingReqd(String newDisabtxtRatingReqd) {
this.disabtxtRatingReqd = newDisabtxtRatingReqd;
}
public String getDisabtxtParentSection() {
return this.disabtxtParentSection;
}
public void setDisabtxtParentSection(String newDisabtxtParentSection) {
this.disabtxtParentSection = newDisabtxtParentSection;
}
}

View File

@@ -0,0 +1,216 @@
package WEB-INF.classes.wenrgise.hrms.bean;
import java.io.Serializable;
import wenrgise.common.bean.BaseDetailBean;
public class HrmAprslEmpDtlsBean extends BaseDetailBean implements Serializable {
private String grade;
private String designation;
private String presLoc;
private String dateofBirth;
private String joiningStaffDate;
private String joiningOfficerDate;
private String lastPromDate;
private String lastPay;
private String qual;
private String empRating1;
private String empRating2;
private String empRating3;
private String incr1;
private String incr2;
private String incr3;
private String finalRating;
private String empNo;
private String butEmpNo;
private String aprslYear;
private String employeeId;
private String detailId;
public String getGrade() {
return this.grade;
}
public void setGrade(String newGrade) {
this.grade = newGrade;
}
public String getDesignation() {
return this.designation;
}
public void setDesignation(String newDesignation) {
this.designation = newDesignation;
}
public String getPresLoc() {
return this.presLoc;
}
public void setPresLoc(String newPresLoc) {
this.presLoc = newPresLoc;
}
public String getDateofBirth() {
return this.dateofBirth;
}
public void setDateofBirth(String newDateofBirth) {
this.dateofBirth = newDateofBirth;
}
public String getJoiningStaffDate() {
return this.joiningStaffDate;
}
public void setJoiningStaffDate(String newJoiningStaffDate) {
this.joiningStaffDate = newJoiningStaffDate;
}
public String getJoiningOfficerDate() {
return this.joiningOfficerDate;
}
public void setJoiningOfficerDate(String newJoiningOfficerDate) {
this.joiningOfficerDate = newJoiningOfficerDate;
}
public String getLastPromDate() {
return this.lastPromDate;
}
public void setLastPromDate(String newLastPromDate) {
this.lastPromDate = newLastPromDate;
}
public String getLastPay() {
return this.lastPay;
}
public void setLastPay(String newLastPay) {
this.lastPay = newLastPay;
}
public String getQual() {
return this.qual;
}
public void setQual(String newQual) {
this.qual = newQual;
}
public String getEmpRating1() {
return this.empRating1;
}
public void setEmpRating1(String newEmpRating1) {
this.empRating1 = newEmpRating1;
}
public String getEmpRating2() {
return this.empRating2;
}
public void setEmpRating2(String newEmpRating2) {
this.empRating2 = newEmpRating2;
}
public String getEmpRating3() {
return this.empRating3;
}
public void setEmpRating3(String newEmpRating3) {
this.empRating3 = newEmpRating3;
}
public String getIncr1() {
return this.incr1;
}
public void setIncr1(String newIncr1) {
this.incr1 = newIncr1;
}
public String getIncr2() {
return this.incr2;
}
public void setIncr2(String newIncr2) {
this.incr2 = newIncr2;
}
public String getIncr3() {
return this.incr3;
}
public void setIncr3(String newIncr3) {
this.incr3 = newIncr3;
}
public String getFinalRating() {
return this.finalRating;
}
public void setFinalRating(String newFinalRating) {
this.finalRating = newFinalRating;
}
public String getEmpNo() {
return this.empNo;
}
public void setEmpNo(String newEmpNo) {
this.empNo = newEmpNo;
}
public String getButEmpNo() {
return this.butEmpNo;
}
public void setButEmpNo(String newButEmpNo) {
this.butEmpNo = newButEmpNo;
}
public String getAprslYear() {
return this.aprslYear;
}
public void setAprslYear(String newAprslYear) {
this.aprslYear = newAprslYear;
}
public String getEmployeeId() {
return this.employeeId;
}
public void setEmployeeId(String newEmployeeId) {
this.employeeId = newEmployeeId;
}
public String getDetailId() {
return this.detailId;
}
public void setDetailId(String newDetailId) {
this.detailId = newDetailId;
}
}

View File

@@ -0,0 +1,66 @@
package WEB-INF.classes.wenrgise.hrms.bean;
import java.io.Serializable;
import wenrgise.common.bean.BaseDetailBean;
public class HrmAprslEmployeeBean extends BaseDetailBean implements Serializable {
private String finalRatingDtl;
private String empNoDtl;
private String empNameDtl;
private String aprslYearDtl;
private String empIdDtl;
private String detailId;
public String getFinalRatingDtl() {
return this.finalRatingDtl;
}
public void setFinalRatingDtl(String newFinalRatingDtl) {
this.finalRatingDtl = newFinalRatingDtl;
}
public String getEmpNoDtl() {
return this.empNoDtl;
}
public void setEmpNoDtl(String newEmpNoDtl) {
this.empNoDtl = newEmpNoDtl;
}
public String getEmpIdDtl() {
return this.empIdDtl;
}
public void setEmpIdDtl(String newEmpIdDtl) {
this.empIdDtl = newEmpIdDtl;
}
public String getEmpNameDtl() {
return this.empNameDtl;
}
public void setEmpNameDtl(String newEmpNameDtl) {
this.empNameDtl = newEmpNameDtl;
}
public String getAprslYearDtl() {
return this.aprslYearDtl;
}
public void setAprslYearDtl(String newAprslYearDtl) {
this.aprslYearDtl = newAprslYearDtl;
}
public String getDetailId() {
return this.detailId;
}
public void setDetailId(String newDetailId) {
this.detailId = newDetailId;
}
}

View File

@@ -0,0 +1,426 @@
package WEB-INF.classes.wenrgise.hrms.bean;
import java.io.Serializable;
import wenrgise.common.bean.BaseDetailBean;
public class HrmAprslGoalsDtlBean extends BaseDetailBean implements Serializable {
String txtSection;
String txtParentSec;
String txtGoalDesc;
String txtLevelAprl0g;
String txtLevelRating0g;
String txtLevelAprl1g;
String txtLevelRating1g;
String txtLevelAprl2g;
String txtLevelRating2g;
String txtLevelAprl3g;
String txtLevelRating3g;
String txtLevelAprl4g;
String txtLevelRating4g;
String txtTmplGoalId;
String txtTmplSecId;
String txtParentSecId;
String txtEmpAprslHdrId;
String txtRatingDescG;
String txtRatingToG;
String txtRatingFromG;
String txtSecRatingReq;
String disabtxtLevelAprl0g;
String disabtxtLevelRating0g;
String disabtxtLevelAprl1g;
String disabtxtLevelRating1g;
String disabtxtLevelAprl2g;
String disabtxtLevelRating2g;
String disabtxtLevelAprl3g;
String disabtxtLevelRating3g;
String disabtxtLevelAprl4g;
String disabtxtLevelRating4g;
String disabbutRatingG0LOV;
String disabbutRatingG1LOV;
String disabbutRatingG2LOV;
String disabbutRatingG3LOV;
String disabbutRatingG4LOV;
String txtSecAprslType;
private String txtLevelAprl5g;
private String disabtxtLevelAprl5g;
private String txtLevelRating5g;
private String disabtxtLevelRating5g;
private String disabbutRatingG5LOV;
public String getTxtSection() {
return this.txtSection;
}
public void setTxtSection(String newTxtSection) {
this.txtSection = newTxtSection;
}
public String getTxtParentSec() {
return this.txtParentSec;
}
public void setTxtParentSec(String newTxtParentSec) {
this.txtParentSec = newTxtParentSec;
}
public String getTxtGoalDesc() {
return this.txtGoalDesc;
}
public void setTxtGoalDesc(String newTxtGoalDesc) {
this.txtGoalDesc = newTxtGoalDesc;
}
public String getTxtLevelAprl0g() {
return this.txtLevelAprl0g;
}
public void setTxtLevelAprl0g(String newTxtLevelAprl0g) {
this.txtLevelAprl0g = newTxtLevelAprl0g;
}
public String getTxtLevelRating0g() {
return this.txtLevelRating0g;
}
public void setTxtLevelRating0g(String newTxtLevelRating0g) {
this.txtLevelRating0g = newTxtLevelRating0g;
}
public String getTxtLevelAprl1g() {
return this.txtLevelAprl1g;
}
public void setTxtLevelAprl1g(String newTxtLevelAprl1g) {
this.txtLevelAprl1g = newTxtLevelAprl1g;
}
public String getTxtLevelRating1g() {
return this.txtLevelRating1g;
}
public void setTxtLevelRating1g(String newTxtLevelRating1g) {
this.txtLevelRating1g = newTxtLevelRating1g;
}
public String getTxtLevelAprl2g() {
return this.txtLevelAprl2g;
}
public void setTxtLevelAprl2g(String newTxtLevelAprl2g) {
this.txtLevelAprl2g = newTxtLevelAprl2g;
}
public String getTxtLevelRating2g() {
return this.txtLevelRating2g;
}
public void setTxtLevelRating2g(String newTxtLevelRating2g) {
this.txtLevelRating2g = newTxtLevelRating2g;
}
public String getTxtLevelAprl3g() {
return this.txtLevelAprl3g;
}
public void setTxtLevelAprl3g(String newTxtLevelAprl3g) {
this.txtLevelAprl3g = newTxtLevelAprl3g;
}
public String getTxtLevelRating3g() {
return this.txtLevelRating3g;
}
public void setTxtLevelRating3g(String newTxtLevelRating3g) {
this.txtLevelRating3g = newTxtLevelRating3g;
}
public String getTxtLevelAprl4g() {
return this.txtLevelAprl4g;
}
public void setTxtLevelAprl4g(String newTxtLevelAprl4g) {
this.txtLevelAprl4g = newTxtLevelAprl4g;
}
public String getTxtLevelRating4g() {
return this.txtLevelRating4g;
}
public void setTxtLevelRating4g(String newTxtLevelRating4g) {
this.txtLevelRating4g = newTxtLevelRating4g;
}
public String getTxtTmplGoalId() {
return this.txtTmplGoalId;
}
public void setTxtTmplGoalId(String newTxtTmplGoalId) {
this.txtTmplGoalId = newTxtTmplGoalId;
}
public String getTxtTmplSecId() {
return this.txtTmplSecId;
}
public void setTxtTmplSecId(String newTxtTmplSecId) {
this.txtTmplSecId = newTxtTmplSecId;
}
public String getTxtParentSecId() {
return this.txtParentSecId;
}
public void setTxtParentSecId(String newTxtParentSecId) {
this.txtParentSecId = newTxtParentSecId;
}
public String getTxtEmpAprslHdrId() {
return this.txtEmpAprslHdrId;
}
public void setTxtEmpAprslHdrId(String newTxtEmpAprslHdrId) {
this.txtEmpAprslHdrId = newTxtEmpAprslHdrId;
}
public String getTxtRatingDescG() {
return this.txtRatingDescG;
}
public void setTxtRatingDescG(String newTxtRatingDescG) {
this.txtRatingDescG = newTxtRatingDescG;
}
public String getTxtRatingToG() {
return this.txtRatingToG;
}
public void setTxtRatingToG(String newTxtRatingToG) {
this.txtRatingToG = newTxtRatingToG;
}
public String getTxtRatingFromG() {
return this.txtRatingFromG;
}
public void setTxtRatingFromG(String newTxtRatingFromG) {
this.txtRatingFromG = newTxtRatingFromG;
}
public String getTxtSecRatingReq() {
return this.txtSecRatingReq;
}
public void setTxtSecRatingReq(String newTxtSecRatingReq) {
this.txtSecRatingReq = newTxtSecRatingReq;
}
public String getDisabtxtLevelAprl0g() {
return this.disabtxtLevelAprl0g;
}
public void setDisabtxtLevelAprl0g(String newDisabtxtLevelAprl0g) {
this.disabtxtLevelAprl0g = newDisabtxtLevelAprl0g;
}
public String getDisabtxtLevelRating0g() {
return this.disabtxtLevelRating0g;
}
public void setDisabtxtLevelRating0g(String newDisabtxtLevelRating0g) {
this.disabtxtLevelRating0g = newDisabtxtLevelRating0g;
}
public String getDisabtxtLevelAprl1g() {
return this.disabtxtLevelAprl1g;
}
public void setDisabtxtLevelAprl1g(String newDisabtxtLevelAprl1g) {
this.disabtxtLevelAprl1g = newDisabtxtLevelAprl1g;
}
public String getDisabtxtLevelRating1g() {
return this.disabtxtLevelRating1g;
}
public void setDisabtxtLevelRating1g(String newDisabtxtLevelRating1g) {
this.disabtxtLevelRating1g = newDisabtxtLevelRating1g;
}
public String getDisabtxtLevelAprl2g() {
return this.disabtxtLevelAprl2g;
}
public void setDisabtxtLevelAprl2g(String newDisabtxtLevelAprl2g) {
this.disabtxtLevelAprl2g = newDisabtxtLevelAprl2g;
}
public String getDisabtxtLevelRating2g() {
return this.disabtxtLevelRating2g;
}
public void setDisabtxtLevelRating2g(String newDisabtxtLevelRating2g) {
this.disabtxtLevelRating2g = newDisabtxtLevelRating2g;
}
public String getDisabtxtLevelAprl3g() {
return this.disabtxtLevelAprl3g;
}
public void setDisabtxtLevelAprl3g(String newDisabtxtLevelAprl3g) {
this.disabtxtLevelAprl3g = newDisabtxtLevelAprl3g;
}
public String getDisabtxtLevelRating3g() {
return this.disabtxtLevelRating3g;
}
public void setDisabtxtLevelRating3g(String newDisabtxtLevelRating3g) {
this.disabtxtLevelRating3g = newDisabtxtLevelRating3g;
}
public String getDisabtxtLevelAprl4g() {
return this.disabtxtLevelAprl4g;
}
public void setDisabtxtLevelAprl4g(String newDisabtxtLevelAprl4g) {
this.disabtxtLevelAprl4g = newDisabtxtLevelAprl4g;
}
public String getDisabtxtLevelRating4g() {
return this.disabtxtLevelRating4g;
}
public void setDisabtxtLevelRating4g(String newDisabtxtLevelRating4g) {
this.disabtxtLevelRating4g = newDisabtxtLevelRating4g;
}
public String getDisabbutRatingG0LOV() {
return this.disabbutRatingG0LOV;
}
public void setDisabbutRatingG0LOV(String newDisabbutRatingG0LOV) {
this.disabbutRatingG0LOV = newDisabbutRatingG0LOV;
}
public String getDisabbutRatingG1LOV() {
return this.disabbutRatingG1LOV;
}
public void setDisabbutRatingG1LOV(String newDisabbutRatingG1LOV) {
this.disabbutRatingG1LOV = newDisabbutRatingG1LOV;
}
public String getDisabbutRatingG2LOV() {
return this.disabbutRatingG2LOV;
}
public void setDisabbutRatingG2LOV(String newDisabbutRatingG2LOV) {
this.disabbutRatingG2LOV = newDisabbutRatingG2LOV;
}
public String getDisabbutRatingG3LOV() {
return this.disabbutRatingG3LOV;
}
public void setDisabbutRatingG3LOV(String newDisabbutRatingG3LOV) {
this.disabbutRatingG3LOV = newDisabbutRatingG3LOV;
}
public String getDisabbutRatingG4LOV() {
return this.disabbutRatingG4LOV;
}
public void setDisabbutRatingG4LOV(String newDisabbutRatingG4LOV) {
this.disabbutRatingG4LOV = newDisabbutRatingG4LOV;
}
public String getTxtSecAprslType() {
return this.txtSecAprslType;
}
public void setTxtSecAprslType(String newTxtSecAprslType) {
this.txtSecAprslType = newTxtSecAprslType;
}
public String getTxtLevelAprl5g() {
return this.txtLevelAprl5g;
}
public void setTxtLevelAprl5g(String newTxtLevelAprl5g) {
this.txtLevelAprl5g = newTxtLevelAprl5g;
}
public String getDisabtxtLevelAprl5g() {
return this.disabtxtLevelAprl5g;
}
public void setDisabtxtLevelAprl5g(String newDisabtxtLevelAprl5g) {
this.disabtxtLevelAprl5g = newDisabtxtLevelAprl5g;
}
public String getTxtLevelRating5g() {
return this.txtLevelRating5g;
}
public void setTxtLevelRating5g(String newTxtLevelRating5g) {
this.txtLevelRating5g = newTxtLevelRating5g;
}
public String getDisabtxtLevelRating5g() {
return this.disabtxtLevelRating5g;
}
public void setDisabtxtLevelRating5g(String newDisabtxtLevelRating5g) {
this.disabtxtLevelRating5g = newDisabtxtLevelRating5g;
}
public String getDisabbutRatingG5LOV() {
return this.disabbutRatingG5LOV;
}
public void setDisabbutRatingG5LOV(String newDisabbutRatingG5LOV) {
this.disabbutRatingG5LOV = newDisabbutRatingG5LOV;
}
}

View File

@@ -0,0 +1,256 @@
package WEB-INF.classes.wenrgise.hrms.bean;
import java.io.Serializable;
import wenrgise.common.bean.BaseHeaderBean;
public class HrmAprslHdrBean extends BaseHeaderBean implements Serializable {
String empName;
String aprslLevel;
String aprslPeriod;
String stOrderNo;
String finalRating;
String fromDate;
String toDate;
String empNo;
String empId;
String tmplHdrId;
String spcTmplId;
String startOrderId;
String rating0;
String rating1;
String rating2;
String rating3;
String rating4;
String calFlag = "C";
String buttonName;
String appFlag;
String doneFlag;
String hidDoneFlag;
String approvalFlag;
private String rating5;
String aprslYear;
public String getEmpName() {
return this.empName;
}
public void setEmpName(String newEmpName) {
this.empName = newEmpName;
}
public String getAprslLevel() {
return this.aprslLevel;
}
public void setAprslLevel(String newAprslLevel) {
this.aprslLevel = newAprslLevel;
}
public String getAprslPeriod() {
return this.aprslPeriod;
}
public void setAprslPeriod(String newAprslPeriod) {
this.aprslPeriod = newAprslPeriod;
}
public String getStOrderNo() {
return this.stOrderNo;
}
public void setStOrderNo(String newStOrderNo) {
this.stOrderNo = newStOrderNo;
}
public String getFinalRating() {
return this.finalRating;
}
public void setFinalRating(String newFinalRating) {
this.finalRating = newFinalRating;
}
public String getFromDate() {
return this.fromDate;
}
public void setFromDate(String newFromDate) {
this.fromDate = newFromDate;
}
public String getToDate() {
return this.toDate;
}
public void setToDate(String newToDate) {
this.toDate = newToDate;
}
public String getEmpNo() {
return this.empNo;
}
public void setEmpNo(String newEmpNo) {
this.empNo = newEmpNo;
}
public String getEmpId() {
return this.empId;
}
public void setEmpId(String newEmpId) {
this.empId = newEmpId;
}
public String getTmplHdrId() {
return this.tmplHdrId;
}
public void setTmplHdrId(String newTmplHdrId) {
this.tmplHdrId = newTmplHdrId;
}
public String getSpcTmplId() {
return this.spcTmplId;
}
public void setSpcTmplId(String newSpcTmplId) {
this.spcTmplId = newSpcTmplId;
}
public String getStartOrderId() {
return this.startOrderId;
}
public void setStartOrderId(String newStartOrderId) {
this.startOrderId = newStartOrderId;
}
public String getRating0() {
return this.rating0;
}
public void setRating0(String newRating0) {
this.rating0 = newRating0;
}
public String getRating1() {
return this.rating1;
}
public void setRating1(String newRating1) {
this.rating1 = newRating1;
}
public String getRating2() {
return this.rating2;
}
public void setRating2(String newRating2) {
this.rating2 = newRating2;
}
public String getRating3() {
return this.rating3;
}
public void setRating3(String newRating3) {
this.rating3 = newRating3;
}
public String getRating4() {
return this.rating4;
}
public void setRating4(String newRating4) {
this.rating4 = newRating4;
}
public String getCalFlag() {
return this.calFlag;
}
public void setCalFlag(String newCalFlag) {
this.calFlag = newCalFlag;
}
public String getButtonName() {
return this.buttonName;
}
public void setButtonName(String newButtonName) {
this.buttonName = newButtonName;
}
public String getAppFlag() {
return this.appFlag;
}
public void setAppFlag(String newAppFlag) {
this.appFlag = newAppFlag;
}
public String getDoneFlag() {
return this.doneFlag;
}
public void setDoneFlag(String newDoneFlag) {
this.doneFlag = newDoneFlag;
}
public String getHidDoneFlag() {
return this.hidDoneFlag;
}
public void setHidDoneFlag(String newHidDoneFlag) {
this.hidDoneFlag = newHidDoneFlag;
}
public String getApprovalFlag() {
return this.approvalFlag;
}
public void setApprovalFlag(String newApprovalFlag) {
this.approvalFlag = newApprovalFlag;
}
public String getRating5() {
return this.rating5;
}
public void setRating5(String newRating5) {
this.rating5 = newRating5;
}
public String getAprslYear() {
return this.aprslYear;
}
public void setAprslYear(String newAprslYear) {
this.aprslYear = newAprslYear;
}
}

View File

@@ -0,0 +1,406 @@
package WEB-INF.classes.wenrgise.hrms.bean;
import java.io.Serializable;
import wenrgise.common.bean.BaseDetailBean;
public class HrmAprslKPADtlBean extends BaseDetailBean implements Serializable {
String txtKPACode;
String txtKPADesc;
String txtLevelAprl0;
String txtLevelRating0;
String txtLevelAprl1;
String txtLevelRating1;
String txtLevelAprl2;
String txtLevelRating2;
String txtLevelAprl3;
String txtLevelRating3;
String txtLevelAprl4;
String txtLevelRating4;
String txtTmplKPADtlId;
String txtEmpAprsKPAlHdrId;
String txtRatingFrom;
String txtRatingTo;
String txtRatingDesc;
String txtKPADtlId;
String txtKpaRatingReq;
String disabtxtLevelAprl0;
String disabtxtLevelRating0;
String disabtxtLevelAprl1;
String disabtxtLevelRating1;
String disabtxtLevelAprl2;
String disabtxtLevelRating2;
String disabtxtLevelAprl3;
String disabtxtLevelRating3;
String disabtxtLevelAprl4;
String disabtxtLevelRating4;
String disabbutRatingK0LOV;
String disabbutRatingK1LOV;
String disabbutRatingK2LOV;
String disabbutRatingK3LOV;
String disabbutRatingK4LOV;
String txtKpaAprslType;
private String txtLevelAprl5;
private String txtLevelRating5;
private String disabtxtLevelRating5;
private String disabtxtLevelAprl5;
private String disabbutRatingK5LOV;
public String getTxtKPACode() {
return this.txtKPACode;
}
public void setTxtKPACode(String newTxtKPACode) {
this.txtKPACode = newTxtKPACode;
}
public String getTxtKPADesc() {
return this.txtKPADesc;
}
public void setTxtKPADesc(String newTxtKPADesc) {
this.txtKPADesc = newTxtKPADesc;
}
public String getTxtLevelAprl0() {
return this.txtLevelAprl0;
}
public void setTxtLevelAprl0(String newTxtLevelAprl0) {
this.txtLevelAprl0 = newTxtLevelAprl0;
}
public String getTxtLevelRating0() {
return this.txtLevelRating0;
}
public void setTxtLevelRating0(String newTxtLevelRating0) {
this.txtLevelRating0 = newTxtLevelRating0;
}
public String getTxtLevelAprl1() {
return this.txtLevelAprl1;
}
public void setTxtLevelAprl1(String newTxtLevelAprl1) {
this.txtLevelAprl1 = newTxtLevelAprl1;
}
public String getTxtLevelRating1() {
return this.txtLevelRating1;
}
public void setTxtLevelRating1(String newTxtLevelRating1) {
this.txtLevelRating1 = newTxtLevelRating1;
}
public String getTxtLevelAprl2() {
return this.txtLevelAprl2;
}
public void setTxtLevelAprl2(String newTxtLevelAprl2) {
this.txtLevelAprl2 = newTxtLevelAprl2;
}
public String getTxtLevelRating2() {
return this.txtLevelRating2;
}
public void setTxtLevelRating2(String newTxtLevelRating2) {
this.txtLevelRating2 = newTxtLevelRating2;
}
public String getTxtLevelAprl3() {
return this.txtLevelAprl3;
}
public void setTxtLevelAprl3(String newTxtLevelAprl3) {
this.txtLevelAprl3 = newTxtLevelAprl3;
}
public String getTxtLevelRating3() {
return this.txtLevelRating3;
}
public void setTxtLevelRating3(String newTxtLevelRating3) {
this.txtLevelRating3 = newTxtLevelRating3;
}
public String getTxtLevelAprl4() {
return this.txtLevelAprl4;
}
public void setTxtLevelAprl4(String newTxtLevelAprl4) {
this.txtLevelAprl4 = newTxtLevelAprl4;
}
public String getTxtLevelRating4() {
return this.txtLevelRating4;
}
public void setTxtLevelRating4(String newTxtLevelRating4) {
this.txtLevelRating4 = newTxtLevelRating4;
}
public String getTxtTmplKPADtlId() {
return this.txtTmplKPADtlId;
}
public void setTxtTmplKPADtlId(String newTxtTmplKPADtlId) {
this.txtTmplKPADtlId = newTxtTmplKPADtlId;
}
public String getTxtEmpAprsKPAlHdrId() {
return this.txtEmpAprsKPAlHdrId;
}
public void setTxtEmpAprsKPAlHdrId(String newTxtEmpAprsKPAlHdrId) {
this.txtEmpAprsKPAlHdrId = newTxtEmpAprsKPAlHdrId;
}
public String getTxtRatingFrom() {
return this.txtRatingFrom;
}
public void setTxtRatingFrom(String newTxtRatingFrom) {
this.txtRatingFrom = newTxtRatingFrom;
}
public String getTxtRatingTo() {
return this.txtRatingTo;
}
public void setTxtRatingTo(String newTxtRatingTo) {
this.txtRatingTo = newTxtRatingTo;
}
public String getTxtRatingDesc() {
return this.txtRatingDesc;
}
public void setTxtRatingDesc(String newTxtRatingDesc) {
this.txtRatingDesc = newTxtRatingDesc;
}
public String getTxtKPADtlId() {
return this.txtKPADtlId;
}
public void setTxtKPADtlId(String newTxtKPADtlId) {
this.txtKPADtlId = newTxtKPADtlId;
}
public String getTxtKpaRatingReq() {
return this.txtKpaRatingReq;
}
public void setTxtKpaRatingReq(String newTxtKpaRatingReq) {
this.txtKpaRatingReq = newTxtKpaRatingReq;
}
public String getDisabtxtLevelAprl0() {
return this.disabtxtLevelAprl0;
}
public void setDisabtxtLevelAprl0(String newDisabtxtLevelAprl0) {
this.disabtxtLevelAprl0 = newDisabtxtLevelAprl0;
}
public String getDisabtxtLevelRating0() {
return this.disabtxtLevelRating0;
}
public void setDisabtxtLevelRating0(String newDisabtxtLevelRating0) {
this.disabtxtLevelRating0 = newDisabtxtLevelRating0;
}
public String getDisabtxtLevelAprl1() {
return this.disabtxtLevelAprl1;
}
public void setDisabtxtLevelAprl1(String newDisabtxtLevelAprl1) {
this.disabtxtLevelAprl1 = newDisabtxtLevelAprl1;
}
public String getDisabtxtLevelRating1() {
return this.disabtxtLevelRating1;
}
public void setDisabtxtLevelRating1(String newDisabtxtLevelRating1) {
this.disabtxtLevelRating1 = newDisabtxtLevelRating1;
}
public String getDisabtxtLevelAprl2() {
return this.disabtxtLevelAprl2;
}
public void setDisabtxtLevelAprl2(String newDisabtxtLevelAprl2) {
this.disabtxtLevelAprl2 = newDisabtxtLevelAprl2;
}
public String getDisabtxtLevelRating2() {
return this.disabtxtLevelRating2;
}
public void setDisabtxtLevelRating2(String newDisabtxtLevelRating2) {
this.disabtxtLevelRating2 = newDisabtxtLevelRating2;
}
public String getDisabtxtLevelAprl3() {
return this.disabtxtLevelAprl3;
}
public void setDisabtxtLevelAprl3(String newDisabtxtLevelAprl3) {
this.disabtxtLevelAprl3 = newDisabtxtLevelAprl3;
}
public String getDisabtxtLevelRating3() {
return this.disabtxtLevelRating3;
}
public void setDisabtxtLevelRating3(String newDisabtxtLevelRating3) {
this.disabtxtLevelRating3 = newDisabtxtLevelRating3;
}
public String getDisabtxtLevelAprl4() {
return this.disabtxtLevelAprl4;
}
public void setDisabtxtLevelAprl4(String newDisabtxtLevelAprl4) {
this.disabtxtLevelAprl4 = newDisabtxtLevelAprl4;
}
public String getDisabtxtLevelRating4() {
return this.disabtxtLevelRating4;
}
public void setDisabtxtLevelRating4(String newDisabtxtLevelRating4) {
this.disabtxtLevelRating4 = newDisabtxtLevelRating4;
}
public String getDisabbutRatingK0LOV() {
return this.disabbutRatingK0LOV;
}
public void setDisabbutRatingK0LOV(String newDisabbutRatingK0LOV) {
this.disabbutRatingK0LOV = newDisabbutRatingK0LOV;
}
public String getDisabbutRatingK1LOV() {
return this.disabbutRatingK1LOV;
}
public void setDisabbutRatingK1LOV(String newDisabbutRatingK1LOV) {
this.disabbutRatingK1LOV = newDisabbutRatingK1LOV;
}
public String getDisabbutRatingK2LOV() {
return this.disabbutRatingK2LOV;
}
public void setDisabbutRatingK2LOV(String newDisabbutRatingK2LOV) {
this.disabbutRatingK2LOV = newDisabbutRatingK2LOV;
}
public String getDisabbutRatingK3LOV() {
return this.disabbutRatingK3LOV;
}
public void setDisabbutRatingK3LOV(String newDisabbutRatingK3LOV) {
this.disabbutRatingK3LOV = newDisabbutRatingK3LOV;
}
public String getDisabbutRatingK4LOV() {
return this.disabbutRatingK4LOV;
}
public void setDisabbutRatingK4LOV(String newDisabbutRatingK4LOV) {
this.disabbutRatingK4LOV = newDisabbutRatingK4LOV;
}
public String getTxtKpaAprslType() {
return this.txtKpaAprslType;
}
public void setTxtKpaAprslType(String newTxtKpaAprslType) {
this.txtKpaAprslType = newTxtKpaAprslType;
}
public String getTxtLevelAprl5() {
return this.txtLevelAprl5;
}
public void setTxtLevelAprl5(String newTxtLevelAprl5) {
this.txtLevelAprl5 = newTxtLevelAprl5;
}
public String getTxtLevelRating5() {
return this.txtLevelRating5;
}
public void setTxtLevelRating5(String newTxtLevelRating5) {
this.txtLevelRating5 = newTxtLevelRating5;
}
public String getDisabtxtLevelRating5() {
return this.disabtxtLevelRating5;
}
public void setDisabtxtLevelRating5(String newDisabtxtLevelRating5) {
this.disabtxtLevelRating5 = newDisabtxtLevelRating5;
}
public String getDisabtxtLevelAprl5() {
return this.disabtxtLevelAprl5;
}
public void setDisabtxtLevelAprl5(String newDisabtxtLevelAprl5) {
this.disabtxtLevelAprl5 = newDisabtxtLevelAprl5;
}
public String getDisabbutRatingK5LOV() {
return this.disabbutRatingK5LOV;
}
public void setDisabbutRatingK5LOV(String newDisabbutRatingK5LOV) {
this.disabbutRatingK5LOV = newDisabbutRatingK5LOV;
}
}

Some files were not shown because too many files have changed in this diff Show More