Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions src/main/frontend/sass/_doc.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ select[name='module'] {
.module .module-head {
background-color: var(--lightgrey);
border-radius: .25rem;
padding-block-end: 1rem;
}

.module .module-head-inner {
Expand All @@ -39,17 +40,16 @@ select[name='module'] {

.module-info-icon {
display: block;
text-align: center;
text-align: right;
margin-top: 1em;
}

.module-info-icon .glyphicon-info-sign {
font-size: 3rem;
font-size: 2.5rem;
}

.module-head p {
font-size: 1.33em;
line-height: 1.5em;
.module-description {
margin-inline-end: 1rem;
}

.module-head td {
Expand All @@ -62,17 +62,15 @@ select[name='module'] {
}

.module-head h3 {
margin-block-start: 1rem;
margin-block-start: 1.25rem;
}

.module-head h4 {
word-wrap: break-word;
}

.function-head h4 {
font-size: 1.25em;
margin-block-end: .8rem;
margin-inline-start: 1rem;
.function-head {
margin-block-start: 2rem;
}

.module .extended {
Expand Down
2 changes: 1 addition & 1 deletion src/main/frontend/sass/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#main {
margin-block-start: 1.75rem;
min-height: 40vh;
min-height: calc(100vh - 18.5rem);
}

.navbar-dark {
Expand Down
75 changes: 39 additions & 36 deletions src/main/xar-resources/browse.html
Original file line number Diff line number Diff line change
@@ -1,41 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<div data-template="templates:surround" data-template-with="templates/page.html" data-template-at="main">
<h1>XQuery Function Documentation</h1>
<p>
<a href="index.html">
<i class="glyphicon glyphicon-chevron-left"/> Back to Search Page</a>
</p>
<form class="form-inline">
<div class="row mb-3 col-auto">
<div class="checkbox">
<label>
<input data-template="templates:form-control" type="checkbox" name="w3c" value="true"/> W3C XPath functions
</label>
</div>
<div class="checkbox">
<label>
<input data-template="templates:form-control" type="checkbox" name="extensions" value="true"/> Extension functions
</label>
</div>
<div class="checkbox">
<label>
<input data-template="templates:form-control" type="checkbox" name="appmodules" value="true"/> Application modules
</label>
<article class="col-12-md">
<h1>XQuery Function Documentation</h1>
<p>
<a href="index.html">
<i class="glyphicon glyphicon-chevron-left"/> Back to Search Page</a>
</p>
<form class="form-inline">
<div class="row mb-3 col-auto">
<div class="checkbox">
<label>
<input data-template="templates:form-control" type="checkbox" name="w3c" value="true"/> W3C XPath functions
</label>
</div>
<div class="checkbox">
<label>
<input data-template="templates:form-control" type="checkbox" name="extensions" value="true"/> Extension functions
</label>
</div>
<div class="checkbox">
<label>
<input data-template="templates:form-control" type="checkbox" name="appmodules" value="true"/> Application modules
</label>
</div>
</div>
<button class="btn btn-primary">Filter</button>
</form>
<div id="modules">
<table class="table table-striped table-hover table-condensed">
<thead>
<tr>
<th>Namespace</th>
<th>Location</th>
</tr>
</thead>
<tbody>
<tr data-template="app:showmodules"></tr>
</tbody>
</table>
</div>
<button class="btn btn-primary">Filter</button>
</form>
<div id="modules">
<table class="table table-striped table-hover table-condensed">
<thead>
<tr>
<th>Namespace</th>
<th>Location</th>
</tr>
</thead>
<tbody>
<tr data-template="app:showmodules"></tr>
</tbody>
</table>
</div>
</article>

</div>
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,36 @@ declare variable $exist:controller external;
declare variable $exist:path external;
declare variable $exist:resource external;

if ($exist:path eq '') then
if ($exist:path eq '') then (
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<redirect url="{concat(request:get-uri(), '/')}"/>
</dispatch>
else if ($exist:path eq "/") then
) else if ($exist:path eq "/") then (
(: forward root path to index.xql :)
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<redirect url="index.html"/>
</dispatch>

else if ($exist:resource eq "login") then
) else if (ends-with($exist:resource, ".html")) then (
let $loggedIn := login:set-user("org.exist.login", (), true())
return
(: the html page is run through view.xql to expand templates :)
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<view>
<forward url="{$exist:controller}/modules/view.xq">
<set-attribute name="$exist:prefix" value="{$exist:prefix}"/>
<set-attribute name="$exist:controller" value="{$exist:controller}"/>
</forward>
</view>
</dispatch>
) else if (ends-with($exist:resource, ".md")) then (
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<forward url="{$exist:controller}{$exist:path}" />
</dispatch>
) else if (matches($exist:path, "/resources/(css|fonts|images|scripts|svg|css)/.+")) then (
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<forward url="{$exist:controller}{$exist:path}" />
</dispatch>
) else if ($exist:resource eq "login") then (
let $loggedIn := login:set-user("org.exist.login", (), true())
return
try {
Expand All @@ -33,27 +52,13 @@ else if ($exist:resource eq "login") then
response:set-status-code(401),
<status>{$err:description}</status>
}

else if (ends-with($exist:resource, ".html")) then
let $loggedIn := login:set-user("org.exist.login", (), true())
) else if ($exist:path = "/regenerate") then (
let $loggedIn := login:set-user("org.exist.login", (), false())
return
(: the html page is run through view.xql to expand templates :)
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<view>
<forward url="{$exist:controller}/modules/view.xql">
<set-attribute name="$exist:prefix" value="{$exist:prefix}"/>
<set-attribute name="$exist:controller" value="{$exist:controller}"/>
</forward>
</view>
<forward url="{$exist:controller}/modules/regenerate.xq" />
</dispatch>

else if ($exist:resource = "reindex.xql") then
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
{login:set-user("org.exist.login", (), false())}
</dispatch>

else
(: everything else is passed through :)
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<cache-control cache="yes"/>
</dispatch>
) else (
response:set-status-code(404),
<data>Not Found</data>
)
8 changes: 5 additions & 3 deletions src/main/xar-resources/error-page.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<div data-template="templates:surround" data-template-with="templates/page.html" data-template-at="main">
<h1>An error has occurred</h1>
<p>An error has been generated by the application.</p>
<pre class="error" data-template="templates:error-description"></pre>
<article class="col-12-md">
<h1>An error has occurred</h1>
<p>An error has been generated by the application.</p>
<pre class="error" data-template="templates:error-description"></pre>
</article>
</div>
96 changes: 49 additions & 47 deletions src/main/xar-resources/index.html
Original file line number Diff line number Diff line change
@@ -1,56 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<div data-template="templates:surround" data-template-with="templates/page.html" data-template-at="main">
<h1>XQuery Function Documentation</h1>
<form id="fun-query-form" name="f-query" class="form-horizontal" action="?" method="GET">
<div class="row mb-3">
<label class="col-form-label col-md-2 hidden-xs">Search</label>
<div class="col-md-4 col-xs-12">
<span class="input-group">
<input id="query-field" name="q" type="text" data-template="templates:form-control" class="form-control"/>
<span class="input-group-btn">
<button id="f-btn-search" type="submit" name="action" value="search" class="btn btn-primary">
<span class="glyphicon glyphicon-search"></span> Search
</button>
<article class="col-12-md">
<h1>XQuery Function Documentation</h1>
<form id="fun-query-form" name="f-query" class="form-horizontal" action="?" method="GET">
<div class="row mb-3">
<label class="col-form-label col-md-2 hidden-xs">Search</label>
<div class="col-md-4 col-xs-12">
<span class="input-group">
<input id="query-field" name="q" type="text" data-template="templates:form-control" class="form-control"/>
<span class="input-group-btn">
<button id="f-btn-search" type="submit" name="action" value="search" class="btn btn-primary">
<span class="glyphicon glyphicon-search"></span> Search
</button>
</span>
</span>
</span>
</div>
</div>
</div>
<div class="row mb-3">
<label class="col-form-label col-md-2 hidden-xs">Search in</label>
<div class="col-md-4 col-xs-12">
<select name="type" data-template="templates:form-control" class="form-select">
<option value="name">Name</option>
<option value="signature">Signature</option>
<option value="desc">Description</option>
</select>
</div>
</div>
<div class="btn-toolbar">
<div class="btn-group me-2" role="group" aria-label="browse action">
<a id="browse" class="btn btn-primary" href="browse.html?extensions=true">
<span class="glyphicon glyphicon-globe"></span> Browse</a>
<div class="row mb-3">
<label class="col-form-label col-md-2 hidden-xs">Search in</label>
<div class="col-md-4 col-xs-12">
<select name="type" data-template="templates:form-control" class="form-select">
<option value="name">Name</option>
<option value="signature">Signature</option>
<option value="desc">Description</option>
</select>
</div>
</div>
<div class="btn-group me-2" role="group" aria-label="generate action">
<button id="f-btn-reindex-regen" class="btn btn-warning" data-template="app:check-dba-user-and-data" data-toggle="tooltip" data-placement="top" title="Regenerate XQuery Function Documentation after modification or addition of functions">
<span class="glyphicon glyphicon-refresh"></span> Regenerate</button>
<button id="f-btn-reindex" class="btn btn-warning" data-template="app:check-not-data" data-toggle="tooltip" data-placement="top" title="Generate XQuery Function Documentation after installation">
<span class="glyphicon glyphicon-import"></span> Generate</button>
<img id="f-load-indicator" src="resources/images/ajax-loader.gif"/>
<div class="btn-toolbar">
<div class="btn-group me-2" role="group" aria-label="browse action">
<a id="browse" class="btn btn-primary" href="browse.html?extensions=true">
<span class="glyphicon glyphicon-globe"></span> Browse</a>
</div>
<div class="btn-group me-2" role="group" aria-label="generate action">
<button id="f-btn-reindex-regen" class="btn btn-warning" data-template="app:check-dba-user-and-data" data-toggle="tooltip" data-placement="top" title="Regenerate XQuery Function Documentation after modification or addition of functions">
<span class="glyphicon glyphicon-refresh"></span> Regenerate</button>
<button id="f-btn-reindex" class="btn btn-warning" data-template="app:check-not-data" data-toggle="tooltip" data-placement="top" title="Generate XQuery Function Documentation after installation">
<span class="glyphicon glyphicon-import"></span> Generate</button>
<img id="f-load-indicator" src="resources/images/ajax-loader.gif"/>
</div>
</div>
</form>
<div class="alert alert-warning" data-template="app:check-dba-user-and-not-data">
The function documentation has not been generated yet. Click on the <code>Generate</code> button
above to index all XQuery modules. This should take less than a minute.
</div>
</form>
<div class="alert alert-warning" data-template="app:check-dba-user-and-not-data">
The function documentation has not been generated yet. Click on the <code>Generate</code> button
above to index all XQuery modules. This should take less than a minute.
</div>
<div class="alert alert-warning" data-template="app:check-not-dba-user-and-not-data">
The function documentation has not been generated yet. Please contact the database administrator in order to have the function documentation generated.

</div>
<div id="messages"></div>
<div id="results">
<div data-template="app:action">
<div data-template="app:module"></div>
<div class="alert alert-warning" data-template="app:check-not-dba-user-and-not-data">
The function documentation has not been generated yet. Please contact the database administrator in order to have the function documentation generated.

</div>
<div id="messages"></div>
<div id="results">
<div data-template="app:action">
<div data-template="app:module"></div>
</div>
</div>
</div>
</article>
</div>
Loading