Skip to content

Commit 767a207

Browse files
committed
Created the plugin.
0 parents  commit 767a207

16 files changed

+3671
-0
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.classpath
2+
.project
3+
*.iml
4+
.idea/
5+
target/

MultiFileUploadGrailsPlugin.groovy

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
class MultiFileUploadGrailsPlugin {
2+
3+
// The plugin version
4+
String version = "0.1"
5+
6+
// The version or versions of Grails the plugin is designed for
7+
String grailsVersion = "2.5 > *"
8+
9+
// Resources that are excluded from plugin packaging
10+
List pluginExcludes = [
11+
"grails-app/views/error.gsp"
12+
]
13+
14+
String title = "Multi File Upload Plugin" // Headline display name of the plugin
15+
String author = "Shashank Agrawal"
16+
String authorEmail = ""
17+
String description = "A Grails plugin to provide multi purpose file upload functionality."
18+
19+
// URL to the plugin's documentation
20+
//String documentation = "http://grails.org/plugin/kernel"
21+
22+
// License: one of 'APACHE', 'GPL2', 'GPL3'
23+
//String license = "APACHE"
24+
25+
Map organization = [name: "Wiz Panda", url: ""]
26+
27+
Map issueManagement = [system: "GITHUB", url: "https://github.com/wizpanda/multi-file-upload/issues"]
28+
29+
Map scm = [ url: "https://github.com/wizpanda/multi-file-upload" ]
30+
31+
def doWithWebDescriptor = { xml ->
32+
// TODO Implement additions to web.xml (optional), this event occurs before
33+
}
34+
35+
def doWithSpring = {
36+
// TODO Implement runtime spring config (optional)
37+
}
38+
39+
def doWithDynamicMethods = { ctx ->
40+
// TODO Implement registering dynamic methods to classes (optional)
41+
}
42+
43+
def doWithApplicationContext = { ctx ->
44+
// TODO Implement post initialization spring config (optional)
45+
}
46+
47+
def onChange = { event ->
48+
// TODO Implement code that is executed when any artefact that this plugin is
49+
// watching is modified and reloaded. The event contains: event.source,
50+
// event.application, event.manager, event.ctx, and event.plugin.
51+
}
52+
53+
def onConfigChange = { event ->
54+
// TODO Implement code that is executed when the project configuration changes.
55+
// The event is the same as for 'onChange'.
56+
}
57+
58+
def onShutdown = { event ->
59+
// TODO Implement code that is executed when the application shuts down (optional)
60+
}
61+
}

application.properties

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#Grails Metadata file
2+
#Sun May 29 17:24:29 IST 2016
3+
app.grails.version=2.5.4
4+
app.name=multi-file-upload

grails-app/conf/BuildConfig.groovy

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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+
5+
grails.project.fork = [
6+
// configure settings for the test-app JVM, uses the daemon by default
7+
test : [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, daemon: true],
8+
// configure settings for the run-app JVM
9+
run : [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, forkReserve: false],
10+
// configure settings for the run-war JVM
11+
war : [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, forkReserve: false],
12+
// configure settings for the Console UI JVM
13+
console: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256]
14+
]
15+
16+
grails.project.dependency.resolver = "maven" // or ivy
17+
grails.project.dependency.resolution = {
18+
// inherit Grails' default dependencies
19+
inherits("global") {
20+
// uncomment to disable ehcache
21+
// excludes 'ehcache'
22+
}
23+
log "warn" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
24+
repositories {
25+
grailsCentral()
26+
mavenLocal()
27+
mavenCentral()
28+
}
29+
dependencies {
30+
}
31+
32+
plugins {
33+
build(":release:3.1.2", ":rest-client-builder:2.1.1") {
34+
export = false
35+
}
36+
}
37+
}

grails-app/conf/Config.groovy

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// configuration for plugin testing - will not be included in the plugin zip
2+
3+
log4j = {
4+
5+
error 'org.codehaus.groovy.grails.web.servlet', // controllers
6+
'org.codehaus.groovy.grails.web.pages', // GSP
7+
'org.codehaus.groovy.grails.web.sitemesh', // layouts
8+
'org.codehaus.groovy.grails.web.mapping.filter', // URL mapping
9+
'org.codehaus.groovy.grails.web.mapping', // URL mapping
10+
'org.codehaus.groovy.grails.commons', // core / classloading
11+
'org.codehaus.groovy.grails.plugins', // plugins
12+
'org.codehaus.groovy.grails.orm.hibernate', // hibernate integration
13+
'org.springframework',
14+
'org.hibernate',
15+
'net.sf.ehcache.hibernate'
16+
}

grails-app/conf/DataSource.groovy

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
dataSource {
2+
pooled = true
3+
jmxExport = true
4+
driverClassName = "org.h2.Driver"
5+
username = "sa"
6+
password = ""
7+
}
8+
hibernate {
9+
cache.use_second_level_cache = true
10+
cache.use_query_cache = false
11+
cache.region.factory_class = 'org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory' // Hibernate 4
12+
singleSession = true // configure OSIV singleSession mode
13+
flush.mode = 'manual' // OSIV session flush mode outside of transactional context
14+
}
15+
16+
environments {
17+
development {
18+
dataSource {
19+
dbCreate = "create-drop" // one of 'create', 'create-drop', 'update', 'validate', ''
20+
url = "jdbc:h2:mem:devDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE"
21+
}
22+
}
23+
test {
24+
dataSource {
25+
dbCreate = "update"
26+
url = "jdbc:h2:mem:testDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE"
27+
}
28+
}
29+
}

grails-app/conf/UrlMappings.groovy

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

grails-app/views/error.gsp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title><g:if env="development">Grails Runtime Exception</g:if><g:else>Error</g:else></title>
5+
<meta name="layout" content="main">
6+
<g:if env="development"><asset:stylesheet src="errors.css"/></g:if>
7+
</head>
8+
<body>
9+
<g:if env="development">
10+
<g:renderException exception="${exception}" />
11+
</g:if>
12+
<g:else>
13+
<ul class="errors">
14+
<li>An error has occurred</li>
15+
</ul>
16+
</g:else>
17+
</body>
18+
</html>

scripts/_Install.groovy

Lines changed: 10 additions & 0 deletions
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+
//

scripts/_Uninstall.groovy

Lines changed: 5 additions & 0 deletions
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+
//

0 commit comments

Comments
 (0)