4 Commits
v2.2 ... v2.4

8 changed files with 35 additions and 44 deletions

8
README.md Normal file
View File

@ -0,0 +1,8 @@
# New Life Songs Database
This is Jonathan's database of worship songs performed at New Life Austin. The
service lives online at http://newlifesongs.jdbernard.com
API Documentation is [maintained online with the service](http://newlifesongs.jdbernard.com/doc/api/v1/).
You can also view the [annotated source code](https://doc.jdb-labs.com/new-life-songs/current/).

View File

@ -42,9 +42,9 @@ dependencies {
war { war {
from "resources/webapp" from "resources/webapp"
from "build/webapp" from "build/webapp"
version = project.version.releaseVersion
filter(ReplaceTokens, tokens: [version: version]) filter(ReplaceTokens, tokens: [version: version])
rename '(.+)(\\..*(css|js))', '$1-' + version + '$2' rename '(.+)(\\..*(css|js))', '$1-' + version + '$2'
version = project.version.releaseVersion
webInf { from 'resources/main/WEB-INF' } webInf { from 'resources/main/WEB-INF' }
exclude "**/.*.swp", "**/.sass-cache" exclude "**/.*.swp", "**/.sass-cache"
} }
@ -53,9 +53,9 @@ test { testLogging { events 'failed' } }
task testWar(type: War) { task testWar(type: War) {
from 'resources/webapp' from 'resources/webapp'
version = project.version.releaseVersion
filter(ReplaceTokens, tokens: [version: version]) filter(ReplaceTokens, tokens: [version: version])
rename '(.+)(\\..*(css|js))', '$1-' + version + '$2' rename '(.+)(\\..*(css|js))', '$1-' + version + '$2'
version = project.version.releaseVersion
webInf { from 'resources/test/WEB-INF' } webInf { from 'resources/test/WEB-INF' }
classifier 'test' } classifier 'test' }

View File

@ -315,7 +315,7 @@ public class NLSongsDB {
return buildToken(row, user) } return buildToken(row, user) }
public static List<String> unwrapArtists(String artists) { public static List<String> unwrapArtists(String artists) {
return artists.split(';') as List<String> } return artists.split(':') as List<String> }
public static String wrapArtists(List<String> artists) { public static String wrapArtists(List<String> artists) {
return artists.join(':') } return artists.join(':') }

View File

@ -142,11 +142,26 @@ Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
in with the request will be ignored. in with the request will be ignored.
<p><h4>Reponse</h4> <p><h4>Reponse</h4>
The newly-created song record. The newly-created song record. If a value is given in the
request for the <tt>id</tt> attribute it is ignored. The
attribute for new records is determined by the service and
returned as part of the response.
<p><h4>Example</h4> <p><h4>Example</h4>
<pre> <pre>
</pre></li> POST http://newlifesongs.jdbernard.com/api/v1/songs
Content-Length: 60
Content-Type: application/json
{"id":22,"name":"This is How We Praise Him","artists":[""]}
</pre>
<p><pre>
HTTP/1.1 201 Created
Content-Length:
Content-Type: application/json
</pre></li>
<li><h3><code>GET /songs/&lt;songId&gt;</code></h3> <li><h3><code>GET /songs/&lt;songId&gt;</code></h3>

View File

@ -57,7 +57,8 @@ songsDB = NLSongsContext.songsDB
<script type="application/javascript"> <script type="application/javascript">
window.onload = function() { \$("#services-table"). window.onload = function() { \$("#services-table").
dataTable({ "paging": false }); }; dataTable({ "paging": false,
"order": [[0, "desc"]]}); };
</script> </script>
</body> </body>
</html> </html>

View File

@ -5,8 +5,7 @@ import com.jdbernard.nlsongs.model.*
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
sdf = new SimpleDateFormat('yyyy-MM-dd') sdf = new SimpleDateFormat('yyyy-MM-dd')
hcfg = new hcfg = new HikariConfig("/home/jdbernard/projects/new-life-songs/src/main/webapp/WEB-INF/classes/datasource.properties")
HikariConfig("/home/jdbernard/projects/new-life-songs/src/main/webapp/WEB-INF/classes/datasource.properties")
makeService = { svcRow -> makeService = { svcRow ->
Service svc = new Service() Service svc = new Service()

View File

@ -1,32 +0,0 @@
package com.jdbernard.nlsongs.db
public class GenerateQueries {
public static void main(String[] args) {
}
public static Map<String, Map<String, String> > generateQueries(String ddl) {
def tables = [:]
// Find the table definitions
String tableRegex = /(?ms)(?:CREATE TABLE (?:IF NOT EXISTS )?([^\s]+) \(([^\s]+);.+?)+/
ddl.eachMatch(tableRegex) { matchGroups ->
String tableName = matchGroups[1]
// Parse the column definitions.
// Create new record insert statements.
// Create insert queries.
// Create update queries.
// Create delete queries.
// Create ID lookup queries.
}
}

View File

@ -1,6 +1,6 @@
# #
#Tue Apr 14 15:12:24 CDT 2015 #Tue Jul 21 19:08:16 CDT 2015
major=2 major=2
version.release=false version.release=true
minor=2 minor=4
build=13 build=6