Instantly share code, notes, and snippets.

View app.xql
declare function app:upload($node as node(), $model as map(*)) {
let $collection := '/db/apps/NiC/inReview/'
let $filename := request:get-uploaded-file-name('file')
(: make sure you use the right user permissions that has write access to this collection :)
let $login := xmldb:login($collection, 'public', 'public')
let $store := xmldb:store($collection, $filename, request:get-uploaded-file-data('file'))
(: I want to see what it's pulling for $filename--I'm getting a SAX prolog error, but there's nothing worrisome in the XML file I'm trying to upload :)
View tei2html.xql
module namespace tei2="http://exist-db.org/xquery/app/tei2html";
import module namespace console="http://exist-db.org/xquery/console";
declare namespace tei="http://www.tei-c.org/ns/1.0";
declare function tei2:tei2html($nodes as node()*) {
for $node in $nodes
return
typeswitch ($node)
case text() return
View keybase.md

Keybase proof

I hereby claim:

  • I am tonyahowe on github.
  • I am thowe (https://keybase.io/thowe) on keybase.
  • I have a public key ASBH_HFd_LBELqG0jE-trzGSQfpNvrOhN44uxn4aXXJgIQo

To claim this, I am signing this object:

View page.html
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title class="config:app-title">App Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta class="config:app-meta"/>
<link rel="icon" href="resources/images/nic_icon_16x16.ico"/>
<!-- <link rel="stylesheet" type="text/css" href="$shared/resources/css/exist-nic.css"/> -->
<link rel="stylesheet" type="text/css" href="resources/css/style.css"/>
<script type="text/javascript" src="$shared/resources/scripts/jquery/jquery-1.7.1.min.js"/>
<script type="text/javascript" src="$shared/resources/scripts/bootstrap-3.0.3.min.js"/>
View upload.html
<div xmlns="http://www.w3.org/1999/xhtml" data-template="templates:surround" data-template-with="templates/page.html" data-template-at="main">
<form enctype="multipart/form-data" method="post" action="form1.html?do-upload=true">
<fieldset>
<legend>Upload Document:</legend>
<input type="file" name="file"/>
<button id="f-btn-upload" name="f-btn-upload" value="true" type="submit" class="btn btn-danger">Upload</button>
</fieldset>
</form>
</div>
View form1.html
<div xmlns="http://www.w3.org/1999/xhtml" data-template="templates:surround" data-template-with="templates/page.html" data-template-at="main">
<div/>
<!-- if a query search -->
<div data-template="templates:if-parameter-set" data-template-param="query">
<div data-template="templates:include" data-template-path="search.html" class="col-md-12"/>
</div>
<!-- if a coursepack search -->
<div data-template="templates:if-parameter-set" data-template-param="f-btn-coursepack">
View app.xql
xquery version "3.0";
module namespace app="http://exist-db.org/apps/";
import module namespace templates="http://exist-db.org/xquery/templates";
import module namespace config="http://exist-db.org/apps/NiC/config" at "config.xqm";
import module namespace tei2="http://exist-db.org/xquery/app/tei2html" at "tei2html.xql";
import module namespace kwic="http://exist-db.org/xquery/kwic" at "resource:org/exist/xquery/lib/kwic.xql";
(:~
View tei2html.xql
module namespace tei2="http://exist-db.org/xquery/app/tei2html";
import module namespace console="http://exist-db.org/xquery/console";
declare namespace tei="http://www.tei-c.org/ns/1.0";
declare function tei2:tei2html($nodes as node()*) {
for $node in $nodes
return
typeswitch ($node)
case text() return
View exist log
This file has been truncated, but you can view the full file.
2014-10-01 16:49:11,592 [eXistThread-191] DEBUG (SecurityManagerImpl.java [authenticate]:406) - Authentication try for 'admin'.
2014-10-01 16:49:11,593 [eXistThread-191] DEBUG (SecurityManagerImpl.java [authenticate]:449) - Authenticated by 'exist' as '[auth] <account name="admin" id="1048574"><group name="dba" id="1048575"><manager name="admin"/></group></account>'.
2014-10-01 16:49:11,594 [eXistThread-191] DEBUG (XQuery.java [execute]:300) - Execution took 64 ms
2014-10-01 16:49:11,594 [eXistThread-191] DEBUG (HTTPUtils.java [addLastModifiedHeader]:63) - mostRecentDocumentTime: 0
2014-10-01 16:49:11,595 [eXistThread-191] DEBUG (HttpRequestWrapper.java [<init>]:142) - Retrieved 0 parameters.
2014-10-01 16:49:11,596 [eXistThread-191] DEBUG (SecurityManagerImpl.java [authenticate]:406) - Authentication try for 'admin'.
View index.html
<div xmlns="http://www.w3.org/1999/xhtml" data-template="templates:surround" data-template-with="templates/page.html" data-template-at="main">
<form action="search.html" class="form form-horizontal">
<div class="col-md-3 col-md-push-9">
<div class="well well-sm">
<div class="form-group">
<div class="col-md-12 col-xs-12">
<span class="input-group">
<input name="query" type="search" class="templates:form-control form-control" placeholder="Search String"/>
<span class="input-group-btn">
<button id="f-btn-search" type="submit" class="btn btn-primary">