1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
|
# extends 'layout.html'
# set _ = partial(dgettext, domain)
# set tag_ = partial(dtgettext, domain)
# set title = _("Remote Procedure Call (RPC)")
# block title
${title} ${ super() }
# endblock title
# block content
<div id="content" class="wiki">
<div class="wikipage searchable">
<div id="wikipage" class="trac-content borderless">
<h1 class="section">${title}</h1>
<p><strong>${_("Installed API version:")}</strong> ${rpc.version}</p>
<h2 id="Protocols" class="section">${_("Protocol reference:")}</h2>
<p>${
_("Below you will find a detailed description of all the RPC "
"protocols installed in this environment. This includes supported "
"content types as well as target URLs for anonymous and "
"authenticated access. Use this information to interact with this "
"environment from a remote location.")
}</p>
<p>${
_("Libraries for remote procedure calls and parsing exists for most "
"major languages and platforms - use a tested, standard library "
"for consistent results.")
}</p>
# for name, description, paths in rpc.protocols:
<dl>
<h3 id="${name}" class="section">${name}</h3>
<dd>
<p>${_("For %(name)s protocol, use any one of:", name=name)}</p>
<ul>
# for ct, ct_group in paths|groupby(1):
# with ct_group = ct_group|list
<li>
${tag_("%(header)s header with request to:",
header=tag.tt('Content-Type: ', ct))}
<ul>
<li>
${_("For anonymous access:")}
<ul>
# for h, mimetype in ct_group:
# with url = req.abs_href(h)
<li><a href="${url}">${url}</a></li>
# endwith
# endfor
</ul>
</li>
<li>
${_("For authenticated access:")}
<ul>
# for h, mimetype in ct_group:
# with url = req.abs_href.login(h)
<li>
<a href="${url}">${url}</a>
</li>
# endwith
# endfor
</ul>
</li>
</ul>
</li>
# endwith
# endfor
</ul>
<div>${wiki_to_html(context, description)}</div>
</dd>
</dl>
# endfor
<h2 id="Methods" class="section">${_("RPC exported functions")}</h2>
<div id="searchable">
# for key in rpc.functions|sort:
<dl>
# set ns = rpc.functions[key]
<h3 id="${'rpc.%s'|format(ns.namespace)}" class="section">
${ns.namespace} - ${ns.description}
</h3>
<dd>
<table class="listing tickets">
<thead>
<tr>
<th style="width:40%">${_("Function")}</th>
<th style="width:45%">${_("Description")}</th>
<th style="width:15%">${_("Permission required")}</th>
</tr>
</thead>
<tbody>
# for signature, description, permission in ns.methods:
<tr class="${'color3-%s'|format('even' if loop.index0 % 2 == 0 else 'odd')}">
<td style="padding-left:4em;text-indent:-4em">${signature}</td>
<td>${description}</td>
<td>${permission or _("By resource")}</td>
</tr>
# endfor
</tbody>
</table>
</dd>
</dl>
# endfor
</div>
</div>
</div>
</div>
${ super() }
# endblock content
|