Skip to content

Commit 9a1fc78

Browse files
committed
init
0 parents  commit 9a1fc78

16 files changed

+476
-0
lines changed

Diff for: .classpath

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<classpath>
2+
<classpathentry kind="src" path="src/java"/>
3+
<classpathentry kind="src" path="src/groovy"/>
4+
<classpathentry kind="src" path="grails-app/conf"/>
5+
<classpathentry kind="src" path="grails-app/controllers"/>
6+
<classpathentry kind="src" path="grails-app/domain"/>
7+
<classpathentry kind="src" path="grails-app/services"/>
8+
<classpathentry kind="src" path="grails-app/taglib"/>
9+
<classpathentry kind="src" path="test/integration"/>
10+
<classpathentry kind="src" path="test/unit"/>
11+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
12+
<classpathentry kind="con" path="com.springsource.sts.grails.core.CLASSPATH_CONTAINER"/>
13+
<classpathentry kind="output" path="web-app/WEB-INF/classes"/>
14+
</classpath>

Diff for: .gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
target/
2+
web-app/
3+
zk-themes/
4+
plugin.xml
5+
grails-*.zip
6+
*.swp

Diff for: .project

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>zk-datastore</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>com.springsource.sts.grails.core.nature</nature>
16+
<nature>org.eclipse.jdt.groovy.core.groovyNature</nature>
17+
<nature>org.eclipse.jdt.core.javanature</nature>
18+
</natures>
19+
</projectDescription>
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#Created by grails
2+
eclipse.preferences.version=1
3+
groovy.dont.generate.class.files=true

Diff for: ZkMongodbGrailsPlugin.groovy

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
import org.zkoss.zkgrails.*
2+
3+
class ZkMongodbGrailsPlugin {
4+
// the plugin version
5+
def version = "1.1-M1"
6+
// the version or versions of Grails the plugin is designed for
7+
def grailsVersion = "1.3 > *"
8+
// the other plugins this plugin depends on
9+
def dependsOn = [zk: version, mongodb: "1.0 > *"]
10+
def loadAfter = ['zk']
11+
// resources that are excluded from plugin packaging
12+
def pluginExcludes = [
13+
"grails-app/views/error.gsp"
14+
]
15+
16+
// TODO Fill in these fields
17+
def author = "Chanwit Kaewkasi"
18+
def authorEmail = ""
19+
def title = "Spring MongoDB Datastore support for ZK and Grails"
20+
def description = '''\\
21+
Spring Datastore support for ZK and Grails
22+
'''
23+
24+
// URL to the plugin's documentation
25+
def documentation = "http://grails.org/plugin/zk-mongodb"
26+
27+
static final String GOSIV_CLASS = "zkgrails.mongodb.OpenSessionInViewFilter"
28+
def doWithWebDescriptor = { xml ->
29+
def supportExts = ZkConfigHelper.supportExtensions
30+
31+
//
32+
// e.g. ["*.zul", "/zkau/*"]
33+
//
34+
def filterUrls = supportExts.collect{ "*." + it } + ["/zkau/*"]
35+
36+
//
37+
// e.g. ["*.zul", "*.dsp", "*.zhtml", "*.svg", "*.xml2html"]
38+
//
39+
def urls = supportExts.collect{ "*." + it } +
40+
["*.dsp", "*.zhtml", "*.svg", "*.xml2html"]
41+
42+
// adding GrailsOpenSessionInView
43+
def filterElements = xml.'filter'[0]
44+
filterElements + {
45+
'filter' {
46+
'filter-name' ("GOSIVFilter")
47+
'filter-class' (GOSIV_CLASS)
48+
}
49+
}
50+
// filter for each ZK urls
51+
def filterMappingElements = xml.'filter-mapping'[0]
52+
filterUrls.each {p ->
53+
filterMappingElements + {
54+
'filter-mapping' {
55+
'filter-name'("GOSIVFilter")
56+
'url-pattern'("${p}")
57+
}
58+
}
59+
}
60+
}
61+
62+
def doWithSpring = {
63+
// TODO Implement runtime spring config (optional)
64+
}
65+
66+
def doWithDynamicMethods = { ctx ->
67+
// TODO Implement registering dynamic methods to classes (optional)
68+
}
69+
70+
def doWithApplicationContext = { applicationContext ->
71+
// TODO Implement post initialization spring config (optional)
72+
}
73+
74+
def onChange = { event ->
75+
// TODO Implement code that is executed when any artefact that this plugin is
76+
// watching is modified and reloaded. The event contains: event.source,
77+
// event.application, event.manager, event.ctx, and event.plugin.
78+
}
79+
80+
def onConfigChange = { event ->
81+
// TODO Implement code that is executed when the project configuration changes.
82+
// The event is the same as for 'onChange'.
83+
}
84+
}

Diff for: application.properties

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Grails Metadata file
2+
#Fri Apr 29 18:05:30 ICT 2011
3+
app.grails.version=1.3.7
4+
app.name=zk-mongodb
5+
plugins.mongodb=1.0-M5
6+
plugins.tomcat=1.3.7

Diff for: grails-app/conf/BuildConfig.groovy

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
grails.project.class.dir = "target/classes"
2+
grails.project.test.class.dir = "target/test-classes"
3+
grails.project.test.reports.dir = "target/test-reports"
4+
//grails.project.war.file = "target/${appName}-${appVersion}.war"
5+
grails.project.dependency.resolution = {
6+
// inherit Grails' default dependencies
7+
inherits("global") {
8+
// uncomment to disable ehcache
9+
// excludes 'ehcache'
10+
}
11+
log "warn" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
12+
repositories {
13+
grailsPlugins()
14+
grailsHome()
15+
grailsCentral()
16+
/*
17+
def localResolver = new org.apache.ivy.plugins.resolver.FileSystemResolver(name:"local", settings:ivySettings)
18+
localResolver.addArtifactPattern("/home/chanwit/grails-plugins-repo/grails-[artifact]-[revision].[ext]")
19+
localResolver.latestStrategy = new org.apache.ivy.plugins.latest.LatestTimeStrategy()
20+
// localResolver.changingPattern = ".*SNAPSHOT"
21+
localResolver.setCheckmodified true
22+
resolver localResolver
23+
*/
24+
25+
mavenRepo "http://maven.springframework.org/milestone"
26+
mavenRepo "http://snapshots.repository.codehaus.org"
27+
}
28+
dependencies {
29+
// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.
30+
31+
def excludes = {
32+
excludes "slf4j-simple", "persistence-api", "commons-logging", "jcl-over-slf4j", "slf4j-api", "jta"
33+
excludes "spring-core", "spring-beans", "spring-aop", "spring-tx", "spring-context", "spring-web"
34+
}
35+
compile( "org.springframework:spring-datastore-web:1.0.0.groovy-1.7-M5", excludes)
36+
test("org.grails:grails-datastore-gorm-test:1.0.0.groovy-1.7-M5", excludes)
37+
}
38+
plugins {
39+
runtime ':zk:1.1-M1'
40+
}
41+
}

Diff for: grails-app/conf/Config.groovy

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// configuration for plugin testing - will not be included in the plugin zip
2+
3+
log4j = {
4+
// Example of changing the log pattern for the default console
5+
// appender:
6+
//
7+
//appenders {
8+
// console name:'stdout', layout:pattern(conversionPattern: '%c{2} %m%n')
9+
//}
10+
11+
error 'org.codehaus.groovy.grails.web.servlet', // controllers
12+
'org.codehaus.groovy.grails.web.pages', // GSP
13+
'org.codehaus.groovy.grails.web.sitemesh', // layouts
14+
'org.codehaus.groovy.grails.web.mapping.filter', // URL mapping
15+
'org.codehaus.groovy.grails.web.mapping', // URL mapping
16+
'org.codehaus.groovy.grails.commons', // core / classloading
17+
'org.codehaus.groovy.grails.plugins', // plugins
18+
'org.codehaus.groovy.grails.orm.hibernate', // hibernate integration
19+
'org.springframework',
20+
'org.hibernate',
21+
'net.sf.ehcache.hibernate'
22+
23+
warn 'org.mortbay.log'
24+
}
25+
grails.views.default.codec="none" // none, html, base64
26+
grails.views.gsp.encoding="UTF-8"

