forked from sebastianhohns/grails-jasper
-
Notifications
You must be signed in to change notification settings - Fork 28
/
JasperGrailsPlugin.groovy
41 lines (37 loc) · 1.33 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
class JasperGrailsPlugin {
def version = "1.12.0-SNAPSHOT"
def grailsVersion = "2.1.0 > *"
def author = "Craig Andrews"
def authorEmail = "[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/candrews/grails-jasper"]
List pluginExcludes = [
'docs/**',
'src/docs/**'
]
def title = "Jasper Plugin"
def description = '''
Adds easy support for launching jasper reports from GSP pages.
After installing, run your application and request (app-url)/jasper/demo for a demonstration and instructions.
'''
def documentation = "http://www.grails.org/plugin/jasper"
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')
}
}
}
}