Skip to content

upgrade to grails 2.3.4, Fix example and Fix generator #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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
4 changes: 2 additions & 2 deletions application.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Grails Metadata file
#Mon Oct 14 03:48:27 CDT 2013
app.grails.version=2.3.0
#Sat Feb 08 05:23:52 EST 2014
app.grails.version=2.3.4
app.name=angular-scaffolding
app.servlet.version=2.5
2 changes: 1 addition & 1 deletion scripts/_NgGenerate.groovy
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import grails.util.GrailsNameUtils

includeTargets << grailsScript("_GrailsCreateArtifacts")
includeTargets << new File("scaffoldingPluginDir/scripts/_GrailsGenerate.groovy")
includeTargets << new File("$scaffoldingPluginDir/scripts/_GrailsGenerate.groovy")
includeTargets << grailsScript("_GrailsBootstrap")

generateForName = null
Expand Down
1 change: 1 addition & 0 deletions src/templates/scaffolding/index.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<link rel="stylesheet" href="\${resource(dir: 'css', file: 'mobile.css')}" type="text/css">

<r:require module="angular-scaffolding"/>
<r:require modules="bootstrap"/>
</head>
<body data-ng-app="scaffolding" data-base-url="\${createLink(uri: '/${domainClass.propertyName}/')}">
<a href="#list-${domainClass.propertyName}" class="skip" tabindex="-1"><g:message code="default.link.skip.label" default="Skip to content&hellip;"/></a>
Expand Down
4 changes: 2 additions & 2 deletions test/apps/grails-ng/application.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Grails Metadata file
#Thu Jan 17 06:46:29 GMT 2013
app.grails.version=2.2.1
#Sat Feb 08 05:29:08 EST 2014
app.grails.version=2.3.4
app.name=grails-ng
app.servlet.version=2.5
app.version=1.0-SNAPSHOT
Expand Down
54 changes: 38 additions & 16 deletions test/apps/grails-ng/grails-app/conf/BuildConfig.groovy
Original file line number Diff line number Diff line change
@@ -1,42 +1,64 @@
grails.project.work.dir = 'target'
grails.project.class.dir = 'target/classes'
grails.project.test.class.dir = 'target/test-classes'
grails.project.test.reports.dir = 'target/test-reports'
grails.servlet.version = "3.0" // Change depending on target container compliance (2.5 or 3.0)
grails.project.class.dir = "target/classes"
grails.project.test.class.dir = "target/test-classes"
grails.project.test.reports.dir = "target/test-reports"
grails.project.work.dir = "target/work"
grails.project.target.level = 1.6
grails.project.source.level = 1.6
//grails.project.war.file = "target/${appName}-${appVersion}.war"

grails.project.fork = [
// configure settings for compilation JVM, note that if you alter the Groovy version forked compilation is required
// compile: [maxMemory: 256, minMemory: 64, debug: false, maxPerm: 256, daemon:true],

// configure settings for the test-app JVM, uses the daemon by default
test: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, daemon:true],
// configure settings for the run-app JVM
run: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, forkReserve:false],
// configure settings for the run-war JVM
war: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, forkReserve:false],
// configure settings for the Console UI JVM
console: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256]
]

grails.project.dependency.resolver = "maven" // or ivy

grails.project.dependency.resolution = {

inherits 'global'
log 'warn'

repositories {
inherits true // Whether to inherit repository definitions from plugins

grailsPlugins()
grailsHome()

grailsCentral()
mavenCentral()
mavenLocal()
mavenRepo 'http://maven.springframework.org/milestone/'
}

dependencies {
test 'org.spockframework:spock-grails-support:0.7-groovy-2.0'
}

plugins {
build ":tomcat:$grailsVersion"
build ":tomcat:7.0.42"

compile ':cloud-foundry:1.2.3',
':cache-headers:1.1.5',
':gson:1.1.4'

runtime ":hibernate:$grailsVersion",
':resources:1.2.RC2',
':jquery:1.8.3',
':cached-resources:1.0',
':zipped-resources:1.0',
':database-migration:1.3.2'

test(':spock:0.7') {
exclude 'spock-grails-support'
}
// plugins needed at runtime but not for compilation
runtime ":hibernate:3.6.10.5" // or ":hibernate4:4.1.11.1"
runtime ":database-migration:1.3.5"
runtime ":jquery:1.11.0"
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"

}
}

Expand Down
24 changes: 24 additions & 0 deletions test/apps/grails-ng/grails-app/conf/Config.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,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 */
11 changes: 2 additions & 9 deletions test/apps/grails-ng/grails-app/conf/UrlMappings.groovy
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
class UrlMappings {

static mappings = {
"/album/index"(controller: "album", action: "index")
"/album"(controller: "album", action: "list")
"/album/$id?"(resource: "album")

"/$controller/$action?/$id?"{
constraints {
// apply constraints here
}
}
"/album/page"(controller: "album", action: "page")
"/album"(resources: "album")

"/"(view:"/index")
"500"(view:'/error')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ import static grails.plugin.gson.http.HttpConstants.*

class AlbumController {

def index() { }

def list(Integer max) {
def index(Integer max) {
params.max = Math.min(max ?: 10, 100)
response.addIntHeader X_PAGINATION_TOTAL, Album.count()
render Album.list(params) as GSON
}

def page() {
}

def save() {
if (!requestIsJson()) {
respondNotAcceptable()
Expand Down
2 changes: 1 addition & 1 deletion test/apps/grails-ng/grails-app/views/templates/_navbar.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="nav-collapse">
<ul class="nav">
<g:each var="c" in="${grailsApplication.controllerClasses.sort { it.fullName } }">
<li <g:if test="${controllerName == c.logicalPropertyName}">class="active"</g:if>><g:link controller="${c.logicalPropertyName}">${c.naturalName}</g:link></li>
<li <g:if test="${controllerName == c.logicalPropertyName}">class="active"</g:if>><g:link controller="${c.logicalPropertyName}" action="page">${c.naturalName}</g:link></li>
</g:each>
</ul>
</div>
Expand Down
7 changes: 4 additions & 3 deletions test/apps/grails-ng/web-app/WEB-INF/applicationContext.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

<bean id="grailsApplication" class="org.codehaus.groovy.grails.commons.GrailsApplicationFactoryBean">
<description>Grails application factory bean</description>
Expand Down Expand Up @@ -30,4 +29,6 @@ http://www.springframework.org/schema/beans http://www.springframework.org/schem
<value>utf-8</value>
</property>
</bean>

<bean id="conversionService" class="org.springframework.context.support.ConversionServiceFactoryBean" />
</beans>
Loading