Skip to content

Commit

Permalink
Upgrading to grails 2.3.8 and fixing DomainPropertyComparitor issue a…
Browse files Browse the repository at this point in the history
…nd lower casing the i18 class name for matching with grails docs scaffolding http://grails.org/doc/latest/guide/i18n.html#scaffoldingAndI18n
  • Loading branch information
christian.oestreich committed May 6, 2014
1 parent 9d7973c commit f77d322
Show file tree
Hide file tree
Showing 21 changed files with 162 additions and 119 deletions.
2 changes: 1 addition & 1 deletion FilterpaneGrailsPlugin.groovy
@@ -1,5 +1,5 @@
class FilterpaneGrailsPlugin {
def version = "2.3.3"
def version = "2.4.0"
def grailsVersion = "1.3 > *"

def author = "Grails Plugin Consortium"
Expand Down
7 changes: 4 additions & 3 deletions application.properties
@@ -1,3 +1,4 @@
#Grails Metadata file
#Tue Jul 02 15:55:33 CDT 2013
app.grails.version=2.2.1
#Grails Metadata file
#Tue May 06 15:42:34 CDT 2014
app.grails.version=2.3.8
app.servlet.version=2.5
18 changes: 9 additions & 9 deletions grails-app/conf/BuildConfig.groovy
Expand Up @@ -18,9 +18,9 @@ grails.project.dependency.resolution = {
}

dependencies {
test ("org.spockframework:spock-grails-support:0.7-groovy-2.0" ) {
export = false
}
// test ("org.spockframework:spock-grails-support:0.7-groovy-2.0" ) {
// export = false
// }
}

plugins {
Expand All @@ -31,20 +31,20 @@ grails.project.dependency.resolution = {
export = false
}

test ":hibernate:$grailsVersion", {
test ":hibernate:3.6.10.13", {
export = false
}

test(":code-coverage:1.2.6",
":codenarc:0.20",
":build-test-data:2.0.5") {
":build-test-data:2.1.2") {
export = false
}

test(":spock:0.7") {
exclude "spock-grails-support"
export = false
}
// test(":spock:0.7") {
// exclude "spock-grails-support"
// export = false
// }
}
}

Expand Down
24 changes: 24 additions & 0 deletions grails-app/conf/Config.groovy
Expand Up @@ -4,3 +4,27 @@ log4j = {
'org.hibernate',
'net.sf.ehcache.hibernate'
}

// Uncomment and edit the following lines to start using Grails encoding & escaping improvements

/* remove this line
// GSP settings
grails {
views {
gsp {
encoding = 'UTF-8'
htmlcodec = 'xml' // use xml escaping instead of HTML4 escaping
codecs {
expression = 'html' // escapes values inside null
scriptlet = 'none' // escapes output from scriptlets in GSPs
taglib = 'none' // escapes output from taglibs
staticparts = 'none' // escapes output from static template parts
}
}
// escapes all not-encoded output at final stage of outputting
filteringCodecForContentType {
//'text/html' = 'html'
}
}
}
remove this line */
Expand Up @@ -424,7 +424,13 @@ class FilterPaneTagLib {

// sortedProps is a list of Entry instances where the key is the property name and the value is a GrailsDomainClassProperty instance.
// The list is sorted by order the properties appear in the GrailsDomainClass
def domainComparator = new org.codehaus.groovy.grails.scaffolding.DomainClassPropertyComparator(domain)

def domainComparator = Class.forName('org.codehaus.groovy.grails.validation.DomainClassPropertyComparator')
if(!domainComparator){
domainComparator = Class.forName('org.codehaus.groovy.grails.scaffolding.DomainClassPropertyComparator')
}
domainComparator.newInstance(domain)

def sortedProps = finalProps.entrySet().asList().sort { a, b -> domainComparator.compare(a.value, b.value) }

// add 'class' property if domain class has its implementers
Expand Down Expand Up @@ -874,7 +880,8 @@ class FilterPaneTagLib {
// Take care of the name (label). Yuck!
def fieldNameKey = "fp.property.text.${propName}" // Default.
def fieldNameAltKey = fieldNameKey // default for alt key.
def fieldNamei18NTemplateKey = "${sp?.domainClass?.name}.${sp?.name}"
def className = sp?.domainClass?.name[0]?.toLowerCase() + sp?.domainClass?.name?.substring(1)
def fieldNamei18NTemplateKey = "${className}.${sp?.name}"
def fieldName = sp?.naturalName

if(isAssociation) { // association.
Expand Down
30 changes: 23 additions & 7 deletions grailsw
Expand Up @@ -36,6 +36,7 @@ earlyInit
# OS specific support (must be 'true' or 'false').
cygwin=false;
darwin=false;
mingw=false;
case "`uname`" in
CYGWIN*)
cygwin=true
Expand All @@ -44,6 +45,10 @@ case "`uname`" in
Darwin*)
darwin=true
;;

MINGW*)
mingw=true
;;
esac

# Attempt to set JAVA_HOME if it's not already set
Expand Down Expand Up @@ -118,7 +123,7 @@ fi
if [ -z "$STARTER_CONF" ]; then
STARTER_CONF="$GRAILS_HOME/conf/groovy-starter.conf"
fi
STARTER_CLASSPATH="wrapper/grails-wrapper-runtime-2.2.1.jar:wrapper:."
STARTER_CLASSPATH="wrapper/grails-wrapper-runtime-2.3.8.jar:wrapper:."

# Allow access to Cocoa classes on OS X
if $darwin; then
Expand Down Expand Up @@ -179,18 +184,24 @@ if $cygwin ; then
AGENT_GRAILS_HOME=`cygpath --windows "$GRAILS_HOME"`
fi

if $mingw ; then
# Converts GRAILS_HOME path to Windows syntax
[ -n "$GRAILS_HOME" ] &&
AGENT_GRAILS_HOME=`cmd //C echo "$GRAILS_HOME"`
fi

if [ -z "$GRAILS_AGENT_CACHE_DIR" ]; then
GRAILS_AGENT_CACHE_DIR=~/.grails/2.2.1/
GRAILS_AGENT_CACHE_DIR=~/.grails/2.3.8/
fi
SPRINGLOADED_PARAMS=profile=grails;cacheDir=$GRAILS_AGENT_CACHE_DIR
SPRINGLOADED_PARAMS=profile=grails\;cacheDir=$GRAILS_AGENT_CACHE_DIR
if [ ! -d "$GRAILS_AGENT_CACHE_DIR" ]; then
mkdir -p "$GRAILS_AGENT_CACHE_DIR"
fi

# Process JVM args
AGENT_STRING="-javaagent:wrapper/springloaded-core-1.1.1.jar -noverify -Dspringloaded=\"$SPRINGLOADED_PARAMS\""
AGENT_STRING="-javaagent:wrapper/springloaded-1.1.5.RELEASE.jar -noverify -Dspringloaded.synchronize=true -Djdk.reflect.allowGetCallerClass=true -Dspringloaded=$SPRINGLOADED_PARAMS"
CMD_LINE_ARGS=""
DISABLE_RELOADING=false
DISABLE_RELOADING=true

while true; do
if [ "$1" = "-cp" ] || [ "$1" = "-classpath" ]; then
Expand All @@ -201,6 +212,7 @@ while true; do

if [ "$1" = "-reloading" ]; then
AGENT=$AGENT_STRING
DISABLE_RELOADING=false
shift
break
fi
Expand Down Expand Up @@ -263,7 +275,9 @@ if $cygwin; then
GRAILS_HOME=`cygpath --path --mixed "$GRAILS_HOME"`
JAVA_HOME=`cygpath --path --mixed "$JAVA_HOME"`
STARTER_CONF=`cygpath --path --mixed "$STARTER_CONF"`
CP=`cygpath --path --mixed "$CP"`
if [ "x$CP" != "x" ] ; then
CP=`cygpath --path --mixed "$CP"`
fi
TOOLS_JAR=`cygpath --path --mixed "$TOOLS_JAR"`
STARTER_CLASSPATH=`cygpath --path --mixed "$STARTER_CLASSPATH"`
# We build the pattern for arguments to be converted via cygpath
Expand Down Expand Up @@ -302,7 +316,7 @@ startGrails() {
then
GRAILS_OPTS="$GRAILS_OPTS"
else
GRAILS_OPTS="-server -Xmx768M -Xms768M -XX:PermSize=256m -XX:MaxPermSize=256m -Dfile.encoding=UTF-8"
GRAILS_OPTS="-server -Xmx768M -Xms64M -XX:PermSize=32m -XX:MaxPermSize=256m -Dfile.encoding=UTF-8"
fi
JAVA_OPTS="$GRAILS_OPTS $JAVA_OPTS $AGENT"
# Start the Profiler or the JVM
Expand All @@ -314,6 +328,7 @@ startGrails() {
-classpath "$STARTER_CLASSPATH" \
-Dgrails.home="$GRAILS_HOME" \
-Dtools.jar="$TOOLS_JAR" \
-Djava.net.preferIPv4Stack=true \
$STARTER_MAIN_CLASS \
--main $CLASS \
--conf "$STARTER_CONF" \
Expand All @@ -323,6 +338,7 @@ startGrails() {
-classpath "$STARTER_CLASSPATH" \
-Dgrails.home="$GRAILS_HOME" \
-Dtools.jar="$TOOLS_JAR" \
-Djava.net.preferIPv4Stack=true \
$STARTER_MAIN_CLASS \
--main $CLASS \
--conf "$STARTER_CONF" \
Expand Down
10 changes: 5 additions & 5 deletions grailsw.bat
Expand Up @@ -60,11 +60,11 @@ if "%GRAILS_HOME:~-1%"=="\" SET GRAILS_HOME=%GRAILS_HOME:~0,-1%
:init

for %%x in ("%HOMEPATH%") do set SHORTHOME=%%~fsx
if "x%GRAILS_AGENT_CACHE_DIR%" == "x" set GRAILS_AGENT_CACHE_DIR=%SHORTHOME%/.grails/2.2.1/
if "x%GRAILS_AGENT_CACHE_DIR%" == "x" set GRAILS_AGENT_CACHE_DIR=%SHORTHOME%/.grails/2.3.8/
set SPRINGLOADED_PARAMS="profile=grails;cacheDir=%GRAILS_AGENT_CACHE_DIR%"
if not exist "%GRAILS_AGENT_CACHE_DIR%" mkdir "%GRAILS_AGENT_CACHE_DIR%"

set AGENT_STRING=-javaagent:wrapper/springloaded-core-1.1.1.jar -noverify -Dspringloaded=\"%SPRINGLOADED_PARAMS%\"
set AGENT_STRING=-javaagent:wrapper/springloaded-1.1.5.RELEASE.jar -noverify -Dspringloaded.synchronize=true -Djdk.reflect.allowGetCallerClass=true -Dspringloaded=\"%SPRINGLOADED_PARAMS%\"
set DISABLE_RELOADING=
if "%GRAILS_OPTS%" == "" set GRAILS_OPTS=-server -Xmx768M -Xms64M -XX:PermSize=32m -XX:MaxPermSize=256m -Dfile.encoding=UTF-8

Expand All @@ -80,7 +80,7 @@ set INTERACTIVE=true
if "x%~1" == "x" goto execute
set CURR_ARG=%~1
if "%CURR_ARG:~0,2%" == "-D" (
set GRAILS_OPTS=%GRAILS_OPTS% %~1=%~2
set CMD_LINE_ARGS=%CMD_LINE_ARGS% %~1=%~2
shift
shift
goto win9xME_args_slurp
Expand Down Expand Up @@ -130,7 +130,7 @@ set CMD_LINE_ARGS=%$

:execute
@rem Setup the command line
set STARTER_CLASSPATH=wrapper/grails-wrapper-runtime-2.2.1.jar;wrapper;.
set STARTER_CLASSPATH=wrapper/grails-wrapper-runtime-2.3.8.jar;wrapper;.

if exist "%USERPROFILE%/.groovy/init.bat" call "%USERPROFILE%/.groovy/init.bat"

Expand Down Expand Up @@ -159,7 +159,7 @@ set JAVA_OPTS=%GRAILS_OPTS% %JAVA_OPTS% %AGENT%

set JAVA_OPTS=%JAVA_OPTS% -Dprogram.name="%PROGNAME%"
set JAVA_OPTS=%JAVA_OPTS% -Dgrails.home="%GRAILS_HOME%"
set JAVA_OPTS=%JAVA_OPTS% -Dgrails.version=2.2.1
set JAVA_OPTS=%JAVA_OPTS% -Dgrails.version=2.3.8
set JAVA_OPTS=%JAVA_OPTS% -Dbase.dir=.
set JAVA_OPTS=%JAVA_OPTS% -Dtools.jar="%TOOLS_JAR%"
set JAVA_OPTS=%JAVA_OPTS% -Dgroovy.starter.conf="%STARTER_CONF%"
Expand Down
1 change: 1 addition & 0 deletions src/docs/guide/introduction/changes.gdoc
Expand Up @@ -2,6 +2,7 @@ h2. Change Log

{table}
*Date* | *Version* | *Notes* | *Grails Versions* | *Template Changes*
2014-05-12 | 2.4.3 | Migrating to grails 2.3.8 support | 1.3.x | No
2014-03-12 | 2.3.3 | Merging fix for exception thrown in IllegalArgumentException, JIRA 118 | 1.3.x | No
2013-12-23 | 2.3.2 | Merging fix for filtering by class attribute and adding swedish i18 updates | 1.3.x | No
2013-12-02 | 2.3.1 | Resolving issue with grails 2.3.3 and sorting and adding spanizh i18 | 1.3.x | No
Expand Down
@@ -1,8 +1,8 @@
package org.grails.plugin.filterpane

import grails.plugin.spock.IntegrationSpec
import spock.lang.Specification

class BookControllerSpec extends IntegrationSpec {
class BookControllerSpec extends Specification {

def "test emdash filter on controller"() {
given:
Expand Down
@@ -1,8 +1,8 @@
package org.grails.plugin.filterpane

import grails.plugin.spock.IntegrationSpec
import spock.lang.Specification

class FilterPaneServiceEmptyCriteriaSpec extends IntegrationSpec {
class FilterPaneServiceEmptyCriteriaSpec extends Specification {

def filterPaneService

Expand Down
@@ -1,12 +1,12 @@
package org.grails.plugin.filterpane

import grails.plugin.spock.IntegrationSpec
import spock.lang.Specification
import org.grails.plugin.filterpane.nested.Function
import org.grails.plugin.filterpane.nested.Part
import org.grails.plugin.filterpane.nested.Robot
import spock.lang.Unroll

class FilterPaneServiceNestedSpec extends IntegrationSpec {
class FilterPaneServiceNestedSpec extends Specification {

def filterPaneService

Expand Down
@@ -1,10 +1,10 @@
package org.grails.plugin.filterpane

import grails.plugin.spock.IntegrationSpec
import org.hibernate.QueryException
import spock.lang.Specification
import spock.lang.Unroll

class FilterPaneServiceSpec extends IntegrationSpec {
class FilterPaneServiceSpec extends Specification {

def filterPaneService

Expand Down
@@ -1,14 +1,13 @@
package org.grails.plugin.filterpane

import grails.plugin.spock.IntegrationSpec
import grails.test.GroovyPagesTestCase
import grails.test.mixin.TestMixin

import org.codehaus.groovy.grails.web.taglib.exceptions.GrailsTagException
import org.springframework.web.context.request.RequestContextHolder
import spock.lang.Specification

@TestMixin(GroovyPagesTestCase)
class FilterPaneTabLibSpec extends IntegrationSpec {
class FilterPaneTabLibSpec extends Specification {

def "test includes with no params"() {
when:
Expand Down

0 comments on commit f77d322

Please sign in to comment.