<%@page contentType="text/html;charset=UTF-8" pageEncoding="ISO-8859-1" session="true"
%><%@page errorPage="Exception.jsp"
%><%@page import="com.fujitsu.iflow.model.workflow.WFSession"
%><%@page import="com.fujitsu.iflow.model.workflow.WFObjectFactory"
%><%@page import="com.fujitsu.iflow.model.workflow.Plan"
%><%@page import="com.fujitsu.iflow.model.workflow.ProcessInstantiator"
%><%@page import="com.fujitsu.iflow.model.workflow.WorkItem"
%><%@page import="java.util.Enumeration"
%><%@page import="com.fujitsu.iflow.model.util.URLEncoder"
%><%
    request.setCharacterEncoding("UTF-8");request.getParameterNames(); //Need dummy call for WL9.1
    WFSession wfSession = (WFSession)session.getAttribute("ModelsessionID");
    if (wfSession == null) {
        %><jsp:include page="PasswordPanel.jsp" flush="true"/><%
        return;
    }
    String[] bcolor = {"evenrow","oddrow"};
    int nextColor = 0;
    session.setAttribute("TabIndex","-1");
    String tab = "Header.jsp";
    
    String type =   request.getParameter("type");
    if(type != null)
    {
    	tab = "AdminHeader.jsp";
    }
    else
    {
    	tab = "Header.jsp";        
        type = "xpdl";
    }
%>
<html>
<head><title>Interstage Business Process Manager | Import <%=type.toUpperCase()%></title>
<jsp:include page="StyleSheet.jsp" flush="true"/>
<script language="javascript" src="styles/clockscripts.js"></script>

<script language="javascript">
function validateFields()
{
    if (document.xpdlForm.document.value == "")
    {
        alert("Please enter a valid file path.");
        document.xpdlForm.document.focus();
        return false;
    }
}
</script>

</head>
<body class="bodyClass" onLoad="goforit();">
<jsp:include page="<%= tab %>" flush="true"/>
<br/><br/>
<form name="xpdlForm" enctype="multipart/form-data" method="post" action="ImportXPDLAction.jsp?type=<%=type%>" onSubmit="return validateFields()">
<center>
<TABLE border="0" cellpadding="4" cellspacing="1" bgcolor="#CCCCCC" class="tableClass" width="450">
    <tr>
        <td style="filter:progid:DXImageTransform.Microsoft.Gradient(startColorStr='#FFFFFF', endColorStr='#6699CC', gradientType='1'"><b>Importing <%=type.toUpperCase()%> File</b></td>
    </tr>
    <tr>
            <td bgcolor="#FFFFFF" align="center"><br/> <%=type.toUpperCase()%> File:
            <input type="file" name="document" width="300"><br/><br/>
            </td>
    </tr>
    <tr>
        <td valign="middle" align="center" bgcolor="#EEEEEE">
        <input type="submit" value="Import" class="submitClass" >
        </td>
    </tr>
</table>

</center>
</form>
</body>
</html>
