Compare commits
7 commits
Author | SHA1 | Date | |
---|---|---|---|
|
f1b6379934 | ||
|
6b7d43599a | ||
|
299802c2e5 | ||
|
35c061b519 | ||
|
4a37941899 | ||
|
ee5c576908 | ||
|
8fd2de90ce |
10
CHANGELOG.md
10
CHANGELOG.md
|
@ -1,17 +1,21 @@
|
||||||
# Change Log
|
# Change Log
|
||||||
All notable changes to this project will be documented in this file. This change log follows the conventions of [keepachangelog.com](http://keepachangelog.com/).
|
All notable changes to this project will be documented in this file. This change log follows the conventions of [keepachangelog.com](http://keepachangelog.com/).
|
||||||
|
|
||||||
## 0.1.4 - 2018-0922
|
## 0.1.5 - 2018-0922
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
Mainly documentation and tidy-up; Beta release.
|
Mainly documentation and tidy-up; Beta release.
|
||||||
|
|
||||||
|
[0.1.5]: https://github.com/simon_brooke/adl-support/compare/0.1.4...0.1.5
|
||||||
|
|
||||||
## 0.1.4 - 2018-09-20
|
## 0.1.4 - 2018-09-20
|
||||||
This is not anticipated to be the actual Beta release; it's a dummy run to test the release and deployment process. Some required features are still missing.
|
This is not anticipated to be the actual Beta release; it's a dummy run to test the release and deployment process. Some required features are still missing.
|
||||||
|
|
||||||
|
[0.1.4]: https://github.com/simon_brooke/adl-support/compare/0.1.0...0.1.4
|
||||||
|
|
||||||
## 0.1.0 - 2018-06-17
|
## 0.1.0 - 2018-06-17
|
||||||
### Added
|
### Added
|
||||||
Initial release.
|
Initial release.
|
||||||
|
|
||||||
[Unreleased]: https://github.com/your-name/adl-support/compare/0.1.1...HEAD
|
[Unreleased]: https://github.com/simon_brooke/adl-support/compare/0.1.1...HEAD
|
||||||
[0.1.1]: https://github.com/your-name/adl-support/compare/0.1.0...0.1.1
|
[0.1.1]: https://github.com/simon_brooke/adl-support/compare/0.1.0...0.1.1
|
||||||
|
|
|
@ -1,28 +0,0 @@
|
||||||
<!DOCTYPE html PUBLIC ""
|
|
||||||
"">
|
|
||||||
<html><head><meta charset="UTF-8" /><title>adl-support.core 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-support</span> <span class="project-version">0.1.4-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">Topics</span></h3><ul><li class="depth-1 "><a href="intro.html"><div class="inner"><span>Introduction to adl-support</span></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-support</span></div></div></li><li class="depth-2 branch current"><a href="adl-support.core.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>core</span></div></a></li><li class="depth-2 branch"><a href="adl-support.filters.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>filters</span></div></a></li><li class="depth-2 branch"><a href="adl-support.forms-support.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>forms-support</span></div></a></li><li class="depth-2 branch"><a href="adl-support.print-usage.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>print-usage</span></div></a></li><li class="depth-2 branch"><a href="adl-support.rest-support.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rest-support</span></div></a></li><li class="depth-2 branch"><a href="adl-support.tags.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>tags</span></div></a></li><li class="depth-2"><a href="adl-support.utils.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>utils</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-support.core.html#var-*warn*"><div class="inner"><span>*warn*</span></div></a></li><li class="depth-1"><a href="adl-support.core.html#var-compose-exception-reason"><div class="inner"><span>compose-exception-reason</span></div></a></li><li class="depth-1"><a href="adl-support.core.html#var-compose-reason-and-log"><div class="inner"><span>compose-reason-and-log</span></div></a></li><li class="depth-1"><a href="adl-support.core.html#var-do-or-log-and-return-reason"><div class="inner"><span>do-or-log-and-return-reason</span></div></a></li><li class="depth-1"><a href="adl-support.core.html#var-do-or-log-error"><div class="inner"><span>do-or-log-error</span></div></a></li><li class="depth-1"><a href="adl-support.core.html#var-do-or-return-reason"><div class="inner"><span>do-or-return-reason</span></div></a></li><li class="depth-1"><a href="adl-support.core.html#var-do-or-warn"><div class="inner"><span>do-or-warn</span></div></a></li><li class="depth-1"><a href="adl-support.core.html#var-do-or-warn-and-log"><div class="inner"><span>do-or-warn-and-log</span></div></a></li><li class="depth-1"><a href="adl-support.core.html#var-massage-params"><div class="inner"><span>massage-params</span></div></a></li><li class="depth-1"><a href="adl-support.core.html#var-massage-value"><div class="inner"><span>massage-value</span></div></a></li><li class="depth-1"><a href="adl-support.core.html#var-raw-massage-params"><div class="inner"><span>raw-massage-params</span></div></a></li><li class="depth-1"><a href="adl-support.core.html#var-raw-resolve-template"><div class="inner"><span>raw-resolve-template</span></div></a></li><li class="depth-1"><a href="adl-support.core.html#var-resolve-template"><div class="inner"><span>resolve-template</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">adl-support.core</h1><div class="doc"><pre class="plaintext">Application Description Language support - utility functions likely
|
|
||||||
to be useful in user-written code.</pre></div><div class="public anchor" id="var-*warn*"><h3>*warn*</h3><h4 class="dynamic">dynamic</h4><div class="usage"></div><div class="doc"><pre class="plaintext">The idea here is to have a function with which to show warnings to the user,
|
|
||||||
which can be dynamically bound. Any binding should be a function of one
|
|
||||||
argument, which it should print, log, or otherwise display.</pre></div></div><div class="public anchor" id="var-compose-exception-reason"><h3>compose-exception-reason</h3><h4 class="type">macro</h4><div class="usage"><code>(compose-exception-reason exception intro)</code><code>(compose-exception-reason exception)</code></div><div class="doc"><pre class="plaintext">Compose and return a sensible reason message for this `exception`.
|
|
||||||
</pre></div></div><div class="public anchor" id="var-compose-reason-and-log"><h3>compose-reason-and-log</h3><h4 class="type">macro</h4><div class="usage"><code>(compose-reason-and-log exception intro)</code><code>(compose-reason-and-log exception)</code></div><div class="doc"><pre class="plaintext">Compose a reason message for this `exception`, log it (with its
|
|
||||||
stacktrace), and return the reason message.</pre></div></div><div class="public anchor" id="var-do-or-log-and-return-reason"><h3>do-or-log-and-return-reason</h3><h4 class="type">macro</h4><div class="usage"><code>(do-or-log-and-return-reason form)</code></div><div class="doc"><pre class="plaintext">Clojure stacktraces are unreadable. We have to do better; evaluate
|
|
||||||
this `form` in a try-catch block; return a map. If the evaluation
|
|
||||||
succeeds, the map will have a key `:result` whose value is the result;
|
|
||||||
otherwise it will have a key `:error` which will be bound to the most
|
|
||||||
sensible error message we can construct. Additionally, log the exception</pre></div></div><div class="public anchor" id="var-do-or-log-error"><h3>do-or-log-error</h3><h4 class="type">macro</h4><div class="usage"><code>(do-or-log-error form & {:keys [message error-return], :or {message (clojure.core/seq (clojure.core/concat (clojure.core/list (quote clojure.core/str)) (clojure.core/list "A failure occurred in ") (clojure.core/list (list (quote quote) form))))}})</code></div><div class="doc"><pre class="plaintext">Evaluate the supplied `form` in a try/catch block. If the
|
|
||||||
keyword param `:message` is supplied, the value will be used
|
|
||||||
as the log message; if the keyword param `:error-return` is
|
|
||||||
supplied, the value will be returned if an exception is caught.</pre></div></div><div class="public anchor" id="var-do-or-return-reason"><h3>do-or-return-reason</h3><h4 class="type">macro</h4><div class="usage"><code>(do-or-return-reason form intro)</code><code>(do-or-return-reason form)</code></div><div class="doc"><pre class="plaintext">Clojure stacktraces are unreadable. We have to do better; evaluate
|
|
||||||
this `form` in a try-catch block; return a map. If the evaluation
|
|
||||||
succeeds, the map will have a key `:result` whose value is the result;
|
|
||||||
otherwise it will have a key `:error` which will be bound to the most
|
|
||||||
sensible error message we can construct.</pre></div></div><div class="public anchor" id="var-do-or-warn"><h3>do-or-warn</h3><h4 class="type">macro</h4><div class="usage"><code>(do-or-warn form)</code><code>(do-or-warn form intro)</code></div><div class="doc"><pre class="plaintext">Evaluate this `form`; if any exception is thrown, show it to the user
|
|
||||||
via the `*warn*` mechanism.</pre></div></div><div class="public anchor" id="var-do-or-warn-and-log"><h3>do-or-warn-and-log</h3><h4 class="type">macro</h4><div class="usage"><code>(do-or-warn-and-log form)</code><code>(do-or-warn-and-log form intro)</code></div><div class="doc"><pre class="plaintext">Evaluate this `form`; if any exception is thrown, log the reason and
|
|
||||||
show it to the user via the `*warn*` mechanism.</pre></div></div><div class="public anchor" id="var-massage-params"><h3>massage-params</h3><div class="usage"></div><div class="doc"><pre class="plaintext">Sending empty strings, or numbers as strings, to the database often isn't
|
|
||||||
helpful. Massage these `params` and `form-params` to eliminate these problems.
|
|
||||||
We must take key field values out of just params, but we should take all other
|
|
||||||
values out of form-params - because we need the key to load the form in
|
|
||||||
the first place, but just accepting values of other params would allow spoofing.</pre></div></div><div class="public anchor" id="var-massage-value"><h3>massage-value</h3><div class="usage"><code>(massage-value k m)</code></div><div class="doc"><pre class="plaintext">Return a map with one key, this `k` as a keyword, whose value is the binding of
|
|
||||||
`k` in map `m`, as read by read.</pre></div></div><div class="public anchor" id="var-raw-massage-params"><h3>raw-massage-params</h3><div class="usage"><code>(raw-massage-params request entity)</code><code>(raw-massage-params request)</code></div><div class="doc"><pre class="plaintext">Sending empty strings, or numbers as strings, to the database often isn't
|
|
||||||
helpful. Massage these `params` and `form-params` to eliminate these problems.
|
|
||||||
Date and time fields also need massaging.</pre></div></div><div class="public anchor" id="var-raw-resolve-template"><h3>raw-resolve-template</h3><div class="usage"><code>(raw-resolve-template n)</code></div><div class="doc"><pre class="plaintext">FIXME: write docs</pre></div></div><div class="public anchor" id="var-resolve-template"><h3>resolve-template</h3><div class="usage"></div><div class="doc"><pre class="plaintext">FIXME: write docs</pre></div></div></div></body></html>
|
|
|
@ -1,7 +0,0 @@
|
||||||
<!DOCTYPE html PUBLIC ""
|
|
||||||
"">
|
|
||||||
<html><head><meta charset="UTF-8" /><title>adl-support.filters 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-support</span> <span class="project-version">0.1.4-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">Topics</span></h3><ul><li class="depth-1 "><a href="intro.html"><div class="inner"><span>Introduction to adl-support</span></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-support</span></div></div></li><li class="depth-2 branch"><a href="adl-support.core.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>core</span></div></a></li><li class="depth-2 branch current"><a href="adl-support.filters.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>filters</span></div></a></li><li class="depth-2 branch"><a href="adl-support.forms-support.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>forms-support</span></div></a></li><li class="depth-2 branch"><a href="adl-support.print-usage.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>print-usage</span></div></a></li><li class="depth-2 branch"><a href="adl-support.rest-support.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rest-support</span></div></a></li><li class="depth-2 branch"><a href="adl-support.tags.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>tags</span></div></a></li><li class="depth-2"><a href="adl-support.utils.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>utils</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-support.filters.html#var-*default-international-dialing-prefix*"><div class="inner"><span>*default-international-dialing-prefix*</span></div></a></li><li class="depth-1"><a href="adl-support.filters.html#var-email"><div class="inner"><span>email</span></div></a></li><li class="depth-1"><a href="adl-support.filters.html#var-telephone"><div class="inner"><span>telephone</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">adl-support.filters</h1><div class="doc"><pre class="plaintext">Application Description Language support - custom Selmer filters
|
|
||||||
used in generated templates.</pre></div><div class="public anchor" id="var-*default-international-dialing-prefix*"><h3>*default-international-dialing-prefix*</h3><h4 class="dynamic">dynamic</h4><div class="usage"></div><div class="doc"><pre class="plaintext">The international dialing prefix to use, if none is specified.
|
|
||||||
</pre></div></div><div class="public anchor" id="var-email"><h3>email</h3><div class="usage"><code>(email arg)</code></div><div class="doc"><pre class="plaintext">If `arg` is, or appears to be, a valid email address, convert it into
|
|
||||||
a `mailto:` link, else leave it be.</pre></div></div><div class="public anchor" id="var-telephone"><h3>telephone</h3><div class="usage"><code>(telephone arg)</code></div><div class="doc"><pre class="plaintext">If `arg` is, or appears to be, a valid telephone number, convert it into
|
|
||||||
a `tel:` link, else leave it be.</pre></div></div></div></body></html>
|
|
|
@ -1,15 +0,0 @@
|
||||||
<!DOCTYPE html PUBLIC ""
|
|
||||||
"">
|
|
||||||
<html><head><meta charset="UTF-8" /><title>adl-support.forms-support 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-support</span> <span class="project-version">0.1.4-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">Topics</span></h3><ul><li class="depth-1 "><a href="intro.html"><div class="inner"><span>Introduction to adl-support</span></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-support</span></div></div></li><li class="depth-2 branch"><a href="adl-support.core.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>core</span></div></a></li><li class="depth-2 branch"><a href="adl-support.filters.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>filters</span></div></a></li><li class="depth-2 branch current"><a href="adl-support.forms-support.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>forms-support</span></div></a></li><li class="depth-2 branch"><a href="adl-support.print-usage.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>print-usage</span></div></a></li><li class="depth-2 branch"><a href="adl-support.rest-support.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rest-support</span></div></a></li><li class="depth-2 branch"><a href="adl-support.tags.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>tags</span></div></a></li><li class="depth-2"><a href="adl-support.utils.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>utils</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-support.forms-support.html#var-all-keys-present.3F"><div class="inner"><span>all-keys-present?</span></div></a></li><li class="depth-1"><a href="adl-support.forms-support.html#var-auxlist-data-name"><div class="inner"><span>auxlist-data-name</span></div></a></li><li class="depth-1"><a href="adl-support.forms-support.html#var-get-current-value"><div class="inner"><span>get-current-value</span></div></a></li><li class="depth-1"><a href="adl-support.forms-support.html#var-get-menu-options"><div class="inner"><span>get-menu-options</span></div></a></li><li class="depth-1"><a href="adl-support.forms-support.html#var-prepare-insertion-params"><div class="inner"><span>prepare-insertion-params</span></div></a></li><li class="depth-1"><a href="adl-support.forms-support.html#var-property-defaults"><div class="inner"><span>property-defaults</span></div></a></li><li class="depth-1"><a href="adl-support.forms-support.html#var-query-name"><div class="inner"><span>query-name</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">adl-support.forms-support</h1><div class="doc"><pre class="plaintext">Application Description Language support - functions useful in
|
|
||||||
generating forms.</pre></div><div class="public anchor" id="var-all-keys-present.3F"><h3>all-keys-present?</h3><h4 class="type">macro</h4><div class="usage"><code>(all-keys-present? m keys)</code></div><div class="doc"><pre class="plaintext">Return true if all the keys in `keys` are present in the map `m`.
|
|
||||||
</pre></div></div><div class="public anchor" id="var-auxlist-data-name"><h3>auxlist-data-name</h3><h4 class="type">macro</h4><div class="usage"><code>(auxlist-data-name auxlist)</code></div><div class="doc"><pre class="plaintext">The name to which data for this `auxlist` will be bound in the
|
|
||||||
Selmer params.</pre></div></div><div class="public anchor" id="var-get-current-value"><h3>get-current-value</h3><h4 class="type">macro</h4><div class="usage"><code>(get-current-value f params entity-name)</code></div><div class="doc"><pre class="plaintext">Use the function `f` and these `params` to fetch an `entity` record from the database.
|
|
||||||
</pre></div></div><div class="public anchor" id="var-get-menu-options"><h3>get-menu-options</h3><h4 class="type">macro</h4><div class="usage"><code>(get-menu-options entity-name get-q list-q fk value)</code></div><div class="doc"><pre class="plaintext">Fetch options for a menu of `entity-name` from the database, using this
|
|
||||||
`get-q` query and this `list-q` query, using the key `fk`, where the current
|
|
||||||
value is this `value`.</pre></div></div><div class="public anchor" id="var-prepare-insertion-params"><h3>prepare-insertion-params</h3><h4 class="type">macro</h4><div class="usage"><code>(prepare-insertion-params params fields)</code></div><div class="doc"><pre class="plaintext">Params for insertion into the database must have keys for all fields in the
|
|
||||||
insert query, even if the value of some of those keys is nil. Massage these
|
|
||||||
`params` to have a value for each field in these `fields`.</pre></div></div><div class="public anchor" id="var-property-defaults"><h3>property-defaults</h3><div class="usage"><code>(property-defaults entity)</code></div><div class="doc"><pre class="plaintext">Get a map of property names and default values for all properties of this
|
|
||||||
`entity` which have explicit defaults.</pre></div></div><div class="public anchor" id="var-query-name"><h3>query-name</h3><div class="usage"><code>(query-name entity-or-name q-type)</code></div><div class="doc"><pre class="plaintext">Generate a query name for the query of type `q-type` (expected to be one
|
|
||||||
of `:create`, `:delete`, `:get`, `:list`, `:search-strings`, `:update`) of
|
|
||||||
the entity `entity-or-name` NOTE: if `entity-or-name` is passed as a string,
|
|
||||||
it should be the full, unaltered name of the entity.</pre></div></div></div></body></html>
|
|
|
@ -1,8 +0,0 @@
|
||||||
<!DOCTYPE html PUBLIC ""
|
|
||||||
"">
|
|
||||||
<html><head><meta charset="UTF-8" /><title>adl-support.print-usage 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-support</span> <span class="project-version">0.1.4-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">Topics</span></h3><ul><li class="depth-1 "><a href="intro.html"><div class="inner"><span>Introduction to adl-support</span></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-support</span></div></div></li><li class="depth-2 branch"><a href="adl-support.core.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>core</span></div></a></li><li class="depth-2 branch"><a href="adl-support.filters.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>filters</span></div></a></li><li class="depth-2 branch"><a href="adl-support.forms-support.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>forms-support</span></div></a></li><li class="depth-2 branch current"><a href="adl-support.print-usage.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>print-usage</span></div></a></li><li class="depth-2 branch"><a href="adl-support.rest-support.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rest-support</span></div></a></li><li class="depth-2 branch"><a href="adl-support.tags.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>tags</span></div></a></li><li class="depth-2"><a href="adl-support.utils.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>utils</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-support.print-usage.html#var-print-usage"><div class="inner"><span>print-usage</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">adl-support.print-usage</h1><div class="doc"><pre class="plaintext">Application Description Language support - print a usage message.
|
|
||||||
</pre></div><div class="public anchor" id="var-print-usage"><h3>print-usage</h3><div class="usage"><code>(print-usage project-name parsed-options)</code><code>(print-usage project-name parsed-options extra-args)</code></div><div class="doc"><pre class="plaintext">Print a UN*X style usage message. `project-name` should be the base name of
|
|
||||||
the executable jar file you generate, `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>. If
|
|
||||||
`extra-args` is supplied, it should be a map of name, documentation pairs
|
|
||||||
for each additional argument which may be supplied.</pre></div></div></div></body></html>
|
|
|
@ -1,9 +0,0 @@
|
||||||
<!DOCTYPE html PUBLIC ""
|
|
||||||
"">
|
|
||||||
<html><head><meta charset="UTF-8" /><title>adl-support.rest-support 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-support</span> <span class="project-version">0.1.4-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">Topics</span></h3><ul><li class="depth-1 "><a href="intro.html"><div class="inner"><span>Introduction to adl-support</span></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-support</span></div></div></li><li class="depth-2 branch"><a href="adl-support.core.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>core</span></div></a></li><li class="depth-2 branch"><a href="adl-support.filters.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>filters</span></div></a></li><li class="depth-2 branch"><a href="adl-support.forms-support.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>forms-support</span></div></a></li><li class="depth-2 branch"><a href="adl-support.print-usage.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>print-usage</span></div></a></li><li class="depth-2 branch current"><a href="adl-support.rest-support.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rest-support</span></div></a></li><li class="depth-2 branch"><a href="adl-support.tags.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>tags</span></div></a></li><li class="depth-2"><a href="adl-support.utils.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>utils</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-support.rest-support.html#var-do-or-server-fail"><div class="inner"><span>do-or-server-fail</span></div></a></li><li class="depth-1"><a href="adl-support.rest-support.html#var-if-valid-user"><div class="inner"><span>if-valid-user</span></div></a></li><li class="depth-1"><a href="adl-support.rest-support.html#var-valid-user-or-forbid"><div class="inner"><span>valid-user-or-forbid</span></div></a></li><li class="depth-1"><a href="adl-support.rest-support.html#var-with-params-or-error"><div class="inner"><span>with-params-or-error</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">adl-support.rest-support</h1><div class="doc"><pre class="plaintext">Application Description Language support - functions useful in
|
|
||||||
generating JSON route handlers.</pre></div><div class="public anchor" id="var-do-or-server-fail"><h3>do-or-server-fail</h3><h4 class="type">macro</h4><div class="usage"><code>(do-or-server-fail form status)</code></div><div class="doc"><pre class="plaintext">Evaluate this `form`; if it succeeds, return an HTTP response with this
|
|
||||||
status code and the JSON-formatted result as body; if it fails, return an
|
|
||||||
HTTP 500 response.</pre></div></div><div class="public anchor" id="var-if-valid-user"><h3>if-valid-user</h3><h4 class="type">macro</h4><div class="usage"><code>(if-valid-user form request error-return)</code><code>(if-valid-user form request)</code></div><div class="doc"><pre class="plaintext">Evaluate this `form` only if there is a valid user in the session of
|
|
||||||
this `request`; otherwise return the `error-return` value.</pre></div></div><div class="public anchor" id="var-valid-user-or-forbid"><h3>valid-user-or-forbid</h3><h4 class="type">macro</h4><div class="usage"><code>(valid-user-or-forbid form request)</code></div><div class="doc"><pre class="plaintext">Evaluate this `form` only if there is a valid user in the session of
|
|
||||||
this `request`; otherwise return an HTTP forbidden response.</pre></div></div><div class="public anchor" id="var-with-params-or-error"><h3>with-params-or-error</h3><h4 class="type">macro</h4><div class="usage"><code>(with-params-or-error form params required)</code></div><div class="doc"><pre class="plaintext">Evaluate this `form` only if these `params` contain all these `required` keys;
|
|
||||||
otherwise return an HTTP 400 response.</pre></div></div></div></body></html>
|
|
|
@ -1,5 +0,0 @@
|
||||||
<!DOCTYPE html PUBLIC ""
|
|
||||||
"">
|
|
||||||
<html><head><meta charset="UTF-8" /><title>adl-support.tags 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-support</span> <span class="project-version">0.1.4-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">Topics</span></h3><ul><li class="depth-1 "><a href="intro.html"><div class="inner"><span>Introduction to adl-support</span></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-support</span></div></div></li><li class="depth-2 branch"><a href="adl-support.core.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>core</span></div></a></li><li class="depth-2 branch"><a href="adl-support.filters.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>filters</span></div></a></li><li class="depth-2 branch"><a href="adl-support.forms-support.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>forms-support</span></div></a></li><li class="depth-2 branch"><a href="adl-support.print-usage.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>print-usage</span></div></a></li><li class="depth-2 branch"><a href="adl-support.rest-support.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rest-support</span></div></a></li><li class="depth-2 branch current"><a href="adl-support.tags.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>tags</span></div></a></li><li class="depth-2"><a href="adl-support.utils.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>utils</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-support.tags.html#var-add-tags"><div class="inner"><span>add-tags</span></div></a></li><li class="depth-1"><a href="adl-support.tags.html#var-if-member-of-permitted"><div class="inner"><span>if-member-of-permitted</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">adl-support.tags</h1><div class="doc"><pre class="plaintext">Application Description Language support - custom Selmer tags used
|
|
||||||
in generated templates.</pre></div><div class="public anchor" id="var-add-tags"><h3>add-tags</h3><div class="usage"><code>(add-tags)</code></div><div class="doc"><pre class="plaintext">FIXME: write docs</pre></div></div><div class="public anchor" id="var-if-member-of-permitted"><h3>if-member-of-permitted</h3><div class="usage"><code>(if-member-of-permitted args context success failure)</code></div><div class="doc"><pre class="plaintext">If at least one of these `args` matches some group name in the `:user-roles`
|
|
||||||
of this `context`, return this `success`, else this `failure`.</pre></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
|
@ -1,4 +0,0 @@
|
||||||
<!DOCTYPE html PUBLIC ""
|
|
||||||
"">
|
|
||||||
<html><head><meta charset="UTF-8" /><title>Introduction to adl-support</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-support</span> <span class="project-version">0.1.4-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">Topics</span></h3><ul><li class="depth-1 current"><a href="intro.html"><div class="inner"><span>Introduction to adl-support</span></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-support</span></div></div></li><li class="depth-2 branch"><a href="adl-support.core.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>core</span></div></a></li><li class="depth-2 branch"><a href="adl-support.filters.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>filters</span></div></a></li><li class="depth-2 branch"><a href="adl-support.forms-support.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>forms-support</span></div></a></li><li class="depth-2 branch"><a href="adl-support.print-usage.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>print-usage</span></div></a></li><li class="depth-2 branch"><a href="adl-support.rest-support.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rest-support</span></div></a></li><li class="depth-2 branch"><a href="adl-support.tags.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>tags</span></div></a></li><li class="depth-2"><a href="adl-support.utils.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>utils</span></div></a></li></ul></div><div class="document" id="content"><div class="doc"><div class="markdown"><h1><a href="#introduction-to-adl-support" name="introduction-to-adl-support"></a>Introduction to adl-support</h1>
|
|
||||||
<p><code>adl-support</code> is a small library of functions used by the <a href="https://github.com/simon-brooke/adl">Application Description Language</a> system to generate elements of a Clojure web-app, which may be useful to people writing web-apps either based on Application Description Language or otherwise.</p></div></div></div></body></html>
|
|
|
@ -1,6 +0,0 @@
|
||||||
# Introduction to adl-support
|
|
||||||
|
|
||||||
`adl-support` is a small library of functions used by the [Application
|
|
||||||
Description Language](https://github.com/simon-brooke/adl) system to generate
|
|
||||||
elements of a Clojure web-app, which may be useful to people writing web-apps
|
|
||||||
either based on Application Description Language or otherwise.
|
|
3
docs/adl-support.core.html
Normal file
3
docs/adl-support.core.html
Normal file
File diff suppressed because one or more lines are too long
3
docs/adl-support.filters.html
Normal file
3
docs/adl-support.filters.html
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<!DOCTYPE html PUBLIC ""
|
||||||
|
"">
|
||||||
|
<html><head><meta charset="UTF-8" /><title>adl-support.filters 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-support</span> <span class="project-version">0.1.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-support</span></div></div></li><li class="depth-2 branch"><a href="adl-support.core.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>core</span></div></a></li><li class="depth-2 branch current"><a href="adl-support.filters.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>filters</span></div></a></li><li class="depth-2 branch"><a href="adl-support.forms-support.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>forms-support</span></div></a></li><li class="depth-2 branch"><a href="adl-support.print-usage.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>print-usage</span></div></a></li><li class="depth-2 branch"><a href="adl-support.rest-support.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rest-support</span></div></a></li><li class="depth-2 branch"><a href="adl-support.tags.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>tags</span></div></a></li><li class="depth-2"><a href="adl-support.utils.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>utils</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-support.filters.html#var-*default-international-dialing-prefix*"><div class="inner"><span>*default-international-dialing-prefix*</span></div></a></li><li class="depth-1"><a href="adl-support.filters.html#var-contains"><div class="inner"><span>contains</span></div></a></li><li class="depth-1"><a href="adl-support.filters.html#var-email"><div class="inner"><span>email</span></div></a></li><li class="depth-1"><a href="adl-support.filters.html#var-telephone"><div class="inner"><span>telephone</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">adl-support.filters</h1><div class="doc"><div class="markdown"><p>Application Description Language support - custom Selmer filters used in generated templates.</p></div></div><div class="public anchor" id="var-*default-international-dialing-prefix*"><h3>*default-international-dialing-prefix*</h3><h4 class="dynamic">dynamic</h4><div class="usage"></div><div class="doc"><div class="markdown"><p>The international dialing prefix to use, if none is specified.</p></div></div></div><div class="public anchor" id="var-contains"><h3>contains</h3><div class="usage"><code>(contains collection value)</code></div><div class="doc"><div class="markdown"><p>FIXME: write docs</p></div></div></div><div class="public anchor" id="var-email"><h3>email</h3><div class="usage"><code>(email arg)</code></div><div class="doc"><div class="markdown"><p>If <code>arg</code> is, or appears to be, a valid email address, convert it into a <code>mailto:</code> link, else leave it be.</p></div></div></div><div class="public anchor" id="var-telephone"><h3>telephone</h3><div class="usage"><code>(telephone arg)</code></div><div class="doc"><div class="markdown"><p>If <code>arg</code> is, or appears to be, a valid telephone number, convert it into a <code>tel:</code> link, else leave it be.</p></div></div></div></div></body></html>
|
3
docs/adl-support.forms-support.html
Normal file
3
docs/adl-support.forms-support.html
Normal file
File diff suppressed because one or more lines are too long
3
docs/adl-support.print-usage.html
Normal file
3
docs/adl-support.print-usage.html
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<!DOCTYPE html PUBLIC ""
|
||||||
|
"">
|
||||||
|
<html><head><meta charset="UTF-8" /><title>adl-support.print-usage 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-support</span> <span class="project-version">0.1.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-support</span></div></div></li><li class="depth-2 branch"><a href="adl-support.core.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>core</span></div></a></li><li class="depth-2 branch"><a href="adl-support.filters.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>filters</span></div></a></li><li class="depth-2 branch"><a href="adl-support.forms-support.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>forms-support</span></div></a></li><li class="depth-2 branch current"><a href="adl-support.print-usage.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>print-usage</span></div></a></li><li class="depth-2 branch"><a href="adl-support.rest-support.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rest-support</span></div></a></li><li class="depth-2 branch"><a href="adl-support.tags.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>tags</span></div></a></li><li class="depth-2"><a href="adl-support.utils.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>utils</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-support.print-usage.html#var-print-usage"><div class="inner"><span>print-usage</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">adl-support.print-usage</h1><div class="doc"><div class="markdown"><p>Application Description Language support - print a usage message.</p></div></div><div class="public anchor" id="var-print-usage"><h3>print-usage</h3><div class="usage"><code>(print-usage project-name parsed-options)</code><code>(print-usage project-name parsed-options extra-args)</code></div><div class="doc"><div class="markdown"><p>Print a UN*X style usage message. <code>project-name</code> should be the base name of the executable jar file you generate, <code>parsed-options</code> should be options as parsed by <a href="https://github.com/clojure/tools.cli">clojure.tools.cli</a>. If <code>extra-args</code> is supplied, it should be a map of name, documentation pairs for each additional argument which may be supplied.</p></div></div></div></div></body></html>
|
3
docs/adl-support.rest-support.html
Normal file
3
docs/adl-support.rest-support.html
Normal file
File diff suppressed because one or more lines are too long
3
docs/adl-support.tags.html
Normal file
3
docs/adl-support.tags.html
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<!DOCTYPE html PUBLIC ""
|
||||||
|
"">
|
||||||
|
<html><head><meta charset="UTF-8" /><title>adl-support.tags 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-support</span> <span class="project-version">0.1.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-support</span></div></div></li><li class="depth-2 branch"><a href="adl-support.core.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>core</span></div></a></li><li class="depth-2 branch"><a href="adl-support.filters.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>filters</span></div></a></li><li class="depth-2 branch"><a href="adl-support.forms-support.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>forms-support</span></div></a></li><li class="depth-2 branch"><a href="adl-support.print-usage.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>print-usage</span></div></a></li><li class="depth-2 branch"><a href="adl-support.rest-support.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rest-support</span></div></a></li><li class="depth-2 branch current"><a href="adl-support.tags.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>tags</span></div></a></li><li class="depth-2"><a href="adl-support.utils.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>utils</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-support.tags.html#var-add-tags"><div class="inner"><span>add-tags</span></div></a></li><li class="depth-1"><a href="adl-support.tags.html#var-if-member-of-permitted"><div class="inner"><span>if-member-of-permitted</span></div></a></li><li class="depth-1"><a href="adl-support.tags.html#var-parse-arg"><div class="inner"><span>parse-arg</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">adl-support.tags</h1><div class="doc"><div class="markdown"><p>Application Description Language support - custom Selmer tags used in generated templates.</p></div></div><div class="public anchor" id="var-add-tags"><h3>add-tags</h3><div class="usage"><code>(add-tags)</code></div><div class="doc"><div class="markdown"><p>FIXME: write docs</p></div></div></div><div class="public anchor" id="var-if-member-of-permitted"><h3>if-member-of-permitted</h3><div class="usage"><code>(if-member-of-permitted args context success failure)</code></div><div class="doc"><div class="markdown"><p>If at least one of these <code>args</code> matches some group name in the <code>:user-roles</code> of this <code>context</code>, return this <code>success</code>, else this <code>failure</code>.</p></div></div></div><div class="public anchor" id="var-parse-arg"><h3>parse-arg</h3><div class="usage"><code>(parse-arg arg context)</code></div><div class="doc"><div class="markdown"><p>FIXME: write docs</p></div></div></div></div></body></html>
|
3
docs/adl-support.utils.html
Normal file
3
docs/adl-support.utils.html
Normal file
File diff suppressed because one or more lines are too long
3
docs/index.html
Normal file
3
docs/index.html
Normal file
File diff suppressed because one or more lines are too long
13
project.clj
13
project.clj
|
@ -1,22 +1,23 @@
|
||||||
(defproject adl-support "0.1.6"
|
(defproject adl-support "0.1.7-SNAPSHOT"
|
||||||
:description "A small library of functions called by generated ADL code."
|
:description "A small library of functions called by generated ADL code."
|
||||||
:url "https://github.com/simon-brooke/adl-support"
|
:url "https://github.com/simon-brooke/adl-support"
|
||||||
:license {:name "MIT License"
|
:license {:name "MIT License"
|
||||||
:url "https://opensource.org/licenses/MIT"}
|
:url "https://opensource.org/licenses/MIT"}
|
||||||
|
|
||||||
:dependencies [[org.clojure/clojure "1.8.0"]
|
:dependencies [[org.clojure/clojure "1.8.0"]
|
||||||
[org.clojure/core.memoize "0.7.1"]
|
[org.clojure/core.memoize "0.8.2"]
|
||||||
[org.clojure/math.numeric-tower "0.0.4"]
|
[org.clojure/math.numeric-tower "0.0.4"]
|
||||||
[org.clojure/tools.logging "0.4.1"]
|
[org.clojure/tools.logging "0.5.0"]
|
||||||
[selmer "1.11.8"]]
|
[selmer "1.12.17"]]
|
||||||
|
|
||||||
:plugins [[lein-codox "0.10.4"]
|
:plugins [[lein-codox "0.10.4"]
|
||||||
[lein-release "1.0.5"]]
|
[lein-release "1.0.5"]]
|
||||||
|
|
||||||
:deploy-repositories [["releases" :clojars]
|
:deploy-repositories [["releases" :clojars]
|
||||||
["snapshots" :clojars]]
|
["snapshots" :clojars]]
|
||||||
:codox {:metadata {:doc "FIXME: write docs"}
|
:codox {:metadata {:doc "FIXME: write docs"
|
||||||
:output-path "doc"}
|
:doc/format :markdown}
|
||||||
|
:output-path "docs"}
|
||||||
|
|
||||||
;; `lein release` doesn't play nice with `git flow release`. Run `lein release` in the
|
;; `lein release` doesn't play nice with `git flow release`. Run `lein release` in the
|
||||||
;; `develop` branch, then merge the release tag into the `master` branch.
|
;; `develop` branch, then merge the release tag into the `master` branch.
|
||||||
|
|
|
@ -92,7 +92,7 @@
|
||||||
"The name to which data for this `auxlist` will be bound in the
|
"The name to which data for this `auxlist` will be bound in the
|
||||||
Selmer params."
|
Selmer params."
|
||||||
[auxlist]
|
[auxlist]
|
||||||
`(safe-name (-> ~auxlist :attrs :property) :clojure))
|
`(safe-name (str "auxlist-" (-> ~auxlist :attrs :property)) :clojure))
|
||||||
|
|
||||||
|
|
||||||
(defmacro all-keys-present?
|
(defmacro all-keys-present?
|
||||||
|
|
|
@ -261,7 +261,7 @@
|
||||||
(s/join
|
(s/join
|
||||||
" "
|
" "
|
||||||
(map
|
(map
|
||||||
#(apply str (cons (Character/toUpperCase (first %)) (rest %)))
|
s/capitalize
|
||||||
(s/split s #"[^a-zA-Z0-9]+")))
|
(s/split s #"[^a-zA-Z0-9]+")))
|
||||||
s))
|
s))
|
||||||
|
|
||||||
|
@ -579,21 +579,24 @@
|
||||||
(defn list-related-query-name
|
(defn list-related-query-name
|
||||||
"Return the canonical name of the HugSQL query to return all records on
|
"Return the canonical name of the HugSQL query to return all records on
|
||||||
`farside` which match a given record on `nearside`, where `nearide` and
|
`farside` which match a given record on `nearside`, where `nearide` and
|
||||||
`farside` are both entities."
|
`farside` are both entities; and `property` is the nearside property on
|
||||||
|
which to join."
|
||||||
([property nearside farside as-symbol?]
|
([property nearside farside as-symbol?]
|
||||||
(let [unique? (=
|
(let [unique? (=
|
||||||
(count
|
(count
|
||||||
(filter
|
(filter
|
||||||
#(= (-> % :attrs :entity)(-> property :attrs :entity))
|
#(= (-> % :attrs :entity)(-> property :attrs :entity))
|
||||||
(descendants-with-tag nearside :property)))
|
(descendants-with-tag nearside :property)))
|
||||||
1)
|
1)
|
||||||
farname (if unique? (safe-name farside :sql) (safe-name property :sql))
|
farname (if unique? (safe-name farside :sql) (safe-name property :sql))
|
||||||
nearname (singularise (safe-name nearside :sql))
|
nearname (singularise (safe-name nearside :sql))
|
||||||
n (case (-> property :attrs :type)
|
n (case (-> property :attrs :type)
|
||||||
;; TODO: I am deeply susicious of this. It's just improbable that
|
"list" (str "list-" farname "-by-" nearname)
|
||||||
;; the same recipe should work for all three cases.
|
"link" (s/join "-"
|
||||||
("link" "list") (str "list-" farname "-by-" nearname)
|
(list
|
||||||
"entity" (str "list-" farname "-by-" nearname)
|
"list"
|
||||||
|
(safe-name property :sql) "by" nearname))
|
||||||
|
"entity" (str "list-" (safe-name nearside :sql) "-by-" (safe-name property :sql))
|
||||||
;; default
|
;; default
|
||||||
(str "ERROR-bad-property-type-"
|
(str "ERROR-bad-property-type-"
|
||||||
(-> ~property :attrs :type) "-of-"
|
(-> ~property :attrs :type) "-of-"
|
||||||
|
|
|
@ -308,7 +308,7 @@
|
||||||
|
|
||||||
(deftest list-related-query-name-tests
|
(deftest list-related-query-name-tests
|
||||||
(testing "list-related-query-name"
|
(testing "list-related-query-name"
|
||||||
(let [e1 {:tag :entity,
|
(let [genders-entity {:tag :entity,
|
||||||
:attrs {:volatility "6", :magnitude "1", :name "genders", :table "genders"},
|
:attrs {:volatility "6", :magnitude "1", :name "genders", :table "genders"},
|
||||||
:content [{:tag :documentation,
|
:content [{:tag :documentation,
|
||||||
:content ["All genders which may be assigned to\n electors."]}
|
:content ["All genders which may be assigned to\n electors."]}
|
||||||
|
@ -321,7 +321,7 @@
|
||||||
:content nil}]}]}
|
:content nil}]}]}
|
||||||
{:tag :list, :attrs {:name "Genders", :properties "all"}}
|
{:tag :list, :attrs {:name "Genders", :properties "all"}}
|
||||||
{:tag :form, :attrs {:name "Gender", :properties "all"}}]}
|
{:tag :form, :attrs {:name "Gender", :properties "all"}}]}
|
||||||
e2 {:tag :entity,
|
electors-entity {:tag :entity,
|
||||||
:attrs {:volatility "6", :magnitude "1", :name "electors", :table "electors"},
|
:attrs {:volatility "6", :magnitude "1", :name "electors", :table "electors"},
|
||||||
:content [{:tag :documentation,
|
:content [{:tag :documentation,
|
||||||
:attrs nil,
|
:attrs nil,
|
||||||
|
@ -366,9 +366,9 @@
|
||||||
[{:tag :prompt,
|
[{:tag :prompt,
|
||||||
:attrs {:locale "en_GB.UTF-8", :prompt "Gender"},
|
:attrs {:locale "en_GB.UTF-8", :prompt "Gender"},
|
||||||
:content nil}]}]}
|
:content nil}]}]}
|
||||||
property (child e2 #(= (-> % :attrs :name) "gender"))
|
property (child electors-entity #(= (-> % :attrs :name) "gender"))
|
||||||
expected "list-electors-by-gender"
|
expected "list-electors-by-gender"
|
||||||
actual (list-related-query-name property e2 e1)]
|
actual (list-related-query-name property electors-entity genders-entity)]
|
||||||
(is (= expected actual) "just checking..."))
|
(is (= expected actual) "just checking..."))
|
||||||
(let [e1 {:tag :entity
|
(let [e1 {:tag :entity
|
||||||
:attrs {:name "dwellings"}
|
:attrs {:name "dwellings"}
|
||||||
|
@ -394,7 +394,7 @@
|
||||||
expected "list-dwellings-by-address"
|
expected "list-dwellings-by-address"
|
||||||
actual (list-related-query-name property e2 e1)]
|
actual (list-related-query-name property e2 e1)]
|
||||||
(is (= expected actual) "List property")))
|
(is (= expected actual) "List property")))
|
||||||
(let [e1 {:tag :entity
|
(let [team-entity {:tag :entity
|
||||||
:attrs {:name "teams"}
|
:attrs {:name "teams"}
|
||||||
:content [{:tag :key
|
:content [{:tag :key
|
||||||
:content [{:tag :property
|
:content [{:tag :property
|
||||||
|
@ -403,7 +403,7 @@
|
||||||
:attrs {:name "members" :type "link" :entity "canvassers"}}
|
:attrs {:name "members" :type "link" :entity "canvassers"}}
|
||||||
{:tag :property
|
{:tag :property
|
||||||
:attrs {:name "organisers" :type "link" :entity "canvassers"}}]}
|
:attrs {:name "organisers" :type "link" :entity "canvassers"}}]}
|
||||||
e2 {:tag :entity
|
canvasser-entity {:tag :entity
|
||||||
:attrs {:name "canvassers"}
|
:attrs {:name "canvassers"}
|
||||||
:content [{:tag :key
|
:content [{:tag :key
|
||||||
:content [{:tag :property
|
:content [{:tag :property
|
||||||
|
@ -413,17 +413,17 @@
|
||||||
(let [property {:tag :property
|
(let [property {:tag :property
|
||||||
:attrs {:name "members" :type "link" :entity "canvassers"}}
|
:attrs {:name "members" :type "link" :entity "canvassers"}}
|
||||||
expected "list-members-by-team"
|
expected "list-members-by-team"
|
||||||
actual (list-related-query-name property e1 e2)]
|
actual (list-related-query-name property team-entity canvasser-entity)]
|
||||||
(is (= actual expected) "Link property - members"))
|
(is (= actual expected) "Link property - members"))
|
||||||
(let [property {:tag :property
|
(let [property {:tag :property
|
||||||
:attrs {:name "organisers" :type "link" :entity "canvassers"}}
|
:attrs {:name "organisers" :type "link" :entity "canvassers"}}
|
||||||
expected "list-organisers-by-team"
|
expected "list-organisers-by-team"
|
||||||
actual (list-related-query-name property e1 e2)]
|
actual (list-related-query-name property team-entity canvasser-entity)]
|
||||||
(is (= actual expected) "Link property - organisers"))
|
(is (= actual expected) "Link property - organisers"))
|
||||||
(let [property {:tag :property
|
(let [property {:tag :property
|
||||||
:attrs {:name "memberships" :type "link" :entity "teams"}}
|
:attrs {:name "memberships" :type "link" :entity "teams"}}
|
||||||
expected "list-memberships-by-canvasser"
|
expected "list-memberships-by-canvasser"
|
||||||
actual (list-related-query-name property e2 e1)]
|
actual (list-related-query-name property canvasser-entity team-entity)]
|
||||||
(is (= actual expected) "Link property - membersips")))))
|
(is (= actual expected) "Link property - membersips")))))
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue