<%-- 
  Copyright 2003 Sun Microsystems, Inc. All rights reserved 
  Use is subject to license terms.
 --%> 
<%@ page import=
    "com.sun.portal.providers.simplewebservice.SimpleWebServiceProviderAdapter,
	com.sun.portal.providers.simplewebservice.util.XList,
	java.util.Iterator,

	com.sun.portal.providers.simplewebservice.SimpleWebServiceParameter,
	com.sun.portal.providers.simplewebservice.SimpleWebServiceException,
	com.sun.portal.providers.ProviderException"
%>

<%@ taglib uri="/tld/desktop.tld" prefix="dt" %>
<%@ taglib uri="/tld/desktopProviderContext.tld" prefix="dtpc" %>
<%@ taglib uri="/tld/jx.tld" prefix="jx" %>

<%
    SimpleWebServiceProviderAdapter provider = 
        (SimpleWebServiceProviderAdapter)pageContext.getAttribute("JSPProvider");

%>
<dt:obtainChannel channel="$JSPProvider">
  <dtpc:providerContext>          
	        <dtpc:getStringProperty key="fontFace1" id="fontFace"/>
	        <jx:declare id="fontFace" type="java.lang.String"/>
	        


<table border=0 cellspacing=0 cellpadding=2 width="100%">
    <tr>
    <td  colspan="5" bgcolor="#666699"><b><font color="#FFFFFF" size="+1" face="<%=fontFace%>">
        Configure parameters for the web service </b></td>
    </tr>
    <tr align="left">
    <td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
    </tr>	
    <tr align="left">
    <td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
    <td><font face="<%=fontFace%>">
        <b>WSDL:</b><%= provider.getWSDL() %></td>
    </tr>
    <tr align="left">
    <td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
    <td><b>Method Name:</b><%= provider.getMethodName() %></td></b>
    </font>
    </td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    </tr>

</table>
<center>
<%
try {
	boolean isDefaultAvailable = provider.isDefaultAvailable();
%>
	<table border=0 cellspacing=1 cellpadding=0 width="75%">
		<% 
		SimpleWebServiceParameter[] fields = provider.defineInputForWebService(request);
		for ( int i = 0; fields != null && i < fields.length; i++) {
			if (!fields[i].getType().equals(XList.class)) {
		%>
				<tr>
					<td align=right>
						<font face="<%=fontFace%>" size="+0"><b><LABEL FOR="<%= fields[i].getName()%>">
						<%= fields[i].getName() %></LABEL></b></font>
					</td>
					<td>
						<font face="<%=fontFace%>" size="+0">
							<% if (isDefaultAvailable) { %> 
								<input type=text 
										name="<%= fields[i].getName() %>" 
										value="<%= fields[i].getStrValue() %>" 
										size=20 ID="<%=fields[i].getName()%>">
							<% } else { %>
								<input type=text 
										name="<%= fields[i].getName() %>" 
										value="<%= fields[i].getTypeHint() %>" 
										size=20 ID="<%=fields[i].getName()%>">
							<% } %>
						</font>

					</td>
				</tr>
			<%
			} else {
			%>
				<tr>
					<td>
						<b><%= fields[i].getName() %><b>
					</td>
					<td>
					<table border=1>
					<%
					Iterator x = ((XList)fields[i].getValue()).iterator(); 
					while ( x.hasNext()) {
						SimpleWebServiceParameter child = 
									(SimpleWebServiceParameter) x.next();
						
					%>
						<tr>
						<td align=right>
							<font face="<%=fontFace%>" size="+0"><b><LABEL FOR="<%=child.getName()%>">
							<%= child.getName() %></LABEL></b></font>
						</td>
						<td>
						<font face="<%=fontFace%>" size="+0">
							<% if (isDefaultAvailable) { %> 
								<input type=text 
								name=<%= child.getFullName()%> 
									value="<%= child.getStrValue() %>" 
									size=20 ID="<%=child.getName()%>">
							<% } else { %>
								<input type=text 
								name=<%= child.getFullName()%> 
									value="<%= child.getTypeHint() %>" 
									size=20 ID="<%=child.getName()%>">
							<% } %>
						</font>
						</td>
						</tr>
		
					<%
					}
					%>
					</table>
					</td>
				</tr>
			<%
			}
		}
		%>
	</table>









<%
}
catch(SimpleWebServiceException ex) {
%>
        <table border=1>
            <tr valign=top>
                <td>Error:</td>
                <td><%= ex.getMessage() %></td>
            </tr>
        </table>
<%
}
%>
<INPUT TYPE=HIDDEN NAME="editContent" value=<%= provider.EDIT_DEFAULT_INPUT %> SIZE=-1 >

  </dtpc:providerContext>          
</dt:obtainChannel>


</center>
