chg: replaced ant with gradle

This commit is contained in:
Tobi Schäfer 2020-03-16 16:53:52 +01:00
parent ced560f0c7
commit 7eebeee1d0
615 changed files with 87626 additions and 638 deletions

View file

@ -0,0 +1,84 @@
//
// 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$
//
/**
* Main action
*/
Root.prototype.main_action = function() {
res.handlers.xmlrpc = {};
res.handlers.feedback = new Feedback();
if (req.isPost()) {
if (!req.data.url) {
res.handlers.feedback.setError("url", "Please enter the URL of the XmlRpc entry point");
}
if (!req.data.method) {
res.handlers.feedback.setError("method", "Please specify the method to call");
}
try {
var args = parseArguments(req.data.args);
} catch (e) {
res.handlers.feedback.setError("arguments", "The method arguments are invalid");
}
if (!res.handlers.feedback.isError) {
var xmlRpcCall = new XmlRpcCall(req.data.url, req.data.method);
xmlRpcCall.request.setEncoding(req.data.encoding);
xmlRpcCall.request.setProxy(req.data.proxy);
xmlRpcCall.request.setDebug(req.data.debug == 1);
if (app.properties.username != null && app.properties.password != null) {
xmlRpcCall.request.setCredentials(app.properties.username, app.properties.password);
}
XmlRpcCall.prototype.execute.apply(xmlRpcCall, args);
res.handlers.xmlrpc = xmlRpcCall;
}
}
this.renderSkin("main");
return;
};
/**
* Main XmlRpc action. The only supported method name is "echo".
* If no additional arguments are given this action
* returns "echo" to the client. A single additional argument is returned
* as-is, multiple additional arguments are returned as array.
*/
Root.prototype.main_action_xmlrpc = function(methodName) {
switch (methodName) {
case "echo":
if (arguments.length == 1) {
return "echo";
} else if (arguments.length == 2) {
return arguments[1];
} else {
var result = [];
for (var i=1;i<arguments.length;i++) {
result.push(arguments[i]);
}
return result;
}
default:
throw "Unknown XmlRpc method '" + methodName + "'";
break;
}
return;
};

View file

@ -0,0 +1,182 @@
<%
//
// 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>