<%
//
// Jala Project [http://opensvn.csie.org/traccgi/jala]
//
// Copyright 2004 ORF Online und Teletext GmbH
//
// Licensed under the Apache License, Version 2.0 (the ``License'');
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//    http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an ``AS IS'' BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// $Revision$
// $LastChangedBy$
// $LastChangedDate$
// $HeadURL$
//
%>
<html>
<head>
<title>Jala XmlRpc Client</title>
<style type="text/css">
<!--

body {
   font-family: Verdana, Arial, Helvetica;
   font-size: 0.85em;
   margin: 0;
   padding: 0;
}

div.header {
   background-color: #aaa;
   border-bottom: 1px solid #333;
   font-size: 18px;
   font-weight: bold;
   color: #ddd;
   padding: 10px 20px;
}

div.main {
   margin: 20px;
}

form div {
   padding: 5px 0;
}

form div label {
   display: block;
   float: left;
   clear: left;
   width: 100px;
   padding: 3px 5px 3px 0;
   margin: 0px 0px 5px 0px;
   text-align: left;
}

form div.required label, label.required {
  font-weight: bold;
}

form span.example {
   font-size: 0.7em;
   line-height: 15px;
}

form input {
   font-family: Verdana, Arial, sans-serif;
   color: #000000;
   border: 1px solid grey;
   padding: 3px;
   line-height:0.9em;
   width: 600px;
}

form select {
   border: 1px solid grey;
   background-color: #eee;
}

form input.checkbox {
   border:none;
   width:auto;
}

form .submit {
   width: auto;
   padding: 3px 20px;
}

div.argument div.type {
   float: left;
   clear: left;
   width: 130px;
   padding: 3px 5px;
}

div.argument div.value {
   padding: 3px 5px;
   margin-left: 140px;
}

div.even {
   background-color: #f6f6f6;
}

fieldset {
   border-top: 1px solid #aaa;
   border-left: none;
   border-right: none;
   border-bottom: none;
   margin-top: 30px;
}

fieldset legend {
   font-weight: bold;
   color: #aaa;
   padding: 0 5px;
}

fieldset legend.result {
   color: #00bb00;
}

fieldset legend.error {
   color: red;
}

pre {
   font-family: Verdana, Arial, Helvetica;
   font-size: 1em;
   margin: 0;
   padding: 0;
}

div.error {
   color: #ff0000;
   font-weight: bold;
   font-size: 0.8em;
}

//-->
</style>
</head>

<body>
<div class="header">Jala XmlRpc Client</div>
<div class="main">
   <form method="post" action="<% request.action %>">
   <div><% feedback.error name="url" prefix='<div class="error">' suffix="</div>" %><label for="url" class="required">Url*</label><input id="host" type="text" name="url" value="<% request.url encoding="form" %>" /><br />
      <span class="example">Example: http://localhost:8080/xmlrpcclient/</span></div>
   <div><% feedback.error name="method" prefix='<div class="error">' suffix="</div>"  %><label for="method" class="required">Method*</label><input id="method" type="text" name="method" value="<% request.method encoding="form" %>" /><br />
      <span class="example">Example: echo</span></div>
   <div><% feedback.error name="arguments" prefix='<div class="error">' suffix="</div>"  %><label for="args">Arguments&nbsp;</label><input id="args" type="text" name="args" value="<% request.args encoding="form" %>" /><br />
      <span class="example">Example: "eins", 123, true, new Date(), {test: {me: "please"}}, ["a", ["b", "c"]]</span></div>
   <div><label for="encoding">Encoding</label><select id="encoding" name="encoding"><option<% selection name="encoding" value="UTF-8" attribute="selected" %>>UTF-8</option><option<% selection name="encoding" value="ISO-8859-1" attribute="selected" %>>ISO-8859-1</option></select></div>
   <div><label for="debug">Show Xml</label><input id="debug" class="checkbox" type="checkbox" name="debug" value="1"<% selection name="debug" value="1" attribute="checked" %>/></div>
   <div><label for="proxy">Proxy</label><input id="proxy" type="text" name="proxy" value="<% request.proxy %>" /><br />
      <span class="example">Example: my.proxy.com:3128</span></div>
   <div><label>&nbsp;</label><input class="submit" type="submit" name="test" value="Test" /><br /><span class="example">(* = required)</span></div>
   
   <% xmlrpc.arguments prefix="<fieldset><legend>Arguments</legend>" suffix="</fieldset>" %>
   
   <% xmlrpc.error prefix='<fieldset><legend class="error">Error</legend>' suffix="</fieldset>" %>
   
   <% xmlrpc.result prefix='<fieldset><legend class="result">Result</legend><pre>' suffix="</pre></fieldset>" %>

   <% xmlrpc.xml of="request" prefix="<fieldset><legend>Request XML</legend>" suffix="</fieldset>" %>

   <% xmlrpc.xml of="response" prefix="<fieldset><legend>Response XML</legend>" suffix="</fieldset>" %>

   </form>
</div>
</body>
</html>