<%@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"
%><%
    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;
    }
    session.setAttribute("TabIndex","2");
    String defnUri = request.getParameter("selectedPlanUri");    
    if (defnUri == null) { defnUri = ""; }
    
        String servRegUri = (String)session.getAttribute("ServiceRegUri");    
    if (servRegUri == null) { servRegUri = ""; }
        
%>
<html>
<head><title>Interstage Business Process Manager | Download</title>
<jsp:include page="StyleSheet.jsp" flush="true"/>
<script language="javascript" src="styles/clockscripts.js"></script>
<script>
</script>
</head>
<body class="bodyClass" onLoad="goforit();">
<jsp:include page="Header.jsp" flush="true"/>
<center>

<%
    String actionURL = "DownloadAction.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="5" cellspacing="0" bgcolor="#FFFFFF">
                        <tr class="headrow">
                            <td colspan="3"> Search for a factory to download from </td>
                            </tr>
                        <tr class="oddrow">
                            <td>&nbsp;</td>
                            <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
                            <td>&nbsp;</td>
                            </tr>
                        <tr class="oddrow">
                            <td class="prompt" align="right"> Registry </td>
                            <td>  <input type="text" name="ServRegUriField" size="60" value="<%=servRegUri%>"> </td>
                            <td>  <input class="submitClass" type="submit" name="ListFactories" width="100" value="Search"> </td>
                            </tr>
                        <tr class="oddrow">
                            <td colspan="3"> If you know the address URL of a remote service registry, you can enter it here, and search for factories listed on that registry.  You will be able to select the factory, and download the process definition from that factory. </td>
                            </tr>
                    </table>
                </td>
            </tr>
        </table>
        <br/>
        <TABLE border="0" cellpadding="0" cellspacing="1" class="tableClass" width="600" align="center" bgcolor="#CCCCCC">
            <tr>
                <td>
                    <table width="100%" border="0" cellpadding="5" cellspacing="0" bgcolor="#FFFFFF">
                        <tr class="headrow">
                            <td colspan="3"> Download from factory </td>
                            </tr>
                        <tr class="oddrow">
                            <td>&nbsp;</td>
                            <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
                            <td>&nbsp;</td>
                            </tr>
                        <tr class="oddrow">
                            <td class="prompt" align="right"> Factory </td>
                            <td> <input type="text" name="DefnUriField" size="60" value="<%=defnUri%>"> </td>
                            <td>  <input class="submitClass" type="submit" width="100" value="Download"> </td>
                            </tr>
                        <tr class="oddrow">
                            <td colspan="3"> If you know the exact URL of the factory that you want the process definition from, enter it here and download the process definition from the factory. </td>
                            </tr>
                    </table>
                </td>
            </tr>
        </table>
    
    </form>
</center>
</body>
</html>
