<%@page contentType="text/html;charset=UTF-8" pageEncoding="ISO-8859-1" session="true"
%><%@page errorPage="Exception.jsp"
%><%@page import="com.fujitsu.iflow.model.bpm.BPMSession"
%><%@page import="com.fujitsu.iflow.model.workflow.Plan"
%><%
    request.setCharacterEncoding("UTF-8");request.getParameterNames(); //Need dummy call for WL9.1
    BPMSession bps = (BPMSession) session.getAttribute("BPMSession");
    if (bps == null) {
        %><jsp:include page="PasswordPanel.jsp" flush="true"/><%
        return;
    }
    session.setAttribute("TabIndex","2");
    String defnUri = request.getParameter("selectedPlanUri");
    if (defnUri == null) { defnUri = ""; }

    String planIdToUpload = (String)session.getAttribute("PlanIdToUpload");
    long planId = Long.parseLong(planIdToUpload);
    Plan plan = bps.getPlan(planId);

%>
<html>
<head><title>Interstage Business Process Manager | Upload</title>
<jsp:include page="StyleSheet.jsp" flush="true"/>
<script language="javascript" src="styles/clockscripts.js"></script>
</head>
<body class="bodyClass" onLoad="goforit();">
<jsp:include page="Header.jsp" flush="true"/>
<center>

<%
    String actionURL = "UploadAction.jsp";
%>
    <br/><br/>
    <form name="dnldForm"  method="get" action="<%= actionURL %>">
        <TABLE border="0" cellpadding="0" cellspacing="1" class="tableClass" width="600" align="center" bgcolor="#CCCCCC">
            <tr>
                <td>
                    <table width="100%" border="0" cellpadding="10" cellspacing="0" bgcolor="#FFFFFF">
                        <tr class="headrow">
                            <td colspan="2"> Upload </td>
                            </tr>
                        <tr class="oddrow">
                            <td colspan="2"> You have selected the '<b><%=plan.getName()%></b>' Process Definition to upload to a remote server. Enter the URL of the remote server's service registry or the URL of the factory on the remote server to upload to. </td>
                            </tr>
                        <tr class="oddrow">
                            <td class="prompt" align="right"> URL </td>
                            <td> <input type="text" name="Url"  size="80"> </td>
                            </tr>
                        <tr class="oddrow">
                            <table width="100%" align="center" bgcolor="#FFFFFF"><tr >
                                <td class="prompt" align="center">
                                    <INPUT type="radio" name="sendType" value="New" checked>This is a Service Registry URL<BR>
                                </td>
                                <td class="prompt" align="left">
                                    <INPUT type="radio" name="sendType" value="Update">This is a Factory URL<BR>
                                </td>
                            </tr></table>
                            </tr>
                    </table>
                </td>
            </tr>
        </table>
        <center><br/>
                    <input type="submit" value="Upload" class="submitClass">
        </center>
    </form>
</center>
</body>
</html>
