Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Burt Beckwith committed Sep 29, 2012
1 parent 9716b16 commit ed858be
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 161 deletions.
35 changes: 22 additions & 13 deletions .classpath
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/java"/>
<classpathentry kind="src" path="src/groovy"/>
<classpathentry kind="src" path="grails-app/conf"/>
<classpathentry kind="src" path="grails-app/controllers"/>
<classpathentry kind="src" path="grails-app/domain"/>
<classpathentry kind="src" path="grails-app/services"/>
<classpathentry kind="src" path="grails-app/taglib"/>
<classpathentry kind="src" path="test/integration"/>
<classpathentry kind="src" path="test/unit"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="com.springsource.sts.grails.core.CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="web-app/WEB-INF/classes"/>
</classpath>
<classpathentry kind="src" path="src/java"/>
<classpathentry kind="src" path="grails-app/conf"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="src" path=".link_to_grails_plugins/release-2.0.4/src/groovy">
<attributes>
<attribute name="org.grails.ide.eclipse.core.SOURCE_FOLDER" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path=".link_to_grails_plugins/release-2.0.4/src/java">
<attributes>
<attribute name="org.grails.ide.eclipse.core.SOURCE_FOLDER" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path=".link_to_grails_plugins/rest-client-builder-1.0.2/src/groovy">
<attributes>
<attribute name="org.grails.ide.eclipse.core.SOURCE_FOLDER" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.grails.ide.eclipse.core.CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/eclipseclasses"/>
</classpath>
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ grails
plugin.xml
*.zip
target

web-app
*.log
.settings
9 changes: 8 additions & 1 deletion .project
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,15 @@
</buildCommand>
</buildSpec>
<natures>
<nature>com.springsource.sts.grails.core.nature</nature>
<nature>org.grails.ide.eclipse.core.nature</nature>
<nature>org.eclipse.jdt.groovy.core.groovyNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
<linkedResources>
<link>
<name>.link_to_grails_plugins</name>
<type>2</type>
<locationURI>GRAILS_ROOT/grails-cors/target/plugins</locationURI>
</link>
</linkedResources>
</projectDescription>
58 changes: 2 additions & 56 deletions CorsGrailsPlugin.groovy
Original file line number Diff line number Diff line change
@@ -1,44 +1,17 @@
import org.springframework.web.filter.DelegatingFilterProxy
import com.brandseye.cors.CorsFilter

class CorsGrailsPlugin {
// the plugin version
def version = "1.0.0"
// the version or versions of Grails the plugin is designed for
def grailsVersion = "2.0 > *"
// the other plugins this plugin depends on
def dependsOn = [:]
// resources that are excluded from plugin packaging
def pluginExcludes = [
"grails-app/views/error.gsp"
]

def title = "CORS Plugin" // Headline display name of the plugin
def title = "CORS Plugin"
def author = "David Tinker"
def authorEmail = "david.tinker@gmail.com"
def description = '''\
Installs a servlet filter to set Access-Control-Allow-Origin and other CORS related headers to enable cross site
AJAX requests to your Grails application
'''

// URL to the plugin's documentation
def description = 'Installs a servlet filter to set Access-Control-Allow-Origin and other CORS related headers to enable cross site AJAX requests to your Grails application'
def documentation = "https://github.com/davidtinker/grails-cors"

// Extra (optional) plugin metadata

// License: one of 'APACHE', 'GPL2', 'GPL3'
def license = "APACHE"

// Details of company behind the plugin (if there is one)
def organization = [ name: "BrandsEye", url: "http://www.brandseye.com/" ]

// Any additional developers beyond the author specified above.
// def developers = [ [ name: "Joe Bloggs", email: "joe@bloggs.net" ]]

// Location of the plugin's issue tracker.
def issueManagement = [ system: "Github", url: "https://github.com/davidtinker/grails-cors/issues" ]

// Online location of the plugin's browseable source code.
def scm = [ url: "https://github.com/davidtinker/grails-cors" ]

def doWithWebDescriptor = { xml ->
Expand Down Expand Up @@ -79,31 +52,4 @@ AJAX requests to your Grails application
}
}
}

def doWithSpring = {
// TODO Implement runtime spring config (optional)
}

def doWithDynamicMethods = { ctx ->
// TODO Implement registering dynamic methods to classes (optional)
}

def doWithApplicationContext = { applicationContext ->
// TODO Implement post initialization spring config (optional)
}

def onChange = { event ->
// TODO Implement code that is executed when any artefact that this plugin is
// watching is modified and reloaded. The event contains: event.source,
// event.application, event.manager, event.ctx, and event.plugin.
}

