diff --git a/Dockerfile b/Dockerfile index 785124d..a3c544b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM u.melt.sh/totem/java-oracle-base:7 +FROM makuk66/docker-oracle-java7 WORKDIR /opt/grails diff --git a/grails/application.properties b/grails/application.properties index 0a8fce2..1f9068b 100644 --- a/grails/application.properties +++ b/grails/application.properties @@ -1,5 +1,5 @@ #Grails Metadata file -#Tue Oct 15 10:33:38 MST 2013 -app.grails.version=2.3.0 +#Tue Jun 10 10:49:12 BST 2014 +app.grails.version=2.4.0 app.name=grails app.version=0.1 diff --git a/grails/web-app/images/apple-touch-icon-retina.png b/grails/grails-app/assets/images/apple-touch-icon-retina.png similarity index 100% rename from grails/web-app/images/apple-touch-icon-retina.png rename to grails/grails-app/assets/images/apple-touch-icon-retina.png diff --git a/grails/web-app/images/apple-touch-icon.png b/grails/grails-app/assets/images/apple-touch-icon.png similarity index 100% rename from grails/web-app/images/apple-touch-icon.png rename to grails/grails-app/assets/images/apple-touch-icon.png diff --git a/grails/web-app/images/favicon.ico b/grails/grails-app/assets/images/favicon.ico similarity index 100% rename from grails/web-app/images/favicon.ico rename to grails/grails-app/assets/images/favicon.ico diff --git a/grails/web-app/images/grails_logo.png b/grails/grails-app/assets/images/grails_logo.png similarity index 100% rename from grails/web-app/images/grails_logo.png rename to grails/grails-app/assets/images/grails_logo.png diff --git a/grails/web-app/images/skin/database_add.png b/grails/grails-app/assets/images/skin/database_add.png similarity index 100% rename from grails/web-app/images/skin/database_add.png rename to grails/grails-app/assets/images/skin/database_add.png diff --git a/grails/web-app/images/skin/database_delete.png b/grails/grails-app/assets/images/skin/database_delete.png similarity index 100% rename from grails/web-app/images/skin/database_delete.png rename to grails/grails-app/assets/images/skin/database_delete.png diff --git a/grails/web-app/images/skin/database_edit.png b/grails/grails-app/assets/images/skin/database_edit.png similarity index 100% rename from grails/web-app/images/skin/database_edit.png rename to grails/grails-app/assets/images/skin/database_edit.png diff --git a/grails/web-app/images/skin/database_save.png b/grails/grails-app/assets/images/skin/database_save.png similarity index 100% rename from grails/web-app/images/skin/database_save.png rename to grails/grails-app/assets/images/skin/database_save.png diff --git a/grails/web-app/images/skin/database_table.png b/grails/grails-app/assets/images/skin/database_table.png similarity index 100% rename from grails/web-app/images/skin/database_table.png rename to grails/grails-app/assets/images/skin/database_table.png diff --git a/grails/web-app/images/skin/exclamation.png b/grails/grails-app/assets/images/skin/exclamation.png similarity index 100% rename from grails/web-app/images/skin/exclamation.png rename to grails/grails-app/assets/images/skin/exclamation.png diff --git a/grails/web-app/images/skin/house.png b/grails/grails-app/assets/images/skin/house.png similarity index 100% rename from grails/web-app/images/skin/house.png rename to grails/grails-app/assets/images/skin/house.png diff --git a/grails/web-app/images/skin/information.png b/grails/grails-app/assets/images/skin/information.png similarity index 100% rename from grails/web-app/images/skin/information.png rename to grails/grails-app/assets/images/skin/information.png diff --git a/grails/web-app/images/skin/shadow.jpg b/grails/grails-app/assets/images/skin/shadow.jpg similarity index 100% rename from grails/web-app/images/skin/shadow.jpg rename to grails/grails-app/assets/images/skin/shadow.jpg diff --git a/grails/web-app/images/skin/sorted_asc.gif b/grails/grails-app/assets/images/skin/sorted_asc.gif similarity index 100% rename from grails/web-app/images/skin/sorted_asc.gif rename to grails/grails-app/assets/images/skin/sorted_asc.gif diff --git a/grails/web-app/images/skin/sorted_desc.gif b/grails/grails-app/assets/images/skin/sorted_desc.gif similarity index 100% rename from grails/web-app/images/skin/sorted_desc.gif rename to grails/grails-app/assets/images/skin/sorted_desc.gif diff --git a/grails/web-app/images/spinner.gif b/grails/grails-app/assets/images/spinner.gif similarity index 100% rename from grails/web-app/images/spinner.gif rename to grails/grails-app/assets/images/spinner.gif diff --git a/grails/web-app/images/springsource.png b/grails/grails-app/assets/images/springsource.png similarity index 100% rename from grails/web-app/images/springsource.png rename to grails/grails-app/assets/images/springsource.png diff --git a/grails/grails-app/assets/javascripts/application.js b/grails/grails-app/assets/javascripts/application.js new file mode 100644 index 0000000..a67f7eb --- /dev/null +++ b/grails/grails-app/assets/javascripts/application.js @@ -0,0 +1,20 @@ +// This is a manifest file that'll be compiled into application.js. +// +// Any JavaScript file within this directory can be referenced here using a relative path. +// +// You're free to add application-wide JavaScript to this file, but it's generally better +// to create separate JavaScript files as needed. +// +//= require jquery +//= require_tree . +//= require_self + +if (typeof jQuery !== 'undefined') { + (function($) { + $('#spinner').ajaxStart(function() { + $(this).fadeIn(); + }).ajaxStop(function() { + $(this).fadeOut(); + }); + })(jQuery); +} diff --git a/grails/grails-app/assets/stylesheets/application.css b/grails/grails-app/assets/stylesheets/application.css new file mode 100644 index 0000000..e3b02f2 --- /dev/null +++ b/grails/grails-app/assets/stylesheets/application.css @@ -0,0 +1,13 @@ +/* +* This is a manifest file that'll be compiled into application.css, which will include all the files +* listed below. +* +* Any CSS file within this directory can be referenced here using a relative path. +* +* You're free to add application-wide styles to this file and they'll appear at the top of the +* compiled file, but it's generally better to create a new file per style scope. +* +*= require main +*= require mobile +*= require_self +*/ diff --git a/grails/web-app/css/errors.css b/grails/grails-app/assets/stylesheets/errors.css similarity index 100% rename from grails/web-app/css/errors.css rename to grails/grails-app/assets/stylesheets/errors.css diff --git a/grails/web-app/css/main.css b/grails/grails-app/assets/stylesheets/main.css similarity index 100% rename from grails/web-app/css/main.css rename to grails/grails-app/assets/stylesheets/main.css diff --git a/grails/web-app/css/mobile.css b/grails/grails-app/assets/stylesheets/mobile.css similarity index 100% rename from grails/web-app/css/mobile.css rename to grails/grails-app/assets/stylesheets/mobile.css diff --git a/grails/grails-app/conf/ApplicationResources.groovy b/grails/grails-app/conf/ApplicationResources.groovy deleted file mode 100644 index 06b60c7..0000000 --- a/grails/grails-app/conf/ApplicationResources.groovy +++ /dev/null @@ -1,5 +0,0 @@ -modules = { - application { - resource url:'js/application.js' - } -} \ No newline at end of file diff --git a/grails/grails-app/conf/BuildConfig.groovy b/grails/grails-app/conf/BuildConfig.groovy index cdd09b6..4c03d5e 100644 --- a/grails/grails-app/conf/BuildConfig.groovy +++ b/grails/grails-app/conf/BuildConfig.groovy @@ -48,25 +48,30 @@ grails.project.dependency.resolution = { dependencies { // specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes e.g. - // runtime 'mysql:mysql-connector-java:5.1.24' + // runtime 'mysql:mysql-connector-java:5.1.29' + // runtime 'org.postgresql:postgresql:9.3-1101-jdbc41' + + compile "org.springframework:spring-orm:$springVersion" } plugins { // plugins for the build system only - build ":tomcat:7.0.42" + build ":tomcat:7.0.53" // plugins for the compile step - compile ":scaffolding:2.0.0" - compile ':cache:1.1.1' + compile ":scaffolding:2.1.0" + compile ':cache:1.1.6' + compile ":asset-pipeline:1.8.7" // plugins needed at runtime but not for compilation - runtime ":hibernate:3.6.10.1" // or ":hibernate4:4.1.11.1" - runtime ":database-migration:1.3.5" - runtime ":jquery:1.10.2" - runtime ":resources:1.2" - // Uncomment these (or add new ones) to enable additional resources capabilities - //runtime ":zipped-resources:1.0.1" - //runtime ":cached-resources:1.1" - //runtime ":yui-minify-resources:0.1.5" + runtime ":hibernate4:4.3.5.3" // or ":hibernate:3.6.10.15" + runtime ":database-migration:1.4.0" + runtime ":jquery:1.11.1" + + // Uncomment these to enable additional asset-pipeline capabilities + //compile ":sass-asset-pipeline:1.7.4" + //compile ":less-asset-pipeline:1.7.0" + //compile ":coffee-asset-pipeline:1.7.0" + //compile ":handlebars-asset-pipeline:1.3.0.3" } } diff --git a/grails/grails-app/conf/Config.groovy b/grails/grails-app/conf/Config.groovy index a07c4c6..8153152 100644 --- a/grails/grails-app/conf/Config.groovy +++ b/grails/grails-app/conf/Config.groovy @@ -15,8 +15,8 @@ grails.project.groupId = appName // change this to alter the default package nam // The ACCEPT header will not be used for content negotiation for user agents containing the following strings (defaults to the 4 major rendering engines) grails.mime.disable.accept.header.userAgents = ['Gecko', 'WebKit', 'Presto', 'Trident'] -grails.mime.types = [ - all: '*/*', +grails.mime.types = [ // the first one is the default format + all: '*/*', // 'all' maps to '*' or the first available format in withFormat atom: 'application/atom+xml', css: 'text/css', csv: 'text/csv', @@ -34,9 +34,6 @@ grails.mime.types = [ // URL Mapping Cache Max Size, defaults to 5000 //grails.urlmapping.cache.maxsize = 1000 -// What URL patterns should be processed by the resources plugin -grails.resources.adhoc.patterns = ['/images/*', '/css/*', '/js/*', '/plugins/*'] - // Legacy setting for codec used to encode data with ${} grails.views.default.codec = "html" @@ -58,12 +55,11 @@ grails { } } // escapes all not-encoded output at final stage of outputting - filteringCodecForContentType { - //'text/html' = 'html' - } + // filteringCodecForContentType.'text/html' = 'html' } } - + + grails.converters.encoding = "UTF-8" // scaffolding templates configuration grails.scaffolding.templates.domainSuffix = 'Instance' @@ -83,6 +79,12 @@ grails.exceptionresolver.params.exclude = ['password'] // configure auto-caching of queries by default (if false you can cache individual queries with 'cache: true') grails.hibernate.cache.queries = false +// configure passing transaction's read-only attribute to Hibernate session, queries and criterias +// set "singleSession = false" OSIV mode in hibernate configuration after enabling +grails.hibernate.pass.readonly = false +// configure passing read-only to OSIV session by default, requires "singleSession = false" OSIV mode +grails.hibernate.osiv.readonly = false + environments { development { grails.logging.jul.usebridge = true @@ -94,7 +96,7 @@ environments { } // log4j configuration -log4j = { +log4j.main = { // Example of changing the log pattern for the default console appender: // //appenders { diff --git a/grails/grails-app/conf/DataSource.groovy b/grails/grails-app/conf/DataSource.groovy index c8e3760..3662744 100644 --- a/grails/grails-app/conf/DataSource.groovy +++ b/grails/grails-app/conf/DataSource.groovy @@ -1,5 +1,6 @@ dataSource { pooled = true + jmxExport = true driverClassName = "org.h2.Driver" username = "sa" password = "" @@ -7,8 +8,9 @@ dataSource { hibernate { cache.use_second_level_cache = true cache.use_query_cache = false - cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory' // Hibernate 3 -// cache.region.factory_class = 'org.hibernate.cache.ehcache.EhCacheRegionFactory' // Hibernate 4 +// cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory' // Hibernate 3 + cache.region.factory_class = 'org.hibernate.cache.ehcache.EhCacheRegionFactory' // Hibernate 4 + singleSession = true // configure OSIV singleSession mode } // environment specific settings @@ -16,29 +18,38 @@ environments { development { dataSource { dbCreate = "create-drop" // one of 'create', 'create-drop', 'update', 'validate', '' - url = "jdbc:h2:mem:devDb;MVCC=TRUE;LOCK_TIMEOUT=10000" + url = "jdbc:h2:mem:devDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE" } } test { dataSource { dbCreate = "update" - url = "jdbc:h2:mem:testDb;MVCC=TRUE;LOCK_TIMEOUT=10000" + url = "jdbc:h2:mem:testDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE" } } production { dataSource { dbCreate = "update" - url = "jdbc:h2:prodDb;MVCC=TRUE;LOCK_TIMEOUT=10000" + url = "jdbc:h2:prodDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE" properties { - maxActive = -1 - minEvictableIdleTimeMillis=1800000 - timeBetweenEvictionRunsMillis=1800000 - numTestsPerEvictionRun=3 - testOnBorrow=true - testWhileIdle=true - testOnReturn=false - validationQuery="SELECT 1" - jdbcInterceptors="ConnectionState" + // See http://grails.org/doc/latest/guide/conf.html#dataSource for documentation + jmxEnabled = true + initialSize = 5 + maxActive = 50 + minIdle = 5 + maxIdle = 25 + maxWait = 10000 + maxAge = 10 * 60000 + timeBetweenEvictionRunsMillis = 5000 + minEvictableIdleTimeMillis = 60000 + validationQuery = "SELECT 1" + validationQueryTimeout = 3 + validationInterval = 15000 + testOnBorrow = true + testWhileIdle = true + testOnReturn = false + jdbcInterceptors = "ConnectionState" + defaultTransactionIsolation = java.sql.Connection.TRANSACTION_READ_COMMITTED } } } diff --git a/grails/grails-app/conf/UrlMappings.groovy b/grails/grails-app/conf/UrlMappings.groovy index 7df86ab..69634b8 100644 --- a/grails/grails-app/conf/UrlMappings.groovy +++ b/grails/grails-app/conf/UrlMappings.groovy @@ -1,7 +1,7 @@ class UrlMappings { static mappings = { - "/$controller/$action?/$id?(.${format})?"{ + "/$controller/$action?/$id?(.$format)?"{ constraints { // apply constraints here } diff --git a/grails/grails-app/views/error.gsp b/grails/grails-app/views/error.gsp index d85f57b..95e11ed 100644 --- a/grails/grails-app/views/error.gsp +++ b/grails/grails-app/views/error.gsp @@ -3,7 +3,7 @@