Commit 499ed259 authored by ppatro's avatar ppatro

PO Wizard D14IKAT004


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@97187 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 03fc3b1a
/*
* Author:Wasim Ansari
* Date:02-FEB-15
* Request ID:D14IKAT004 (PO Wizard)
*/
package ibase.webitm.bean.wms;
import java.io.File;
import ibase.system.config.AppConnectParm;
import ibase.utility.CommonConstants;
import ibase.webitm.ejb.wms.DDPorderWizEJBRemote;
import ibase.webitm.utility.ITMException;
import javax.naming.InitialContext;
import javax.servlet.http.HttpSession;
public class PorderDetailBean
{
private ibase.utility.UserInfoBean userInfo = null;
private HttpSession sessionCtx = null;
private String objName = "";
private String user_lang ="en";
private String user_country = "US";
public String getList(String field,String extra) throws ITMException
{
String itemTypeList = "";
DDPorderWizEJBRemote ddPorderWizRemote = null;
try
{
InitialContext ctx = new InitialContext( new AppConnectParm().getProperty() );
ddPorderWizRemote = (ibase.webitm.ejb.wms.DDPorderWizEJBRemote) ctx.lookup("ibase/DDPorderWizEJB/remote");
itemTypeList = ddPorderWizRemote.getList(field,extra);
String xslFileName = getXSLFileName( "porderWiz_ItemDetails_wiz_" + this.user_lang + "_" + this.user_country + ".xsl" );
itemTypeList = (ibase.webitm.utility.GenericUtility.getInstance()).transformToString( xslFileName, itemTypeList, CommonConstants.APPLICATION_CONTEXT + File.separator + "temp", "Output", ".html" );
}
catch (Exception e)
{
throw new ITMException(e);
}
finally
{
if ( ddPorderWizRemote != null )
{
ddPorderWizRemote = null;
}
}
return itemTypeList;
}
private String getXSLFileName( String xslFileName )throws ITMException
{
String retFileName = null;
try
{
String defaultPath = null;
if( CommonConstants.APPLICATION_CONTEXT != null )
{
defaultPath = CommonConstants.APPLICATION_CONTEXT + CommonConstants.ITM_CONTEXT + File.separator;
}
else
{
defaultPath = ".." + File.separator + "webapps" + File.separator + "ibase" + File.separator + CommonConstants.ITM_CONTEXT + File.separator;
}
File xslPath = new File( defaultPath + File.separator + "xsl" + File.separator + CommonConstants.THEME + File.separator + "WIZARD");
if ( !xslPath.exists() )
{
xslPath.mkdir();
}
System.out.println( " xslPath [" + xslPath +"] xslFileName ["+xslFileName +"]");
File xslFile = new File(xslPath , xslFileName);
if( xslFile.exists() )
{
retFileName = xslFile.getAbsolutePath();
}
else
{
throw new ITMException( new Exception( retFileName + " Wizard XSL file Not Found") );
}
}
catch (Exception e)
{
throw new ITMException(e);
}
return retFileName;
}
public String nextForm( String formNo, String xmlData ) throws ITMException
{
String retHtmlData = null;
try
{
System.out.println("*******In Method : [nextForm]************");
System.out.println("xmlString : ["+ xmlData +"]");
//InitialContext ctx = new InitialContext( new AppConnectParm().getProperty() );
//DDPorderWizEJBRemote ddPorderWizRemote = null;
//ddPorderWizRemote = (ibase.webitm.ejb.wms.DDPorderWizEJBRemote) ctx.lookup("ibase/DDPorderWizEJB/remote");
//details = ddPorderWizRemote.getPorderDetails(xmlData);
String xslFileName = getXSLFileName( "porderWiz1_wiz_" + this.user_lang + "_" + this.user_country + "_" + "A" + ".xsl" );
retHtmlData = (ibase.webitm.utility.GenericUtility.getInstance()).transformToString( xslFileName, xmlData, CommonConstants.APPLICATION_CONTEXT + File.separator + "temp", "Output", ".html" );
}
catch (Exception e)
{
throw new ITMException(e);
}
finally
{
}
return retHtmlData;
}
}
This diff is collapsed.
/*
* Author:Wasim Ansari
* Date:02-FEB-15
* Request ID:D14IKAT004 (PO Wizard)
*/
package ibase.webitm.ejb.wms;
import ibase.webitm.utility.ITMException;
import javax.ejb.Local;
import java.io.IOException;
import java.rmi.RemoteException;
import java.sql.Connection;
import javax.ejb.Remote;
import org.w3c.dom.Document;
@Local
public interface DDPorderWizEJBLocal
{
public String wfValData(String xmlString, String xmlString1, String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String wfValData(Document dom, Document dom1, Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged(String xmlString, String xmlString1,String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged(Document dom, Document dom1,Document dom2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String getList(String field,String extra) throws RemoteException,ITMException;
public String getPorderDetails(Document dom1,Document dom2,String itemCode,String quantity,String dlvDate, int ctr ,Connection conn);
}
/*
* Author:Wasim Ansari
* Date:02-FEB-15
* Request ID:D14IKAT004 (PO Wizard)
*/
package ibase.webitm.ejb.wms;
import ibase.webitm.utility.ITMException;
import java.io.IOException;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.SQLException;
import javax.ejb.Remote;
import org.w3c.dom.Document;
@Remote
public interface DDPorderWizEJBRemote
{
public String wfValData(String xmlString, String xmlString1, String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String wfValData(Document dom, Document dom1, Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged(String xmlString, String xmlString1,String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged(Document dom, Document dom1,Document dom2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String getList(String field,String extra) throws RemoteException,ITMException;
public String getPorderDetails(Document dom1,Document dom2,String itemCode,String quantity, String dlvDate, int ctr ,Connection conn);
}
This diff is collapsed.
package ibase.webitm.ejb.wms;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import java.sql.Connection;
import javax.ejb.Local;
import org.w3c.dom.Document;
@Local
public interface DDPorderWizPosEJBLocal
{
public String postSave(String xmlStringAll, String dcrId, String editFlag, String xtraParams, Connection conn) throws RemoteException,ITMException;
public String updateStatus( Document dom, String editFlag, String xtraParams, Connection conn )throws RemoteException,ITMException;
}
/*
* Author:Wasim Ansari
* Date:02-FEB-15
* Request ID:D14IKAT004 (PO Wizard)
*/
package ibase.webitm.ejb.wms;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import java.sql.Connection;
import javax.ejb.Local;
import org.w3c.dom.Document;
@Local
public interface DDPorderWizPosEJBRemote
{
public String postSave(String xmlStringAll, String dcrId, String editFlag, String xtraParams, Connection conn) throws RemoteException,ITMException;
public String updateStatus( Document dom, String editFlag, String xtraParams, Connection conn )throws RemoteException,ITMException;
}
/*
* Author:Wasim Ansari
* Date:02-FEB-15
* Request ID:D14IKAT004 (PO Wizard)
*/
package ibase.webitm.servlet.wms;
import ibase.utility.CommonConstants;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mysql.jdbc.Messages;
public class PorderForm2Servlet extends HttpServlet
{
private static final long serialVersionUID = 1L;
public PorderForm2Servlet()
{
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
doPost( request, response );
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
System.out.println("XXXXXXXXXXXXXXXXXXXXXX[ Form2Servlet ]XXXXXXXXXXXXXXXXXXXX");
request.setCharacterEncoding(CommonConstants.ENCODING);
String htmlData = ""; //$NON-NLS-1$
ibase.utility.UserInfoBean userInfo = ( ibase.utility.UserInfoBean )request.getSession().getAttribute( "USER_INFO" ); //$NON-NLS-1$
if(userInfo != null)
{
String objName = request.getParameter("OBJ_NAME");//Storing ObjectName //$NON-NLS-1$
String formNo = request.getParameter("FORM_NO");//Storing Current FormNo //$NON-NLS-1$
String action = request.getParameter("action");//Which actions is performed e.g. 'Next','Previous','Finish' //$NON-NLS-1$
String formType = request.getParameter("formType");//Type of form to implement MultipleForms //$NON-NLS-1$
System.out.println("OBJ_NAME="+objName);
System.out.println("FORMNO="+formNo);
System.out.println("ACTION="+action);
System.out.println("FORMTYPE="+formType);
String PRE_FORM_VAL = request.getParameter("PRE_FORM_VAL");
System.out.println(PRE_FORM_VAL);
if ( request.getSession().getAttribute( "WIZARD_BEAN_" + objName ) != null ) //$NON-NLS-1$
{
System.out.println(" wizard object found...."); //$NON-NLS-1$
if ( "previous".equalsIgnoreCase( action ) && "2".equalsIgnoreCase( formNo ) ) //$NON-NLS-1$ //$NON-NLS-2$
{
request.getSession().removeAttribute( "WIZARD_BEAN_" + objName ); //$NON-NLS-1$
request.getRequestDispatcher("/webitm/jsp/PorderPage.jsp").forward(request, response); //$NON-NLS-1$
//response.sendRedirect("/ibase/webitm/jsp/ProdWizardPage.jsp?OBJ_NAME="+objName+"&PRE_FORM_VAL="+preFormVal);
}
}
}
else
{
htmlData = Messages.getString("ITMWizardHandlerServlet_notLoggedIn")+"\n"+Messages.getString("ITMWizardHandlerServlet_pleaseReLogin"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<%@ page import="java.io.*" %>
<%@ page import="java.util.HashMap" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.net.*" %>
<%@ page import="ibase.webitm.bean.wiz.*" %>
<%@ page import="ibase.utility.*" %>
<%@ page import="ibase.webitm.servlet.ITMWizardHandlerServlet" %>
<%@page import = "java.lang.*,java.util.*, ibase.webitm.bean.wms.PorderDetailBean"%>
<%
System.out.println("***********In Porder Page JSP********************");
String htmlData = "";
try
{
ibase.utility.UserInfoBean userInfo = ( ibase.utility.UserInfoBean )session.getAttribute( "USER_INFO" );
if( userInfo == null )
{
out.println("Your session has been expired. Please re-login.");
}
String objName = request.getParameter("OBJ_NAME");
String PRE_FORM_VAL = ( request.getParameter( "PRE_FORM_VAL" ) != null ) ? request.getParameter( "PRE_FORM_VAL" ) : "";
String formType = request.getParameter("formType");//Type of form
String editorId = request.getParameter("EDITOR_ID");
String directAcc = ( request.getParameter( "DIRECT_ACC" ) != null ) ? request.getParameter( "DIRECT_ACC" ) : "Y";
System.out.println("objName : " + objName);
ITMWizardBean itmWizardBean;
String transDB = userInfo.getTransDB();
System.out.println("TransDB E12 name is : " + transDB);
if(transDB != null && !"null".equalsIgnoreCase(transDB.trim()) && transDB.trim().length() > 0)
{
itmWizardBean = new ITMWizardBean( objName, request.getSession(), userInfo );
}
else
{
itmWizardBean = new ITMWizardBean( objName, request.getSession() );
}
request.getSession().setAttribute( "WIZARD_BEAN_" + objName, itmWizardBean );
PorderDetailBean supp = new PorderDetailBean();
htmlData = supp.nextForm("1", PRE_FORM_VAL);
}
catch(Exception e)
{
e.printStackTrace();
}
%>
<div id="detailData" style="display: ">
<%=htmlData%>
</div>
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment