-
Notifications
You must be signed in to change notification settings - Fork 53
/
Copy pathJasperGrailsPlugin.groovy
70 lines (57 loc) · 2.27 KB
/
JasperGrailsPlugin.groovy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
class JasperGrailsPlugin {
def version = "1.7"
def grailsVersion = "2.1.0 > *"
def developers = [
[name: "Sebastian Hohns", email: "[email protected]"]]
def license = "Apache License 2.0"
def issueManagement = [system: "JIRA", url: "http://jira.grails.org/browse/GPJASPER"]
def scm = [url: "https://github.com/sebastianhohns/grails-jasper"]
def author = "Sebastian Hohns"
def authorEmail = "[email protected]"
List pluginExcludes = [
'docs/**',
'src/docs/**'
]
def title = "jasper plugin"
def description = '''
This plugin adds easy support for launching jasper reports from GSP pages.
After installing this plugin, run your application and request (app-url)/jasper/demo for a demonstration and instructions.
'''
def documentation = "http://www.grails.org/plugin/jasper"
def dependsOn = [:]
def doWithSpring = {
// TODO Implement runtime spring config (optional)
}
def doWithApplicationContext = { applicationContext ->
// TODO Implement post initialization spring config (optional)
}
def doWithWebDescriptor = { xml ->
def servlets = xml.servlet
def lastServlet = servlets[servlets.size() - 1]
lastServlet + {
servlet {
'servlet-name'('image')
'servlet-class'('net.sf.jasperreports.j2ee.servlets.ImageServlet')
}
}
def mappings = xml.'servlet-mapping'
def lastMapping = mappings[mappings.size() - 1]
lastMapping + {
'servlet-mapping' {
'servlet-name'('image')
'url-pattern'('/reports/image')
}
}
}
def doWithDynamicMethods = { ctx ->
// TODO Implement registering dynamic methods to classes (optional)
}
def onChange = { event ->
// TODO Implement code that is executed when this class plugin class is changed
// the event contains: event.application and event.applicationContext objects
}
def onApplicationChange = { event ->
// TODO Implement code that is executed when any class in a GrailsApplication changes
// the event contain: event.source, event.application and event.applicationContext objects
}
}