def onConfigChange = { event ->
// TODO Implement code that is executed when the project configuration changes.
// The event is the same as for 'onChange'.
}

def onShutdown = { event ->
// TODO Implement code that is executed when the application shuts down (optional)
}
}
3 changes: 0 additions & 3 deletions application.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#Grails Metadata file
#Fri Sep 28 08:30:25 SAST 2012
app.grails.version=2.1.1
app.name=cors
31 changes: 5 additions & 26 deletions grails-app/conf/BuildConfig.groovy
Original file line number Diff line number Diff line change
@@ -1,36 +1,15 @@
grails.project.class.dir = "target/classes"
grails.project.test.class.dir = "target/test-classes"
grails.project.test.reports.dir = "target/test-reports"
grails.project.work.dir = "target"

grails.project.dependency.resolution = {
// inherit Grails' default dependencies
inherits("global") {
// uncomment to disable ehcache
// excludes 'ehcache'
}
log "warn" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
inherits "global"
log "warn"

repositories {
grailsCentral()
// uncomment the below to enable remote dependency resolution
// from public Maven repositories
//mavenLocal()
//mavenCentral()
//mavenRepo "http://snapshots.repository.codehaus.org"
//mavenRepo "http://repository.codehaus.org"
//mavenRepo "http://download.java.net/maven/2/"
//mavenRepo "http://repository.jboss.com/maven2/"
}

dependencies {
// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.

// runtime 'mysql:mysql-connector-java:5.1.18'
}

plugins {
build(":tomcat:$grailsVersion",
":release:2.0.4",
":rest-client-builder:1.0.2") {
build(":release:2.0.4", ":rest-client-builder:1.0.2") {
export = false
}
}
Expand Down
26 changes: 4 additions & 22 deletions grails-app/conf/Config.groovy
Original file line number Diff line number Diff line change
@@ -1,24 +1,6 @@
// configuration for plugin testing - will not be included in the plugin zip

log4j = {
// Example of changing the log pattern for the default console
// appender:
//
//appenders {
// console name:'stdout', layout:pattern(conversionPattern: '%c{2} %m%n')
//}

error 'org.codehaus.groovy.grails.web.servlet', // controllers
'org.codehaus.groovy.grails.web.pages', // GSP
'org.codehaus.groovy.grails.web.sitemesh', // layouts
'org.codehaus.groovy.grails.web.mapping.filter', // URL mapping
'org.codehaus.groovy.grails.web.mapping', // URL mapping
'org.codehaus.groovy.grails.commons', // core / classloading
'org.codehaus.groovy.grails.plugins', // plugins
'org.codehaus.groovy.grails.orm.hibernate', // hibernate integration
'org.springframework',
'org.hibernate',
'net.sf.ehcache.hibernate'

warn 'org.mortbay.log'
error 'org.codehaus.groovy.grails',
'org.springframework',
'org.hibernate',
'net.sf.ehcache.hibernate'
}
49 changes: 10 additions & 39 deletions grails-app/conf/DataSource.groovy
Original file line number Diff line number Diff line change
@@ -1,43 +1,14 @@
dataSource {
pooled = true
driverClassName = "org.h2.Driver"
username = "sa"
password = ""
pooled = true
driverClassName = 'org.h2.Driver'
username = 'sa'
password = ''
dbCreate = 'update'
url = 'jdbc:h2:mem:testDb'
}

hibernate {
cache.use_second_level_cache = true
cache.use_query_cache = false
cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory'
}
// environment specific settings
environments {
development {
dataSource {
dbCreate = "create-drop" // one of 'create', 'create-drop', 'update', 'validate', ''
url = "jdbc:h2:mem:devDb;MVCC=TRUE;LOCK_TIMEOUT=10000"
}
}
test {
dataSource {
dbCreate = "update"
url = "jdbc:h2:mem:testDb;MVCC=TRUE;LOCK_TIMEOUT=10000"
}
}
production {
dataSource {
dbCreate = "update"
url = "jdbc:h2:prodDb;MVCC=TRUE;LOCK_TIMEOUT=10000"
pooled = true
properties {
maxActive = -1
minEvictableIdleTimeMillis=1800000
timeBetweenEvictionRunsMillis=1800000
numTestsPerEvictionRun=3
testOnBorrow=true
testWhileIdle=true
testOnReturn=true
validationQuery="SELECT 1"
}
}
}
cache.use_second_level_cache = false
cache.use_query_cache = false
cache.provider_class = 'org.hibernate.cache.EhCacheProvider'
}

0 comments on commit ed858be

Please sign in to comment.