Diff for: grails-app/conf/DataSource.groovy

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
dataSource {
2+
pooled = true
3+
driverClassName = "org.hsqldb.jdbcDriver"
4+
username = "sa"
5+
password = ""
6+
}
7+
hibernate {
8+
cache.use_second_level_cache = true
9+
cache.use_query_cache = true
10+
cache.provider_class = 'net.sf.ehcache.hibernate.EhCacheProvider'
11+
}
12+
// environment specific settings
13+
environments {
14+
development {
15+
dataSource {
16+
dbCreate = "create-drop" // one of 'create', 'create-drop','update'
17+
url = "jdbc:hsqldb:mem:devDB"
18+
}
19+
}
20+
test {
21+
dataSource {
22+
dbCreate = "update"
23+
url = "jdbc:hsqldb:mem:testDb"
24+
}
25+
}
26+
production {
27+
dataSource {
28+
dbCreate = "update"
29+
url = "jdbc:hsqldb:file:prodDb;shutdown=true"
30+
}
31+
}
32+
}

Diff for: grails-app/conf/UrlMappings.groovy

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
class UrlMappings {
2+
3+
static mappings = {
4+
"/$controller/$action?/$id?"{
5+
constraints {
6+
// apply constraints here
7+
}
8+
}
9+
10+
"/"(view:"/index")
11+
"500"(view:'/error')
12+
}
13+
}

Diff for: grails-app/i18n/messages.properties

Whitespace-only changes.

Diff for: grails-app/views/error.gsp

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<html>
2+
<head>
3+
<title>Grails Runtime Exception</title>
4+
<style type="text/css">
5+
.message {
6+
border: 1px solid black;
7+
padding: 5px;
8+
background-color:#E9E9E9;
9+
}
10+
.stack {
11+
border: 1px solid black;
12+
padding: 5px;
13+
overflow:auto;
14+
height: 300px;
15+
}
16+
.snippet {
17+
padding: 5px;
18+
background-color:white;
19+
border:1px solid black;
20+
margin:3px;
21+
font-family:courier;
22+
}
23+
</style>
24+
</head>
25+
26+
<body>
27+
<h1>Grails Runtime Exception</h1>
28+
<h2>Error Details</h2>
29+
30+
<div class="message">
31+
<strong>Error ${request.'javax.servlet.error.status_code'}:</strong> ${request.'javax.servlet.error.message'.encodeAsHTML()}<br/>
32+
<strong>Servlet:</strong> ${request.'javax.servlet.error.servlet_name'}<br/>
33+
<strong>URI:</strong> ${request.'javax.servlet.error.request_uri'}<br/>
34+
<g:if test="${exception}">
35+
<strong>Exception Message:</strong> ${exception.message?.encodeAsHTML()} <br />
36+
<strong>Caused by:</strong> ${exception.cause?.message?.encodeAsHTML()} <br />
37+
<strong>Class:</strong> ${exception.className} <br />
38+
<strong>At Line:</strong> [${exception.lineNumber}] <br />
39+
<strong>Code Snippet:</strong><br />
40+
<div class="snippet">
41+
<g:each var="cs" in="${exception.codeSnippet}">
42+
${cs?.encodeAsHTML()}<br />
43+
</g:each>
44+
</div>
45+
</g:if>
46+
</div>
47+
<g:if test="${exception}">
48+
<h2>Stack Trace</h2>
49+
<div class="stack">
50+
<pre><g:each in="${exception.stackTraceLines}">${it.encodeAsHTML()}<br/></g:each></pre>
51+
</div>
52+
</g:if>
53+
</body>
54+
</html>

Diff for: scripts/_Install.groovy

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//
2+
// This script is executed by Grails after plugin was installed to project.
3+
// This script is a Gant script so you can use all special variables provided
4+
// by Gant (such as 'baseDir' which points on project base dir). You can
5+
// use 'ant' to access a global instance of AntBuilder
6+
//
7+
// For example you can create directory under project tree:
8+
//
9+
// ant.mkdir(dir:"${basedir}/grails-app/jobs")
10+
//

Diff for: scripts/_Uninstall.groovy

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
//
2+
// This script is executed by Grails when the plugin is uninstalled from project.
3+
// Use this script if you intend to do any additional clean-up on uninstall, but
4+
// beware of messing up SVN directories!
5+
//

Diff for: scripts/_Upgrade.groovy

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//
2+
// This script is executed by Grails during application upgrade ('grails upgrade'
3+
// command). This script is a Gant script so you can use all special variables
4+
// provided by Gant (such as 'baseDir' which points on project base dir). You can
5+
// use 'ant' to access a global instance of AntBuilder
6+
//
7+
// For example you can create directory under project tree:
8+
//
9+
// ant.mkdir(dir:"${basedir}/grails-app/jobs")
10+
//

0 commit comments

Comments
 (0)