Fixed most linting issues in to_selmer_templates; commented out unfinished code in to_swagger

This commit is contained in:
Simon Brooke 2025-05-25 13:16:21 +01:00
parent bb30ca3a20
commit 5358770b25
16 changed files with 1600 additions and 488 deletions

View file

@ -1,10 +1,10 @@
<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>adl.main documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Adl</span> <span class="project-version">1.4.6</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>adl</span></div></div></li><li class="depth-2 branch current"><a href="adl.main.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>main</span></div></a></li><li class="depth-2 branch"><a href="adl.to-cache.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-cache</span></div></a></li><li class="depth-2 branch"><a href="adl.to-hugsql-queries.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-hugsql-queries</span></div></a></li><li class="depth-2 branch"><a href="adl.to-json-routes.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-json-routes</span></div></a></li><li class="depth-2 branch"><a href="adl.to-psql.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-psql</span></div></a></li><li class="depth-2 branch"><a href="adl.to-reframe.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-reframe</span></div></a></li><li class="depth-2 branch"><a href="adl.to-selmer-routes.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-selmer-routes</span></div></a></li><li class="depth-2 branch"><a href="adl.to-selmer-templates.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-selmer-templates</span></div></a></li><li class="depth-2 branch"><a href="adl.to-swagger.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-swagger</span></div></a></li><li class="depth-2"><a href="adl.validator.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>validator</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="adl.main.html#var--main"><div class="inner"><span>-main</span></div></a></li><li class="depth-1"><a href="adl.main.html#var-adl-.3Ecanonical"><div class="inner"><span>adl-&gt;canonical</span></div></a></li><li class="depth-1"><a href="adl.main.html#var-canonicalise"><div class="inner"><span>canonicalise</span></div></a></li><li class="depth-1"><a href="adl.main.html#var-cli-options"><div class="inner"><span>cli-options</span></div></a></li><li class="depth-1"><a href="adl.main.html#var-process"><div class="inner"><span>process</span></div></a></li><li class="depth-1"><a href="adl.main.html#var-usage"><div class="inner"><span>usage</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">adl.main</h1><div class="doc"><pre class="plaintext">Application Description Language - command line invocation.
</pre></div><div class="public anchor" id="var--main"><h3>-main</h3><div class="usage"><code>(-main &amp; args)</code></div><div class="doc"><pre class="plaintext">Parses options and arguments. Expects as args the path-name of one or
more ADL files.</pre></div></div><div class="public anchor" id="var-adl-.3Ecanonical"><h3>adl-&gt;canonical</h3><div class="usage"></div><div class="doc"><pre class="plaintext">A function which takes ADL text as its single argument and returns
canonicalised ADL text as its result.</pre></div></div><div class="public anchor" id="var-canonicalise"><h3>canonicalise</h3><div class="usage"><code>(canonicalise filepath)</code></div><div class="doc"><pre class="plaintext">Canonicalise the ADL document indicated by this `filepath` (if it is not
already canonical) and return a path to the canonical version.</pre></div></div><div class="public anchor" id="var-cli-options"><h3>cli-options</h3><div class="usage"></div><div class="doc"><pre class="plaintext">Command-line interface options
</pre></div></div><div class="public anchor" id="var-process"><h3>process</h3><div class="usage"><code>(process options)</code></div><div class="doc"><pre class="plaintext">Process these parsed `options`.
</pre></div></div><div class="public anchor" id="var-usage"><h3>usage</h3><div class="usage"><code>(usage parsed-options)</code></div><div class="doc"><pre class="plaintext">Show a usage message. `parsed-options` should be options as
parsed by [clojure.tools.cli](<a href="https://github.com/clojure/tools.cli)">https://github.com/clojure/tools.cli)</a></pre></div></div></div></body></html>
<html><head><meta charset="UTF-8" /><title>adl.main documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Adl</span> <span class="project-version">1.4.7-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>adl</span></div></div></li><li class="depth-2 branch current"><a href="adl.main.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>main</span></div></a></li><li class="depth-2 branch"><a href="adl.to-cache.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-cache</span></div></a></li><li class="depth-2 branch"><a href="adl.to-hugsql-queries.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-hugsql-queries</span></div></a></li><li class="depth-2 branch"><a href="adl.to-json-routes.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-json-routes</span></div></a></li><li class="depth-2 branch"><a href="adl.to-psql.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-psql</span></div></a></li><li class="depth-2 branch"><a href="adl.to-reframe.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-reframe</span></div></a></li><li class="depth-2 branch"><a href="adl.to-selmer-routes.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-selmer-routes</span></div></a></li><li class="depth-2 branch"><a href="adl.to-selmer-templates.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-selmer-templates</span></div></a></li><li class="depth-2 branch"><a href="adl.to-swagger.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-swagger</span></div></a></li><li class="depth-2"><a href="adl.validator.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>validator</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="adl.main.html#var--main"><div class="inner"><span>-main</span></div></a></li><li class="depth-1"><a href="adl.main.html#var-adl-.3Ecanonical"><div class="inner"><span>adl-&gt;canonical</span></div></a></li><li class="depth-1"><a href="adl.main.html#var-canonicalise"><div class="inner"><span>canonicalise</span></div></a></li><li class="depth-1"><a href="adl.main.html#var-cli-options"><div class="inner"><span>cli-options</span></div></a></li><li class="depth-1"><a href="adl.main.html#var-process"><div class="inner"><span>process</span></div></a></li><li class="depth-1"><a href="adl.main.html#var-usage"><div class="inner"><span>usage</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">adl.main</h1><div class="doc"><div class="markdown"><p>Application Description Language - command line invocation.</p>
</div></div><div class="public anchor" id="var--main"><h3>-main</h3><div class="usage"><code>(-main &amp; args)</code></div><div class="doc"><div class="markdown"><p>Parses options and arguments. Expects as args the path-name of one or more ADL files.</p>
</div></div></div><div class="public anchor" id="var-adl-.3Ecanonical"><h3>adl-&gt;canonical</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>A function which takes ADL text as its single argument and returns canonicalised ADL text as its result.</p>
</div></div></div><div class="public anchor" id="var-canonicalise"><h3>canonicalise</h3><div class="usage"><code>(canonicalise filepath)</code></div><div class="doc"><div class="markdown"><p>Canonicalise the ADL document indicated by this <code>filepath</code> (if it is not already canonical) and return a path to the canonical version.</p>
</div></div></div><div class="public anchor" id="var-cli-options"><h3>cli-options</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>Command-line interface options</p>
</div></div></div><div class="public anchor" id="var-process"><h3>process</h3><div class="usage"><code>(process options)</code></div><div class="doc"><div class="markdown"><p>Process these parsed <code>options</code>.</p>
</div></div></div><div class="public anchor" id="var-usage"><h3>usage</h3><div class="usage"><code>(usage parsed-options)</code></div><div class="doc"><div class="markdown"><p>Show a usage message. <code>parsed-options</code> should be options as parsed by <a href="https://github.com/clojure/tools.cli">clojure.tools.cli</a></p>
</div></div></div></div></body></html>

View file

@ -1,7 +1,7 @@
<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>adl.to-cache documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Adl</span> <span class="project-version">1.4.6</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>adl</span></div></div></li><li class="depth-2 branch"><a href="adl.main.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>main</span></div></a></li><li class="depth-2 branch current"><a href="adl.to-cache.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-cache</span></div></a></li><li class="depth-2 branch"><a href="adl.to-hugsql-queries.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-hugsql-queries</span></div></a></li><li class="depth-2 branch"><a href="adl.to-json-routes.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-json-routes</span></div></a></li><li class="depth-2 branch"><a href="adl.to-psql.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-psql</span></div></a></li><li class="depth-2 branch"><a href="adl.to-reframe.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-reframe</span></div></a></li><li class="depth-2 branch"><a href="adl.to-selmer-routes.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-selmer-routes</span></div></a></li><li class="depth-2 branch"><a href="adl.to-selmer-templates.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-selmer-templates</span></div></a></li><li class="depth-2 branch"><a href="adl.to-swagger.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-swagger</span></div></a></li><li class="depth-2"><a href="adl.validator.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>validator</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="adl.to-cache.html#var-file-header"><div class="inner"><span>file-header</span></div></a></li><li class="depth-1"><a href="adl.to-cache.html#var-handler"><div class="inner"><span>handler</span></div></a></li><li class="depth-1"><a href="adl.to-cache.html#var-to-cache"><div class="inner"><span>to-cache</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">adl.to-cache</h1><div class="doc"><pre class="plaintext">Application Description Language: generate caching layer for database requests.
</pre></div><div class="public anchor" id="var-file-header"><h3>file-header</h3><div class="usage"><code>(file-header application)</code></div><div class="doc"><pre class="plaintext">Generate an appropriate file header for JSON routes for this `application`.
</pre></div></div><div class="public anchor" id="var-handler"><h3>handler</h3><div class="usage"><code>(handler query)</code></div><div class="doc"><pre class="plaintext">Generate declarations for handlers for this `query`. Cache handlers are needed only for select queries.
</pre></div></div><div class="public anchor" id="var-to-cache"><h3>to-cache</h3><div class="usage"><code>(to-cache application)</code></div><div class="doc"><pre class="plaintext">Generate a `/cache.clj` file for this `application`.
</pre></div></div></div></body></html>
<html><head><meta charset="UTF-8" /><title>adl.to-cache documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Adl</span> <span class="project-version">1.4.7-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>adl</span></div></div></li><li class="depth-2 branch"><a href="adl.main.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>main</span></div></a></li><li class="depth-2 branch current"><a href="adl.to-cache.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-cache</span></div></a></li><li class="depth-2 branch"><a href="adl.to-hugsql-queries.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-hugsql-queries</span></div></a></li><li class="depth-2 branch"><a href="adl.to-json-routes.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-json-routes</span></div></a></li><li class="depth-2 branch"><a href="adl.to-psql.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-psql</span></div></a></li><li class="depth-2 branch"><a href="adl.to-reframe.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-reframe</span></div></a></li><li class="depth-2 branch"><a href="adl.to-selmer-routes.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-selmer-routes</span></div></a></li><li class="depth-2 branch"><a href="adl.to-selmer-templates.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-selmer-templates</span></div></a></li><li class="depth-2 branch"><a href="adl.to-swagger.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-swagger</span></div></a></li><li class="depth-2"><a href="adl.validator.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>validator</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="adl.to-cache.html#var-file-header"><div class="inner"><span>file-header</span></div></a></li><li class="depth-1"><a href="adl.to-cache.html#var-handler"><div class="inner"><span>handler</span></div></a></li><li class="depth-1"><a href="adl.to-cache.html#var-to-cache"><div class="inner"><span>to-cache</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">adl.to-cache</h1><div class="doc"><div class="markdown"><p>Application Description Language: generate caching layer for database requests.</p>
</div></div><div class="public anchor" id="var-file-header"><h3>file-header</h3><div class="usage"><code>(file-header application)</code></div><div class="doc"><div class="markdown"><p>Generate an appropriate file header for JSON routes for this <code>application</code>.</p>
</div></div></div><div class="public anchor" id="var-handler"><h3>handler</h3><div class="usage"><code>(handler query)</code></div><div class="doc"><div class="markdown"><p>Generate declarations for handlers for this <code>query</code>. Cache handlers are needed only for select queries.</p>
</div></div></div><div class="public anchor" id="var-to-cache"><h3>to-cache</h3><div class="usage"><code>(to-cache application)</code></div><div class="doc"><div class="markdown"><p>Generate a <code>/cache.clj</code> file for this <code>application</code>.</p>
</div></div></div></div></body></html>

File diff suppressed because one or more lines are too long

View file

@ -1,13 +1,12 @@
<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>adl.to-json-routes documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Adl</span> <span class="project-version">1.4.6</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>adl</span></div></div></li><li class="depth-2 branch"><a href="adl.main.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>main</span></div></a></li><li class="depth-2 branch"><a href="adl.to-cache.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-cache</span></div></a></li><li class="depth-2 branch"><a href="adl.to-hugsql-queries.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-hugsql-queries</span></div></a></li><li class="depth-2 branch current"><a href="adl.to-json-routes.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-json-routes</span></div></a></li><li class="depth-2 branch"><a href="adl.to-psql.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-psql</span></div></a></li><li class="depth-2 branch"><a href="adl.to-reframe.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-reframe</span></div></a></li><li class="depth-2 branch"><a href="adl.to-selmer-routes.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-selmer-routes</span></div></a></li><li class="depth-2 branch"><a href="adl.to-selmer-templates.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-selmer-templates</span></div></a></li><li class="depth-2 branch"><a href="adl.to-swagger.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-swagger</span></div></a></li><li class="depth-2"><a href="adl.validator.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>validator</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="adl.to-json-routes.html#var-declarations"><div class="inner"><span>declarations</span></div></a></li><li class="depth-1"><a href="adl.to-json-routes.html#var-defroutes"><div class="inner"><span>defroutes</span></div></a></li><li class="depth-1"><a href="adl.to-json-routes.html#var-file-header"><div class="inner"><span>file-header</span></div></a></li><li class="depth-1"><a href="adl.to-json-routes.html#var-generate-handler-body"><div class="inner"><span>generate-handler-body</span></div></a></li><li class="depth-1"><a href="adl.to-json-routes.html#var-generate-handler-src"><div class="inner"><span>generate-handler-src</span></div></a></li><li class="depth-1"><a href="adl.to-json-routes.html#var-handler"><div class="inner"><span>handler</span></div></a></li><li class="depth-1"><a href="adl.to-json-routes.html#var-make-handlers-map"><div class="inner"><span>make-handlers-map</span></div></a></li><li class="depth-1"><a href="adl.to-json-routes.html#var-to-json-routes"><div class="inner"><span>to-json-routes</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">adl.to-json-routes</h1><div class="doc"><pre class="plaintext">Application Description Language: generate RING routes for REST requests.
</pre></div><div class="public anchor" id="var-declarations"><h3>declarations</h3><div class="usage"><code>(declarations handlers-map)</code></div><div class="doc"><pre class="plaintext">Generate a forward declaration of all JSON route handlers we're going to
generate for this `application`.</pre></div></div><div class="public anchor" id="var-defroutes"><h3>defroutes</h3><div class="usage"><code>(defroutes handlers-map)</code></div><div class="doc"><pre class="plaintext">Generate JSON routes for all queries implied by this ADL `application` spec.
</pre></div></div><div class="public anchor" id="var-file-header"><h3>file-header</h3><div class="usage"><code>(file-header application)</code></div><div class="doc"><pre class="plaintext">Generate an appropriate file header for JSON routes for this `application`.
</pre></div></div><div class="public anchor" id="var-generate-handler-body"><h3>generate-handler-body</h3><div class="usage"><code>(generate-handler-body query)</code></div><div class="doc"><pre class="plaintext">Generate and return the function body for the handler for this `query`.
</pre></div></div><div class="public anchor" id="var-generate-handler-src"><h3>generate-handler-src</h3><div class="usage"><code>(generate-handler-src handler-name query-map method)</code></div><div class="doc"><pre class="plaintext">Generate and return the handler for this `query`.
</pre></div></div><div class="public anchor" id="var-handler"><h3>handler</h3><div class="usage"><code>(handler query-key queries-map application)</code></div><div class="doc"><pre class="plaintext">Generate declarations for handlers from query with this `query-key` in this `queries-map`
taken from within this `application`. This method must follow the structure of
`to-hugsql-queries/queries` quite closely, because we must generate the same names.</pre></div></div><div class="public anchor" id="var-make-handlers-map"><h3>make-handlers-map</h3><div class="usage"><code>(make-handlers-map application)</code></div><div class="doc"><pre class="plaintext">Analyse this `application` and generate from it a map of the handlers to be output.
</pre></div></div><div class="public anchor" id="var-to-json-routes"><h3>to-json-routes</h3><div class="usage"><code>(to-json-routes application)</code></div><div class="doc"><pre class="plaintext">Generate a `/routes/auto-json.clj` file for this `application`.
</pre></div></div></div></body></html>
<html><head><meta charset="UTF-8" /><title>adl.to-json-routes documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Adl</span> <span class="project-version">1.4.7-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>adl</span></div></div></li><li class="depth-2 branch"><a href="adl.main.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>main</span></div></a></li><li class="depth-2 branch"><a href="adl.to-cache.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-cache</span></div></a></li><li class="depth-2 branch"><a href="adl.to-hugsql-queries.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-hugsql-queries</span></div></a></li><li class="depth-2 branch current"><a href="adl.to-json-routes.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-json-routes</span></div></a></li><li class="depth-2 branch"><a href="adl.to-psql.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-psql</span></div></a></li><li class="depth-2 branch"><a href="adl.to-reframe.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-reframe</span></div></a></li><li class="depth-2 branch"><a href="adl.to-selmer-routes.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-selmer-routes</span></div></a></li><li class="depth-2 branch"><a href="adl.to-selmer-templates.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-selmer-templates</span></div></a></li><li class="depth-2 branch"><a href="adl.to-swagger.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-swagger</span></div></a></li><li class="depth-2"><a href="adl.validator.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>validator</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="adl.to-json-routes.html#var-declarations"><div class="inner"><span>declarations</span></div></a></li><li class="depth-1"><a href="adl.to-json-routes.html#var-defroutes"><div class="inner"><span>defroutes</span></div></a></li><li class="depth-1"><a href="adl.to-json-routes.html#var-file-header"><div class="inner"><span>file-header</span></div></a></li><li class="depth-1"><a href="adl.to-json-routes.html#var-generate-handler-body"><div class="inner"><span>generate-handler-body</span></div></a></li><li class="depth-1"><a href="adl.to-json-routes.html#var-generate-handler-src"><div class="inner"><span>generate-handler-src</span></div></a></li><li class="depth-1"><a href="adl.to-json-routes.html#var-handler"><div class="inner"><span>handler</span></div></a></li><li class="depth-1"><a href="adl.to-json-routes.html#var-make-handlers-map"><div class="inner"><span>make-handlers-map</span></div></a></li><li class="depth-1"><a href="adl.to-json-routes.html#var-to-json-routes"><div class="inner"><span>to-json-routes</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">adl.to-json-routes</h1><div class="doc"><div class="markdown"><p>Application Description Language: generate RING routes for REST requests.</p>
</div></div><div class="public anchor" id="var-declarations"><h3>declarations</h3><div class="usage"><code>(declarations handlers-map)</code></div><div class="doc"><div class="markdown"><p>Generate a forward declaration of all JSON route handlers were going to generate for this <code>application</code>.</p>
</div></div></div><div class="public anchor" id="var-defroutes"><h3>defroutes</h3><div class="usage"><code>(defroutes handlers-map)</code></div><div class="doc"><div class="markdown"><p>Generate JSON routes for all queries implied by this ADL <code>application</code> spec.</p>
</div></div></div><div class="public anchor" id="var-file-header"><h3>file-header</h3><div class="usage"><code>(file-header application)</code></div><div class="doc"><div class="markdown"><p>Generate an appropriate file header for JSON routes for this <code>application</code>.</p>
</div></div></div><div class="public anchor" id="var-generate-handler-body"><h3>generate-handler-body</h3><div class="usage"><code>(generate-handler-body query)</code></div><div class="doc"><div class="markdown"><p>Generate and return the function body for the handler for this <code>query</code>.</p>
</div></div></div><div class="public anchor" id="var-generate-handler-src"><h3>generate-handler-src</h3><div class="usage"><code>(generate-handler-src handler-name query-map method)</code></div><div class="doc"><div class="markdown"><p>Generate and return the handler for this <code>query</code>.</p>
</div></div></div><div class="public anchor" id="var-handler"><h3>handler</h3><div class="usage"><code>(handler query-key queries-map application)</code></div><div class="doc"><div class="markdown"><p>Generate declarations for handlers from query with this <code>query-key</code> in this <code>queries-map</code> taken from within this <code>application</code>. This method must follow the structure of <code>to-hugsql-queries/queries</code> quite closely, because we must generate the same names.</p>
</div></div></div><div class="public anchor" id="var-make-handlers-map"><h3>make-handlers-map</h3><div class="usage"><code>(make-handlers-map application)</code></div><div class="doc"><div class="markdown"><p>Analyse this <code>application</code> and generate from it a map of the handlers to be output.</p>
</div></div></div><div class="public anchor" id="var-to-json-routes"><h3>to-json-routes</h3><div class="usage"><code>(to-json-routes application)</code></div><div class="doc"><div class="markdown"><p>Generate a <code>/routes/auto-json.clj</code> file for this <code>application</code>.</p>
</div></div></div></div></body></html>

File diff suppressed because one or more lines are too long

View file

@ -1,7 +1,7 @@
<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>adl.to-reframe documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Adl</span> <span class="project-version">1.4.6</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>adl</span></div></div></li><li class="depth-2 branch"><a href="adl.main.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>main</span></div></a></li><li class="depth-2 branch"><a href="adl.to-cache.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-cache</span></div></a></li><li class="depth-2 branch"><a href="adl.to-hugsql-queries.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-hugsql-queries</span></div></a></li><li class="depth-2 branch"><a href="adl.to-json-routes.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-json-routes</span></div></a></li><li class="depth-2 branch"><a href="adl.to-psql.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-psql</span></div></a></li><li class="depth-2 branch current"><a href="adl.to-reframe.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-reframe</span></div></a></li><li class="depth-2 branch"><a href="adl.to-selmer-routes.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-selmer-routes</span></div></a></li><li class="depth-2 branch"><a href="adl.to-selmer-templates.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-selmer-templates</span></div></a></li><li class="depth-2 branch"><a href="adl.to-swagger.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-swagger</span></div></a></li><li class="depth-2"><a href="adl.validator.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>validator</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="adl.to-reframe.html#var-file-header"><div class="inner"><span>file-header</span></div></a></li><li class="depth-1"><a href="adl.to-reframe.html#var-generate-form"><div class="inner"><span>generate-form</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">adl.to-reframe</h1><div class="doc"><pre class="plaintext">Application Description Language: generate re-frame UI. TODO: doesn't even nearly work yet.
</pre></div><div class="public anchor" id="var-file-header"><h3>file-header</h3><div class="usage"><code>(file-header parent-name this-name extra-requires)</code><code>(file-header parent-name this-name)</code></div><div class="doc"><pre class="plaintext">Generate an appropriate file header for a re-frame view.
</pre></div></div><div class="public anchor" id="var-generate-form"><h3>generate-form</h3><div class="usage"><code>(generate-form form entity application)</code></div><div class="doc"><pre class="plaintext">Generate as re-frame this `form` taken from this `entity` of this `application`.
TODO: write it!</pre></div></div></div></body></html>
<html><head><meta charset="UTF-8" /><title>adl.to-reframe documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Adl</span> <span class="project-version">1.4.7-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>adl</span></div></div></li><li class="depth-2 branch"><a href="adl.main.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>main</span></div></a></li><li class="depth-2 branch"><a href="adl.to-cache.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-cache</span></div></a></li><li class="depth-2 branch"><a href="adl.to-hugsql-queries.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-hugsql-queries</span></div></a></li><li class="depth-2 branch"><a href="adl.to-json-routes.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-json-routes</span></div></a></li><li class="depth-2 branch"><a href="adl.to-psql.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-psql</span></div></a></li><li class="depth-2 branch current"><a href="adl.to-reframe.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-reframe</span></div></a></li><li class="depth-2 branch"><a href="adl.to-selmer-routes.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-selmer-routes</span></div></a></li><li class="depth-2 branch"><a href="adl.to-selmer-templates.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-selmer-templates</span></div></a></li><li class="depth-2 branch"><a href="adl.to-swagger.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-swagger</span></div></a></li><li class="depth-2"><a href="adl.validator.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>validator</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="adl.to-reframe.html#var-file-header"><div class="inner"><span>file-header</span></div></a></li><li class="depth-1"><a href="adl.to-reframe.html#var-generate-form"><div class="inner"><span>generate-form</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">adl.to-reframe</h1><div class="doc"><div class="markdown"><p>Application Description Language: generate re-frame UI. TODO: doesnt even nearly work yet.</p>
</div></div><div class="public anchor" id="var-file-header"><h3>file-header</h3><div class="usage"><code>(file-header parent-name this-name extra-requires)</code><code>(file-header parent-name this-name)</code></div><div class="doc"><div class="markdown"><p>Generate an appropriate file header for a re-frame view.</p>
</div></div></div><div class="public anchor" id="var-generate-form"><h3>generate-form</h3><div class="usage"><code>(generate-form form entity application)</code></div><div class="doc"><div class="markdown"><p>Generate as re-frame this <code>form</code> taken from this <code>entity</code> of this <code>application</code>.</p>
<p>TODO: write it!</p>
</div></div></div></div></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,5 +1,5 @@
<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>adl.to-swagger documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Adl</span> <span class="project-version">1.4.6</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>adl</span></div></div></li><li class="depth-2 branch"><a href="adl.main.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>main</span></div></a></li><li class="depth-2 branch"><a href="adl.to-cache.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-cache</span></div></a></li><li class="depth-2 branch"><a href="adl.to-hugsql-queries.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-hugsql-queries</span></div></a></li><li class="depth-2 branch"><a href="adl.to-json-routes.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-json-routes</span></div></a></li><li class="depth-2 branch"><a href="adl.to-psql.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-psql</span></div></a></li><li class="depth-2 branch"><a href="adl.to-reframe.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-reframe</span></div></a></li><li class="depth-2 branch"><a href="adl.to-selmer-routes.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-selmer-routes</span></div></a></li><li class="depth-2 branch"><a href="adl.to-selmer-templates.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-selmer-templates</span></div></a></li><li class="depth-2 branch current"><a href="adl.to-swagger.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-swagger</span></div></a></li><li class="depth-2"><a href="adl.validator.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>validator</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="adl.to-swagger.html#var-file-header"><div class="inner"><span>file-header</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">adl.to-swagger</h1><div class="doc"><pre class="plaintext">Application Description Language: generate swagger routes.
</pre></div><div class="public anchor" id="var-file-header"><h3>file-header</h3><div class="usage"><code>(file-header application)</code></div><div class="doc"><pre class="plaintext">TODO: Nothing here works yet.
</pre></div></div></div></body></html>
<html><head><meta charset="UTF-8" /><title>adl.to-swagger documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Adl</span> <span class="project-version">1.4.7-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>adl</span></div></div></li><li class="depth-2 branch"><a href="adl.main.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>main</span></div></a></li><li class="depth-2 branch"><a href="adl.to-cache.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-cache</span></div></a></li><li class="depth-2 branch"><a href="adl.to-hugsql-queries.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-hugsql-queries</span></div></a></li><li class="depth-2 branch"><a href="adl.to-json-routes.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-json-routes</span></div></a></li><li class="depth-2 branch"><a href="adl.to-psql.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-psql</span></div></a></li><li class="depth-2 branch"><a href="adl.to-reframe.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-reframe</span></div></a></li><li class="depth-2 branch"><a href="adl.to-selmer-routes.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-selmer-routes</span></div></a></li><li class="depth-2 branch"><a href="adl.to-selmer-templates.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-selmer-templates</span></div></a></li><li class="depth-2 branch current"><a href="adl.to-swagger.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>to-swagger</span></div></a></li><li class="depth-2"><a href="adl.validator.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>validator</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="adl.to-swagger.html#var-file-header"><div class="inner"><span>file-header</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">adl.to-swagger</h1><div class="doc"><div class="markdown"><p>Application Description Language: generate swagger routes.</p>
</div></div><div class="public anchor" id="var-file-header"><h3>file-header</h3><div class="usage"><code>(file-header application)</code></div><div class="doc"><div class="markdown"><p>TODO: Nothing here works yet.</p>
</div></div></div></div></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -18,9 +18,9 @@
:main adl.main
:plugins [[lein-codox "0.10.3"]
[lein-kibit "0.1.6"]
[lein-release "1.0.5"]]
:plugins [[lein-codox "0.10.8"]
[lein-kibit "0.1.11"]
[lein-release "1.1.3"]]
:codox {:metadata {:doc "**TODO*: write docs"
:doc/format :markdown}

View file

@ -0,0 +1,628 @@
<!-- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<!-- -->
<!-- adl-1.4.7.dtd -->
<!-- -->
<!-- Purpose: -->
<!-- Document Type Description for Application Description -->
<!-- Language. Normative for now; will be replaced by a schema. ` -->
<!-- -->
<!-- Author: Simon Brooke <simon@journeyman.cc> -->
<!-- Created: 3rd June 2018 -->
<!-- Copyright: (c) 2018 Simon Brooke -->
<!-- -->
<!-- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<!-- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<!-- Before we start: import XHTML for use in documentation sections -->
<!-- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<!-- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<!-- Before we start: some useful definitions -->
<!-- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<!-- some basic character entities inherited from HTML. Actually we probably ought to
import all the HTML4 character entity files, and possibly the HTML4 Strict DTD (so
that we can allow HTML block level entities within content elements -->
<!ENTITY nbsp "&#160;">
<!ENTITY pound "&#163;">
<!ENTITY copy "&#169;">
<!-- boolean means true or false -->
<!ENTITY % Boolean "(true|false)" >
<!--
Locale is a string comprising an ISO 639 language code followed by a space
followed by an ISO 3166 country code, or else the string 'default'. See:
<URL:http://www.ics.uci.edu/pub/ietf/http/related/iso639.txt>
<URL:http://www.chemie.fu-berlin.de/diverse/doc/ISO_3166.html>
-->
<!ENTITY % Locale "CDATA" >
<!--
permissions a group may have on an entity, list, page, form or field
permissions are deemed to increase as you go right. A group cannot
have greater permission on a field than on the form it is in, or
greater permission on form than the entity it belongs to
none: none
read: select
insert: insert
noedit: select, insert
edit: select, insert, update
all: select, insert, update, delete
-->
<!ENTITY % Permissions "none|read|insert|noedit|edit|all" >
<!--
actions which should be cascaded to dependent objects. All these values except
'manual' are taken from Hibernate and should be passed through the adl2hibernate
mapping transparently. Relevent only for properties with type='entity', type='link'
and type='list'
all : cascade delete, save and update
all-delete-orphan : see hibernate documentation; relates to transient objects only
delete : cascade delete actions, but not save and update
manual : cascading will be handled in manually managed code, code to
handle cascading should not be generated
save-update : cascade save and update actions, but not delete.
-->
<!ENTITY % CascadeActions "all|all-delete-orphan|delete|manual|save-update">
<!--
data types which can be used in a typedef to provide validation -
e.g. a string can be used with a regexp or a scalar can be used with
min and max values
string: varchar java.sql.Types.VARCHAR
integer: int java.sql.Types.INTEGER
real: double java.sql.Types.DOUBLE
money: money java.sql.Types.INTEGER
date: date java.sql.Types.DATE
time: time java.sql.Types.TIME
timestamp: timestamp java.sql.Types.TIMESTAMP
uploadable: varchar java.sql.Types.VARCHAR
image: varchar java.sql.Types.VARCHAR
uploadable is as string but points to an uploaded file; image is as
uploadable but points to an uploadable graphical image file
-->
<!ENTITY % DefinableDataTypes "string|integer|real|money|date|time|timestamp|uploadable" >
<!--
data types which are fairly straightforward translations of JDBC data types
boolean: boolean or java.sql.Types.BIT
char(1) java.sql.Types.CHAR
text: text or java.sql.Types.LONGVARCHAR
memo java.sql.Types.CLOB
-->
<!ENTITY % SimpleDataTypes "%DefinableDataTypes;|boolean|text" >
<!--
data types which are more complex than SimpleDataTypes...
entity : a foreign key link to another entity (i.e. the 'many' end of a
one-to-many link);
list : a list of some other entity that links to me (i.e. the 'one' end of
a one-to-many link);
link : a many to many link (via a link table);
defined : a type defined by a typedef.
-->
<!ENTITY % ComplexDataTypes "entity|link|list|defined" >
<!--
data types which require special handling - which don't simply map onto
common SQL data types
geopos : a latitude/longitude pair (experimental and not yet implemented)
image : a raster image file, in jpeg|gif|png format (experimental, not yet implemented)
message : an internationalised message, having different translations for different locales
-->
<!ENTITY % SpecialDataTypes "geopos|image|message" >
<!-- all data types -->
<!ENTITY % AllDataTypes "%ComplexDataTypes;|%SimpleDataTypes;|%SpecialDataTypes;" >
<!-- content, for things like pages (i.e. forms, lists, pages) -->
<!ENTITY % Content "head|top|foot" >
<!ENTITY % FieldStuff "field|fieldgroup|auxlist|verb">
<!ENTITY % PageContent "%Content;|%FieldStuff;" >
<!ENTITY % PageStuff "%PageContent;|permission|pragma" >
<!-- Properties for pages:
name: obviously, the name (URL stub) of the page
properties: the properties of the entity the page describes to be shown
as fields on the page
all: obviously, all properties (except the abstract primary key, if
present)
user-distinct: all properties which are user-distinct (NOTE: Not yet implemented)
listed: only those properties for which fields are explicitly listed
-->
<!ENTITY % PageAttrs
"name CDATA #REQUIRED
properties (all|user-distinct|listed) #REQUIRED" >
<!-- Actions for generators (mainly for keyfields - see entity 'generator', below
assigned: In manually-maintained code, you contract to assign a value
to this property before it is persisted.
guid: The system will supply a unique GUid value to this field
before it is persisted.
mannual: You contract to supply a generator class in manually maintained
code.
native: The database will supply a unique value to this field when it
is persisted; the value will be an integer. RECOMMENDED!
-->
<!ENTITY % GeneratorActions "assigned|guid|manual|native">
<!-- sequences for orderings of lists - see entity 'order'
canonical: Whatever the normal canonical ordering for this datatype is -
typically alpha-numeric, except for dates, etc.
reverse-canonical: The reverse of the above
possibly there should be some further values but I have no idea what these are
-->
<!ENTITY % Sequences "canonical|reverse-canonical">
<!-- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<!-- Elements -->
<!-- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<!--
the application that the document describes: required top level element
name: the name of this application
version: the version number of this application
revision: the revision of the ADL document
currency: the base monetary currency, in the form of an ISO 4217 three-letter code
xmlns: XML namespace, in case required
-->
<!ELEMENT application ( specification*, documentation?, content?, typedef*, group*, entity*)>
<!ATTLIST application
name CDATA #REQUIRED
version CDATA #IMPLIED
revision CDATA #IMPLIED
currency CDATA #IMPLIED
xmlns CDATA #IMPLIED>
<!--
the definition of a defined type. At this stage a defined type is either
a string in which case it must have size and pattern, or
a scalar in which case it must have minimum and/or maximum
pattern must be a regular expression as interpreted by org.apache.regexp.RE
minimum and maximum must be of appropriate format for the datatype specified.
Validation may be done client-side and/or server-side at application layer
and/or server side at database layer.
name: the name of this typedef
type: the simple type on which this defined type is based; must be
present unless in-implementation children are supplied
size: the data size of this defined type
pattern: a regular expression which values for this type must match
minimum: the minimum value for this type (if base type is scalar)
maximum: the maximum value for this type (if base type is scalar)
-->
<!ELEMENT typedef (documentation?, in-implementation*, help*) >
<!ATTLIST typedef
name CDATA #REQUIRED
type (%DefinableDataTypes;) #IMPLIED
size CDATA #IMPLIED
pattern CDATA #IMPLIED
minimum CDATA #IMPLIED
maximum CDATA #IMPLIED>
<!--
information about how to translate a type into types known to different target
languages. TODO: Once again I'm not wholly comfortable with the name; I'm not
really comfortable that this belongs in ADL at all.
target: the target language
value: the type to use in that target language
kind: OK, I confess I don't understand this, but Andrew needs it...
-->
<!ELEMENT in-implementation (documentation?)>
<!ATTLIST in-implementation
target CDATA #REQUIRED
value CDATA #REQUIRED
kind CDATA #IMPLIED>
<!--
a group of people with similar permissions to one another
name: the name of this group
parent: the name of a group of which this group is subset
-->
<!ELEMENT group (documentation?)>
<!ATTLIST group
name CDATA #REQUIRED
parent CDATA #IMPLIED>
<!--
an entity which has properties and relationships; maps onto a database
table or a Java serialisable class - or, of course, various other things
name: obviously, the name of this entity.
natural-key: if present, the name of a property of this entity which forms
a natural primary key [NOTE: Only partly implemented. NOTE: much of
the present implementation assumes all primary keys will be
integers. This needs to be fixed!] DEPRECATED: remove; replace with the
'key' element, below.
table: the name of the table in which this entity is stored. Defaults to same
as name of entity. Strongly recommend this is not used unless it needs
to be different from the name of the entity.
foreign: this entity is part of some other system; no code will be generated
for it, although code which links to it will be generated.
magnitude: The power of ten which approximates the expected number of records; thus
if ten records are expected, the magnitude is 1; if a million, the
magnitude is 6.
volatility: Number representing the anticipated rate of change of records in this
entity; if 0, results should never be cached; otherwise, a power of
10 representing the number of seconds the data may safely be cached.
thus 5 represents a cach time to live of 100,000 seconds, or slightly
more than one day.
-->
<!ELEMENT entity ( documentation?, prompt*, content?, key?,
property*, permission*, (form | page | list)*)>
<!ATTLIST entity
name CDATA #REQUIRED
natural-key CDATA #IMPLIED
table CDATA #IMPLIED
foreign %Boolean; #IMPLIED
magnitude CDATA #IMPLIED
volatility CDATA #IMPLIED>
<!--
contains documentation on the element which immediately contains it. TODO:
should HTML markup within a documentation element be allowed? If so, are
there restrictions? For now, no: instead I shall aim to support MarkDown
within documentation.
-->
<!ELEMENT documentation ( #PCDATA|reference|todo)*>
<!ATTLIST documentation
xmlns CDATA #IMPLIED>
<!-- a child of documentation, q.v., which allows TODO items to be identified.
-->
<!ELEMENT todo ( #PCDATA|reference)*>
<!ATTLIST todo
xmlns CDATA #IMPLIED>
<!-- an explicit primary key, possibly compound -->
<!ELEMENT key (property*)>
<!--
a property (field) of an entity (table)
name: the name of this property.
type: the type of this property.
default: the default value of this property. There will probably be
magic values of this!
typedef: name of the typedef to use, it type = 'defined'.
distinct: distinct='system' required that every value in the system
will be distinct (i.e. natural primary key);
distinct='user' implies that the value may be used by users
in distinguishing entities even if values are not formally
unique;
distinct='all' implies that the values are formally unique
/and/ are user friendly (NOTE: not implemented).
entity: if type='entity', the name of the entity this property is
a foreign key link to.
if type='list', the name of the entity that has a foreign
key link to this entity
farkey: if type='list', the name of farside key in the listed
entity; if type='entity' and the farside field to join to
is not the farside primary key, then the name of that
farside field
required: whether this propery is required (i.e. 'not null').
immutable: if true, once a value has been set it cannot be changed.
size: fieldwidth of the property if specified.
concrete: if set to 'false', this property is not stored in the
database but must be computed (manually written code must
be provided to support this)
cascade: what action(s) on the parent entity should be cascaded to
entitie(s) linked on this property. Valid only if type='entity',
type='link' or type='list'.
column: name of the column in a SQL database table in which this property
is stored. TODO: Think about this.
unsaved-value:
of a property whose persistent value is set on first being
committed to persistent store, the value which it holds before
it has been committed
-->
<!ELEMENT property ( documentation?, generator?, (permission|option|prompt|help|ifmissing)*)>
<!ATTLIST property
name CDATA #REQUIRED
type (%AllDataTypes;) #REQUIRED
default CDATA #IMPLIED
typedef CDATA #IMPLIED
distinct (none|all|user|system) #IMPLIED
entity CDATA #IMPLIED
farkey CDATA #IMPLIED
required %Boolean; #IMPLIED
immutable %Boolean; #IMPLIED
size CDATA #IMPLIED
column CDATA #IMPLIED
concrete %Boolean; #IMPLIED
cascade (%CascadeActions;) #IMPLIED>
<!--
marks a property which is auto-generated by some part of the system.
This is based on the Hibernate construct, except that the Hibernate
implementation folds both its internal generators and custom generators
onto the same attribute. This separates them onto two attributes so we
can police values for Hibernate's 'builtin' generators.
action: one of the supported Hibernate builtin generators, or
'manual'. 'native' is strongly recommended in most instances
class: if action is 'manual', the name of a manually maintained
class conforming to the Hibernate IdentifierGenerator
interface, or its equivalent in other languages
-->
<!ELEMENT generator (documentation?, param*)>
<!ATTLIST generator
action (%GeneratorActions;) #REQUIRED
class CDATA #IMPLIED>
<!--
A parameter passed to the generator. Again, based on the Hibernate
implementation. TODO: #PCDATA is wrong as the content model, as embedded
markup is definitely not allowed!
name: the name of this parameter
TODO: This needs to be renamed or removed because it conflicts with the
XHTML element of the same name. In fact it could be simply removed since
our usage is compatible with the XHTML usage, but it might be less
ambiguous to rename it.
-->
<!ELEMENT param (#PCDATA)>
<!ATTLIST param
name CDATA #REQUIRED>
<!--
one of an explicit list of optional values a property may have
NOTE: whether options get encoded at application layer or at database layer
is UNDEFINED; either behaviour is correct. If at database layer it's also
UNDEFINED whether they're encoded as a single reference data table or as
separate reference data tables for each property.
value: the value of this option
TODO: This needs to be renamed or removed because it conflicts with the
XHTML element of the same name. In fact it could be simply removed since
our usage is compatible with the XHTML usage, but it might be less
ambiguous to rename it.
-->
<!ELEMENT option (documentation?, prompt*)>
<!-- if the value is different from the prompt the user sees, specify it -->
<!ATTLIST option
value CDATA #IMPLIED>
<!--
permissions policy on an entity, a page, form, list or field
group: the group to which permission is granted
permission: the permission which is granted to that group
-->
<!ELEMENT permission (documentation?)>
<!ATTLIST permission
group CDATA #REQUIRED
permission (%Permissions;) #REQUIRED>
<!--
pragmatic advice to generators of lists and forms, in the form of
name/value pairs which may contain anything. Over time some pragmas
will become 'well known', but the whole point of having a pragma
architecture is that it is extensible.
-->
<!ELEMENT pragma (documentation?)>
<!ATTLIST pragma
name CDATA #REQUIRED
value CDATA #REQUIRED>
<!--
a prompt for a property or field; used as the prompt text for a widget
which edits it. Typically there will be only one of these per property
per locale; if there are more than one all those matching the locale may
be concatenated, or just one may be used.
prompt: the prompt to use
locale: the locale in which to prefer this prompt
-->
<!ELEMENT prompt (documentation?)>
<!ATTLIST prompt
prompt CDATA #REQUIRED
locale %Locale; #REQUIRED >
<!--
helptext about a property of an entity, or a field of a page, form or
list, or a typedef. Typically there will be only one of these per property
per locale; if there are more than one all those matching the locale may
be concatenated, or just one may be used.
locale: the locale in which to prefer this prompt
-->
<!ELEMENT help (#PCDATA)>
<!ATTLIST help
locale %Locale; #REQUIRED
xmlns CDATA #IMPLIED >
<!--
helpful text to be shown if a property value is missing, typically when
a form is submitted. Typically there will be only one of these per property
per locale; if there are more than one all those matching the locale may
be concatenated, or just one may be used. Later there may be more sophisticated
behaviour here.
-->
<!ELEMENT ifmissing (#PCDATA)>
<!ATTLIST ifmissing
locale %Locale; #REQUIRED
xmlns CDATA #IMPLIED>
<!-- a form through which an entity may be added or edited
TODO: This needs to be renamed because it conflicts with the
XHTML element of the same name.
-->
<!ELEMENT form (documentation?, ( %PageStuff;)*)>
<!ATTLIST form %PageAttrs;>
<!-- a page on which an entity may be displayed -->
<!ELEMENT page (documentation?, ( %PageStuff;)*)>
<!ATTLIST page %PageAttrs;>
<!-- an ordering or records in a list
property: the property on which to order
sequence: the sequence in which to order
-->
<!ELEMENT order (documentation?)>
<!ATTLIST order
property CDATA #REQUIRED
sequence (%Sequences;) #IMPLIED>
<!--
a list on which entities of a given type are listed
onselect: name of form/page/list to go to when
a selection is made from the list
-->
<!ELEMENT list (documentation?, ( %PageStuff;|order)*)>
<!ATTLIST list %PageAttrs;
onselect CDATA #IMPLIED >
<!--
a subsidiary list, on which entities related to primary
entities in the enclosing page or list are listed
property: the property of the enclosing entity that this
list displays (obviously, must be of type='list')
onselect: the form or page of the listed entity to call
when an item from the list is selected
canadd: true if the user should be able to add records
to this list
-->
<!ELEMENT auxlist (documentation?, (prompt|%FieldStuff;)*)>
<!ATTLIST auxlist %PageAttrs;
property CDATA #REQUIRED
onselect CDATA #IMPLIED
canadd %Boolean; #IMPLIED>
<!--
a group of fields and other controls within a form or list, which the
renderer might render as a single pane in a tabbed display, for example.
-->
<!ELEMENT fieldgroup (documentation?, (prompt|permission|%FieldStuff;)*)>
<!ATTLIST fieldgroup
name CDATA #REQUIRED>
<!-- a field in a form or page
property: the property which this field displays/edits
-->
<!ELEMENT field (documentation?, (prompt|help|permission)*) >
<!ATTLIST field
property CDATA #REQUIRED >
<!-- a verb is something that may be done through a form. Probably the verbs 'store'
and 'delete' are implied, but maybe they need to be explicitly declared. The 'verb'
attribute of the verb is what gets returned to the controller -->
<!ELEMENT verb (documentation?, (prompt|help|permission)*) >
<!ATTLIST verb
verb CDATA #REQUIRED
dangerous %Boolean; #REQUIRED>
<!-- a container for global content -->
<!ELEMENT content (%Content;)*>
<!--
content to place in the head of the generated document; this is #PCDATA
because it will almost certainly belong to a different namespace
(usually HTML)
TODO: This needs to be renamed or removed because it conflicts with the
XHTML element of the same name. In fact it could be simply removed since
our usage is compatible with the XHTML usage, but it might be less
ambiguous to rename it.
-->
<!ELEMENT head (#PCDATA) >
<!ATTLIST head
xmlns CDATA #IMPLIED>
<!--
content to place in the top of the body of the generated document;
this is %Flow; which is any HTML block or inline level element.
-->
<!ELEMENT top (#PCDATA) >
<!ATTLIST top
xmlns CDATA #IMPLIED>
<!--
content to place at the foot of the body of the generated document;
this is %Flow; which is any HTML block or inline level element.
-->
<!ELEMENT foot (#PCDATA) >
<!ATTLIST foot
xmlns CDATA #IMPLIED>
<!--
The 'specification' and 'reference' elements are for documentation only,
and do not contribute to the engineering of the application described.
A specification element is intended chiefly to declare the reference
documents which may be used in documentation elements later in the
document.
url: The URL from which the document referenced can be retrieved
name: The full name (title) given to this document
abbr: A convenient abbreviated name
-->
<!ELEMENT specification (documentation?, reference*)>
<!ATTLIST specification
url CDATA #IMPLIED
name CDATA #REQUIRED
abbr CDATA #REQUIRED
>
<!--
The 'specification' and 'reference' elements are for documentation only,
and do not contribute to the engineering of the application described.
A reference element is a reference to a specifying document.
abbr: The abbreviated name of the specification to which this
reference refers
section: The 'anchor part' (part following a hash character) which,
when appended to the URL, will locate the exact section
referenced.
entity: A reference to another entity within this ADL document
property: A reference to another property within this ADL document;
if entity is also specified then of that entity, else of
the ancestor entity if any
-->
<!ELEMENT reference (documentation?)>
<!ATTLIST reference
abbr CDATA #IMPLIED
section CDATA #IMPLIED
entity CDATA #IMPLIED
property CDATA #IMPLIED
>

View file

@ -0,0 +1,559 @@
<schema
xmlns='http://www.w3.org/2001/XMLSchema'
targetNamespace='http://www.w3.org/namespace/'
xmlns:t='http://www.w3.org/namespace/'>
<element name='application'>
<complexType>
<sequence>
<element ref='t:specification' minOccurs='0' maxOccurs='unbounded'/>
<element ref='t:documentation' minOccurs='0' maxOccurs='1'/>
<element ref='t:content' minOccurs='0' maxOccurs='1'/>
<element ref='t:typedef' minOccurs='0' maxOccurs='unbounded'/>
<element ref='t:group' minOccurs='0' maxOccurs='unbounded'/>
<element ref='t:entity' minOccurs='0' maxOccurs='unbounded'/>
</sequence>
<attribute name='name' type='string' use='required'/>
<attribute name='version' type='string' use='optional'/>
<attribute name='revision' type='string' use='optional'/>
<attribute name='currency' type='string' use='optional'/>
<attribute name='xmlns' type='string' use='optional'/>
</complexType>
</element>
<element name='typedef'>
<complexType>
<sequence>
<element ref='t:documentation' minOccurs='0' maxOccurs='1'/>
<element ref='t:in-implementation' minOccurs='0' maxOccurs='unbounded'/>
<element ref='t:help' minOccurs='0' maxOccurs='unbounded'/>
</sequence>
<attribute name='name' type='string' use='required'/>
<attribute name='type' use='optional'>
<simpleType>
<restriction base='string'>
<enumeration value='string'/>
<enumeration value='integer'/>
<enumeration value='real'/>
<enumeration value='money'/>
<enumeration value='date'/>
<enumeration value='time'/>
<enumeration value='timestamp'/>
<enumeration value='uploadable'/>
</restriction>
</simpleType>
</attribute>
<attribute name='size' type='string' use='optional'/>
<attribute name='pattern' type='string' use='optional'/>
<attribute name='minimum' type='string' use='optional'/>
<attribute name='maximum' type='string' use='optional'/>
</complexType>
</element>
<element name='in-implementation'>
<complexType>
<sequence>
<element ref='t:documentation' minOccurs='0' maxOccurs='1'/>
</sequence>
<attribute name='target' type='string' use='required'/>
<attribute name='value' type='string' use='required'/>
<attribute name='kind' type='string' use='optional'/>
</complexType>
</element>
<element name='group'>
<complexType>
<sequence>
<element ref='t:documentation' minOccurs='0' maxOccurs='1'/>
</sequence>
<attribute name='name' type='string' use='required'/>
<attribute name='parent' type='string' use='optional'/>
</complexType>
</element>
<element name='entity'>
<complexType>
<sequence>
<element ref='t:documentation' minOccurs='0' maxOccurs='1'/>
<element ref='t:prompt' minOccurs='0' maxOccurs='unbounded'/>
<element ref='t:content' minOccurs='0' maxOccurs='1'/>
<element ref='t:key' minOccurs='0' maxOccurs='1'/>
<element ref='t:property' minOccurs='0' maxOccurs='unbounded'/>
<element ref='t:permission' minOccurs='0' maxOccurs='unbounded'/>
<choice minOccurs='0' maxOccurs='unbounded'>
<element ref='t:form'/>
<element ref='t:page'/>
<element ref='t:list'/>
</choice>
</sequence>
<attribute name='name' type='string' use='required'/>
<attribute name='natural-key' type='string' use='optional'/>
<attribute name='table' type='string' use='optional'/>
<attribute name='foreign' use='optional'>
<simpleType>
<restriction base='string'>
<enumeration value='true'/>
<enumeration value='false'/>
</restriction>
</simpleType>
</attribute>
<attribute name='magnitude' type='string' use='optional'/>
<attribute name='volatility' type='string' use='optional'/>
</complexType>
</element>
<element name='documentation'>
<complexType mixed='true'>
<choice minOccurs='0' maxOccurs='unbounded'>
<element ref='t:reference'/>
<element ref='t:todo'/>
</choice>
<attribute name='xmlns' type='string' use='optional'/>
</complexType>
</element>
<element name='todo'>
<complexType mixed='true'>
<sequence minOccurs='0' maxOccurs='unbounded'>
<element ref='t:reference'/>
</sequence>
<attribute name='xmlns' type='string' use='optional'/>
</complexType>
</element>
<element name='key'>
<complexType>
<sequence>
<element ref='t:property' minOccurs='0' maxOccurs='unbounded'/>
</sequence>
</complexType>
</element>
<element name='property'>
<complexType>
<sequence>
<element ref='t:documentation' minOccurs='0' maxOccurs='1'/>
<element ref='t:generator' minOccurs='0' maxOccurs='1'/>
<choice minOccurs='0' maxOccurs='unbounded'>
<element ref='t:permission'/>
<element ref='t:option'/>
<element ref='t:prompt'/>
<element ref='t:help'/>
<element ref='t:ifmissing'/>
</choice>
</sequence>
<attribute name='name' type='string' use='required'/>
<attribute name='type' use='required'>
<simpleType>
<restriction base='string'>
<enumeration value='entity'/>
<enumeration value='link'/>
<enumeration value='list'/>
<enumeration value='defined'/>
<enumeration value='string'/>
<enumeration value='integer'/>
<enumeration value='real'/>
<enumeration value='money'/>
<enumeration value='date'/>
<enumeration value='time'/>
<enumeration value='timestamp'/>
<enumeration value='uploadable'/>
<enumeration value='boolean'/>
<enumeration value='text'/>
<enumeration value='geopos'/>
<enumeration value='image'/>
<enumeration value='message'/>
</restriction>
</simpleType>
</attribute>
<attribute name='default' type='string' use='optional'/>
<attribute name='typedef' type='string' use='optional'/>
<attribute name='distinct' use='optional'>
<simpleType>
<restriction base='string'>
<enumeration value='none'/>
<enumeration value='all'/>
<enumeration value='user'/>
<enumeration value='system'/>
</restriction>
</simpleType>
</attribute>
<attribute name='entity' type='string' use='optional'/>
<attribute name='farkey' type='string' use='optional'/>
<attribute name='required' use='optional'>
<simpleType>
<restriction base='string'>
<enumeration value='true'/>
<enumeration value='false'/>
</restriction>
</simpleType>
</attribute>
<attribute name='immutable' use='optional'>
<simpleType>
<restriction base='string'>
<enumeration value='true'/>
<enumeration value='false'/>
</restriction>
</simpleType>
</attribute>
<attribute name='size' type='string' use='optional'/>
<attribute name='column' type='string' use='optional'/>
<attribute name='concrete' use='optional'>
<simpleType>
<restriction base='string'>
<enumeration value='true'/>
<enumeration value='false'/>
</restriction>
</simpleType>
</attribute>
<attribute name='cascade' use='optional'>
<simpleType>
<restriction base='string'>
<enumeration value='all'/>
<enumeration value='all-delete-orphan'/>
<enumeration value='delete'/>
<enumeration value='manual'/>
<enumeration value='save-update'/>
</restriction>
</simpleType>
</attribute>
</complexType>
</element>
<element name='generator'>
<complexType>
<sequence>
<element ref='t:documentation' minOccurs='0' maxOccurs='1'/>
<element ref='t:param' minOccurs='0' maxOccurs='unbounded'/>
</sequence>
<attribute name='action' use='required'>
<simpleType>
<restriction base='string'>
<enumeration value='assigned'/>
<enumeration value='guid'/>
<enumeration value='manual'/>
<enumeration value='native'/>
</restriction>
</simpleType>
</attribute>
<attribute name='class' type='string' use='optional'/>
</complexType>
</element>
<element name='param'>
<complexType mixed='true'>
<attribute name='name' type='string' use='required'/>
</complexType>
</element>
<element name='option'>
<complexType>
<sequence>
<element ref='t:documentation' minOccurs='0' maxOccurs='1'/>
<element ref='t:prompt' minOccurs='0' maxOccurs='unbounded'/>
</sequence>
<attribute name='value' type='string' use='optional'/>
</complexType>
</element>
<element name='permission'>
<complexType>
<sequence>
<element ref='t:documentation' minOccurs='0' maxOccurs='1'/>
</sequence>
<attribute name='group' type='string' use='required'/>
<attribute name='permission' use='required'>
<simpleType>
<restriction base='string'>
<enumeration value='none'/>
<enumeration value='read'/>
<enumeration value='insert'/>
<enumeration value='noedit'/>
<enumeration value='edit'/>
<enumeration value='all'/>
</restriction>
</simpleType>
</attribute>
</complexType>
</element>
<element name='pragma'>
<complexType>
<sequence>
<element ref='t:documentation' minOccurs='0' maxOccurs='1'/>
</sequence>
<attribute name='name' type='string' use='required'/>
<attribute name='value' type='string' use='required'/>
</complexType>
</element>
<element name='prompt'>
<complexType>
<sequence>
<element ref='t:documentation' minOccurs='0' maxOccurs='1'/>
</sequence>
<attribute name='prompt' type='string' use='required'/>
<attribute name='locale' type='string' use='required'/>
</complexType>
</element>
<element name='help'>
<complexType mixed='true'>
<attribute name='locale' type='string' use='required'/>
<attribute name='xmlns' type='string' use='optional'/>
</complexType>
</element>
<element name='ifmissing'>
<complexType mixed='true'>
<attribute name='locale' type='string' use='required'/>
<attribute name='xmlns' type='string' use='optional'/>
</complexType>
</element>
<element name='form'>
<complexType>
<sequence>
<element ref='t:documentation' minOccurs='0' maxOccurs='1'/>
<choice minOccurs='0' maxOccurs='unbounded'>
<element ref='t:head'/>
<element ref='t:top'/>
<element ref='t:foot'/>
<element ref='t:field'/>
<element ref='t:fieldgroup'/>
<element ref='t:auxlist'/>
<element ref='t:verb'/>
<element ref='t:permission'/>
<element ref='t:pragma'/>
</choice>
</sequence>
<attribute name='name' type='string' use='required'/>
<attribute name='properties' use='required'>
<simpleType>
<restriction base='string'>
<enumeration value='all'/>
<enumeration value='user-distinct'/>
<enumeration value='listed'/>
</restriction>
</simpleType>
</attribute>
</complexType>
</element>
<element name='page'>
<complexType>
<sequence>
<element ref='t:documentation' minOccurs='0' maxOccurs='1'/>
<choice minOccurs='0' maxOccurs='unbounded'>
<element ref='t:head'/>
<element ref='t:top'/>
<element ref='t:foot'/>
<element ref='t:field'/>
<element ref='t:fieldgroup'/>
<element ref='t:auxlist'/>
<element ref='t:verb'/>
<element ref='t:permission'/>
<element ref='t:pragma'/>
</choice>
</sequence>
<attribute name='name' type='string' use='required'/>
<attribute name='properties' use='required'>
<simpleType>
<restriction base='string'>
<enumeration value='all'/>
<enumeration value='user-distinct'/>
<enumeration value='listed'/>
</restriction>
</simpleType>
</attribute>
</complexType>
</element>
<element name='order'>
<complexType>
<sequence>
<element ref='t:documentation' minOccurs='0' maxOccurs='1'/>
</sequence>
<attribute name='property' type='string' use='required'/>
<attribute name='sequence' use='optional'>
<simpleType>
<restriction base='string'>
<enumeration value='canonical'/>
<enumeration value='reverse-canonical'/>
</restriction>
</simpleType>
</attribute>
</complexType>
</element>
<element name='list'>
<complexType>
<sequence>
<element ref='t:documentation' minOccurs='0' maxOccurs='1'/>
<choice minOccurs='0' maxOccurs='unbounded'>
<element ref='t:head'/>
<element ref='t:top'/>
<element ref='t:foot'/>
<element ref='t:field'/>
<element ref='t:fieldgroup'/>
<element ref='t:auxlist'/>
<element ref='t:verb'/>
<element ref='t:permission'/>
<element ref='t:pragma'/>
<element ref='t:order'/>
</choice>
</sequence>
<attribute name='name' type='string' use='required'/>
<attribute name='properties' use='required'>
<simpleType>
<restriction base='string'>
<enumeration value='all'/>
<enumeration value='user-distinct'/>
<enumeration value='listed'/>
</restriction>
</simpleType>
</attribute>
<attribute name='onselect' type='string' use='optional'/>
</complexType>
</element>
<element name='auxlist'>
<complexType>
<sequence>
<element ref='t:documentation' minOccurs='0' maxOccurs='1'/>
<choice minOccurs='0' maxOccurs='unbounded'>
<element ref='t:prompt'/>
<element ref='t:field'/>
<element ref='t:fieldgroup'/>
<element ref='t:auxlist'/>
<element ref='t:verb'/>
</choice>
</sequence>
<attribute name='name' type='string' use='required'/>
<attribute name='properties' use='required'>
<simpleType>
<restriction base='string'>
<enumeration value='all'/>
<enumeration value='user-distinct'/>
<enumeration value='listed'/>
</restriction>
</simpleType>
</attribute>
<attribute name='property' type='string' use='required'/>
<attribute name='onselect' type='string' use='optional'/>
<attribute name='canadd' use='optional'>
<simpleType>
<restriction base='string'>
<enumeration value='true'/>
<enumeration value='false'/>
</restriction>
</simpleType>
</attribute>
</complexType>
</element>
<element name='fieldgroup'>
<complexType>
<sequence>
<element ref='t:documentation' minOccurs='0' maxOccurs='1'/>
<choice minOccurs='0' maxOccurs='unbounded'>
<element ref='t:prompt'/>
<element ref='t:permission'/>
<element ref='t:field'/>
<element ref='t:fieldgroup'/>
<element ref='t:auxlist'/>
<element ref='t:verb'/>
</choice>
</sequence>
<attribute name='name' type='string' use='required'/>
</complexType>
</element>
<element name='field'>
<complexType>
<sequence>
<element ref='t:documentation' minOccurs='0' maxOccurs='1'/>
<choice minOccurs='0' maxOccurs='unbounded'>
<element ref='t:prompt'/>
<element ref='t:help'/>
<element ref='t:permission'/>
</choice>
</sequence>
<attribute name='property' type='string' use='required'/>
</complexType>
</element>
<element name='verb'>
<complexType>
<sequence>
<element ref='t:documentation' minOccurs='0' maxOccurs='1'/>
<choice minOccurs='0' maxOccurs='unbounded'>
<element ref='t:prompt'/>
<element ref='t:help'/>
<element ref='t:permission'/>
</choice>
</sequence>
<attribute name='verb' type='string' use='required'/>
<attribute name='dangerous' use='required'>
<simpleType>
<restriction base='string'>
<enumeration value='true'/>
<enumeration value='false'/>
</restriction>
</simpleType>
</attribute>
</complexType>
</element>
<element name='content'>
<complexType>
<choice minOccurs='0' maxOccurs='unbounded'>
<element ref='t:head'/>
<element ref='t:top'/>
<element ref='t:foot'/>
</choice>
</complexType>
</element>
<element name='head'>
<complexType mixed='true'>
<attribute name='xmlns' type='string' use='optional'/>
</complexType>
</element>
<element name='top'>
<complexType mixed='true'>
<attribute name='xmlns' type='string' use='optional'/>
</complexType>
</element>
<element name='foot'>
<complexType mixed='true'>
<attribute name='xmlns' type='string' use='optional'/>
</complexType>
</element>
<element name='specification'>
<complexType>
<sequence>
<element ref='t:documentation' minOccurs='0' maxOccurs='1'/>
<element ref='t:reference' minOccurs='0' maxOccurs='unbounded'/>
</sequence>
<attribute name='url' type='string' use='optional'/>
<attribute name='name' type='string' use='required'/>
<attribute name='abbr' type='string' use='required'/>
</complexType>
</element>
<element name='reference'>
<complexType>
<sequence>
<element ref='t:documentation' minOccurs='0' maxOccurs='1'/>
</sequence>
<attribute name='abbr' type='string' use='optional'/>
<attribute name='section' type='string' use='optional'/>
<attribute name='entity' type='string' use='optional'/>
<attribute name='property' type='string' use='optional'/>
</complexType>
</element>
</schema>

View file

@ -2,17 +2,21 @@
the HTML pages implied by an ADL file."
:author "Simon Brooke"}
adl.to-selmer-templates
(:require [adl-support.core :refer :all]
[adl-support.forms-support :refer :all]
[adl.to-hugsql-queries :refer [expanded-token]]
[adl-support.utils :refer :all]
[clojure.java.io :refer [file make-parents resource]]
[clojure.pprint :as p]
[clojure.string :as s]
[clojure.xml :as x]
[clj-time.core :as t]
[clj-time.format :as f]
[hiccup.core :as h]))
(:require
[adl-support.core :refer [*warn* do-or-warn]]
[adl-support.forms-support :refer [auxlist-data-name]]
[adl-support.utils :refer [*output-path* *verbosity* all-properties
child-with-tag children children-with-tag
descendant-with-tag descendants-with-tag
editor-name entity-for-property find-permissions
key-names link-table? path-part pretty-name
prompt property-for-field safe-name typedef
user-distinct-properties visible-to writeable-by]]
[adl.to-hugsql-queries :refer [expanded-token]]
[clj-time.core :as t]
[clojure.java.io :refer [make-parents resource]]
[clojure.string :as s]
[clojure.xml :as x]))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;
@ -93,7 +97,7 @@
(children-with-tag
(child-with-tag application :content)
k))))]
(if
(when
content
(flatten
(list
@ -200,7 +204,7 @@
:name "save-button"
:class "action-safe"
:type "submit"
:value (str "Save!")}}]}
:value "Save!"}}]}
:editable
entity
application))
@ -231,7 +235,7 @@
:name "delete-button"
:class "action-dangerous"
:type "submit"
:value (str "Delete!")}}]}
:value "Delete!"}}]}
:editable
entity
application)
@ -327,8 +331,7 @@
SELECT, it needs some asynchronous fetching. See
[issue 47](https://github.com/simon-brooke/youyesyet/issues/47)."
[property form entity application]
(let [farname (:entity (:attrs property))
farside (entity-for-property property application)
(let [farside (entity-for-property property application)
magnitude (try
(read-string (:magnitude (:attrs farside)))
(catch Exception _ 7))
@ -338,7 +341,7 @@
:attrs (merge
{:id widget-name
:name widget-name}
(if
(when
(= (:type (:attrs property)) "link")
{:multiple "multiple"}))
:content (apply
@ -439,10 +442,10 @@
{:step 1}
nil)
;; TODO: should match pattern from typedef
(if
(when
(:minimum (:attrs typedef))
{:min (:minimum (:attrs typedef))})
(if
(when
(:maximum (:attrs typedef))
{:max (:maximum (:attrs typedef))}))})))
@ -465,7 +468,7 @@
nil)
typedef (typedef property application)
w-type (widget-type property application typedef)]
(if
(when
property
(case w-type
"hidden"
@ -601,7 +604,7 @@
(-> % :attrs :name)
(-> auxlist :attrs :property)))
farside (entity-for-property property application)]
(if
(when
(and property farside)
{:tag :div
:attrs {:class "auxlist"}
@ -790,7 +793,7 @@
#(=
"select"
(widget-type (property-for-field % entity) application))))
(if
(when
(child-with-tag
form :field
#(=
@ -983,7 +986,7 @@
[forms (children-with-tag entity :form)
pages (children-with-tag entity :page)
lists (children-with-tag entity :list)]
(if
(when
(and
(= (:tag entity) :entity) ;; it seems to be an ADL entity
(not (link-table? entity)))
@ -1092,7 +1095,7 @@
*output-path*
"resources/templates/auto/"
filename)]
(if
(when
template
(do-or-warn
(do
@ -1113,9 +1116,9 @@
"{% endblock %}"))
(keys template)))
(file-footer filename application)))))
(if
(when
(pos? *verbosity*)
(*warn* "\tGenerated " filepath))
(*warn* (str "\tGenerated " filepath)))
(str filepath))
(str "While generating " filepath)))))

View file

@ -61,80 +61,83 @@
'[ring.util.http-response :refer :all]
'[clojure.java.io :as io])))
;; TODO: This isn't working, it's breaking stuff, and I can't even remember
;; why I wanted it.
;; (declare def-routes)
;; (defn def-routes
;; "Generate Swagger routes for all queries implied by this ADL `application` spec."
;; ;; THIS ISN'T NEARLY FINISHED!
;; ([application]
;; (list 'defn 'auto-api-routes []
;; ["/api"
;; {:coercion spec-coercion/coercion
;; :muuntaja formats/instance
;; :swagger {:id ::api}
;; :middleware [;; query-params & form-params
;; parameters/parameters-middleware
;; ;; content-negotiation
;; muuntaja/format-negotiate-middleware
;; ;; encoding response body
;; muuntaja/format-response-middleware
;; ;; exception handling
;; exception/exception-middleware
;; ;; decoding request body
;; muuntaja/format-request-middleware
;; ;; coercing response bodys
;; coercion/coerce-response-middleware
;; ;; coercing request parameters
;; coercion/coerce-request-middleware
;; ;; multipart
;; multipart/multipart-middleware]}]
;; (map #(def-routes application %)
;; (children-with-tag application :entity)))
;; ([application entity]
;; [(str "/" (safe-name entity))
;; {:get (make-get-route entity)
;; (cons
;; 'defroutes
;; (cons
;; 'auto-rest-routes
;; (map
;; #(let [handler (handlers-map %)]
;; (list
;; (symbol (s/upper-case (name (:method handler))))
;; (str "/json/auto/" (safe-name (:name handler)))
;; 'request
;; (list
;; 'route/restricted
;; (list (:name handler) 'request))))
;; (sort
;; (keys handlers-map)))))}])))
(defn def-routes
"Generate Swagger routes for all queries implied by this ADL `application` spec."
;; THIS ISN'T NEARLY FINISHED!
([application]
(list 'defn 'auto-api-routes []
["/api"
{:coercion spec-coercion/coercion
:muuntaja formats/instance
:swagger {:id ::api}
:middleware [;; query-params & form-params
parameters/parameters-middleware
;; content-negotiation
muuntaja/format-negotiate-middleware
;; encoding response body
muuntaja/format-response-middleware
;; exception handling
exception/exception-middleware
;; decoding request body
muuntaja/format-request-middleware
;; coercing response bodys
coercion/coerce-response-middleware
;; coercing request parameters
coercion/coerce-request-middleware
;; multipart
multipart/multipart-middleware]}]
(map #(def-routes application %)
(children-with-tag application :entity)))
([application entity]
[(str "/" (safe-name entity))
{:get (make-get-route entity)
(cons
'defroutes
(cons
'auto-rest-routes
(map
#(let [handler (handlers-map %)]
(list
(symbol (s/upper-case (name (:method handler))))
(str "/json/auto/" (safe-name (:name handler)))
'request
(list
'route/restricted
(list (:name handler) 'request))))
(sort
(keys handlers-map)))))}])))
(defn to-swagger
"Generate a Swagger API for all queries implied by this ADL `application` spec."
[application]
(let [filepath (str
*output-path*
"src/"
(safe-name (:name (:attrs application)))
"/routes/auto_api.clj")]
(make-parents filepath)
(do-or-warn
(do
(spit
filepath
(s/join
"\n\n"
(cons
(file-header application)
(map
(fn [q]
(str
;; THIS ISN'T NEARLY FINISHED!
))
(sort
#(compare (:name %1) (:name %2))
(vals
(queries application)))))))
(if (pos? *verbosity*)
(*warn* (str "\tGenerated " filepath)))))))
;; (defn to-swagger
;; "Generate a Swagger API for all queries implied by this ADL `application` spec."
;; [application]
;; (let [filepath (str
;; *output-path*
;; "src/"
;; (safe-name (:name (:attrs application)))
;; "/routes/auto_api.clj")]
;; (make-parents filepath)
;; (do-or-warn
;; (do
;; (spit
;; filepath
;; (s/join
;; "\n\n"
;; (cons
;; (file-header application)
;; (map
;; (fn [q]
;; (str
;; ;; THIS ISN'T NEARLY FINISHED!
;; ))
;; (sort
;; #(compare (:name %1) (:name %2))
;; (vals
;; (queries application)))))))
;; (if (pos? *verbosity*)
;; (*warn* (str "\tGenerated " filepath)))))))