A plugin to integrate ZK infrastructure to modern Grails. A port of ZKGrails plugin to current versions of Grails. Versions 5 and 4 are supported. Version 3 is allowed but not tested.
Follow these tutorials for upgrading Grails:
- https://docs.grails.org/3.0.x/guide/upgrading.html
- https://docs.grails.org/4.0.12/guide/single.html#upgrading
- https://docs.grails.org/5.2.2/guide/upgrading.html#upgrading40x
- https://www.danvega.dev/blog/2017/06/16/migrating-grails-2-x-applications-grails-3-x
All static resources in src/main/resources/public
and src/main/webapp
referenced in zul files as url
should be prefixed by /static/
.
grails-app install-zk-xml
buildscript {
repositories {
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "io.github.zkgroovy:grailszk-gradle-plugin:1.0.0"
}
}
apply plugin:"io.github.zkgroovy.grailszk-gradle-plugin"
build.gradle:
// Omitted Grails dependencies for brevity
dependencies {
implementation "io.github.zkgroovy:grailszk:$grailszkVersion"
implementation "org.zkoss.zk:zk:$zkVersion", {
exclude group: "org.zkoss.zk", module: "zkplus"
}
implementation "org.zkoss.zk:zul:$zkVersion"
implementation "org.zkoss.zk:zhtml:$zkVersion"
implementation "org.zkoss.zk:zkbind:$zkVersion"
implementation "org.zkoss.common:zel:$zkVersion"
implementation "org.zkoss.common:zcommon:$zkVersion"
implementation ("org.zkoss.common:zweb:$zkVersion") {
transitive = true
exclude module: "ResourceCaches"
}
implementation "org.zkoss.zk:zkplus:7.0.1"
}
configurations.all {
exclude group: "org.slf4j", module: "slf4j-jdk14"
}
gradle.properties (see available versions):
zkVersion=9.6.0.1
grailszkVersion=4.2.0
In order to use this plugin with Spring Security you should have the following configuration:
build.gradle:
repositories {
maven { url "https://mavensync.zkoss.org/maven2" }
}
dependencies {
implementation "org.zkoss.zk:zkspring-security:4.0.1"
}
zk.xml:
<?xml version="1.0" encoding="UTF-8"?>
<zk>
<listener>
<listener-class>org.zkoss.spring.init.SecurityContextAwareExecutionListener</listener-class>
</listener>
</zk>
In order to make ZK work with spring-boot-devtools without raising any errors create a META-INF/spring-devtools.properties
in the grails-app/conf/
folder including Grailszk, all ZK dependencies, components, themes and plugins. e.g:
restart.include.zk=/z[\\w]+-[\\w\\d-\\.]+\\.jar
restart.include.ckez=/ckez-(.*).jar
restart.include.breeze=/breeze-(.*).jar
restart.include.grailszk=/grailszk-(.*).jar
restart.include.silvertail=/silvertail-(.*).jar
restart.include.iceblue_c=/iceblue_c-(.*).jar
restart.include.sapphire=/sapphire-(.*).jar
restart.include.codemirror=/(.*)codemirror(.*).jar
Download ZK jars zkgrails2-common.jar
and place them in the lib folder which must be inside the plugin root directory.
Always change the version of the project before publishing. e.g. publishing version 4 to Maven Local:
./change-version.sh -v 4 && ./gradlew -Pversion=4.2.2 publishToMavenLocal
- Source code until version 2.5.2 comes from http://code.google.com/p/zkgrails.
- Below version 2.0 the code is forked from https://github.com/zkgrails/zkgrails.