Changeset 913 for trunk/grails-app/conf


Ignore:
Timestamp:
May 1, 2011, 12:46:31 PM (14 years ago)
Author:
gav
Message:

Svn merge -r875:r911 branches/features/grailsUpgrade/ into trunk/.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/grails-app/conf/BootStrap.groovy

    r814 r913  
    11class BootStrap
    22{
    3 
    4     def sessionFactory // used by isDirty().
    5     def grailsApplication // used by isDirty().
    63    def createDataService
    74
    85    def init = { servletContext ->
    9 
    10         /** Add isDirty() to domainClasses.
    11         * @todo remove after upgrading to Grails-1.3 >.
    12         * See: http://grails.1312388.n4.nabble.com/beforeUpdate-Compare-with-previous-set-value-isDirty-not-working-in-Events-td1695661.html
    13         */
    14         addDirtyCheckMethods()
    156
    167        /** Environment specific settings.
     
    4637    }
    4738
    48    private void addDirtyCheckMethods() {
    49       for (dc in grailsApplication.domainClasses) {
    50          addDirtyCheckMethods dc.clazz.metaClass
    51       }
    52    }
    53 
    54     private void addDirtyCheckMethods(metaClass) {
    55       metaClass.isDirty = { ->
    56          def session = sessionFactory.currentSession
    57          def entry = findEntityEntry(delegate, session)
    58          if (!entry) {
    59             return false
    60          }
    61 
    62          Object[] values = entry.persister.getPropertyValues(delegate, session.entityMode)
    63          def dirtyProperties = entry.persister.findDirty(values, entry.loadedState, delegate, session)
    64          return dirtyProperties != null
    65       }
    66 
    67       metaClass.isDirty = { String fieldName ->
    68          def session = sessionFactory.currentSession
    69          def entry = findEntityEntry(delegate, session)
    70          if (!entry) {
    71             return false
    72          }
    73 
    74          Object[] values = entry.persister.getPropertyValues(delegate, session.entityMode)
    75          int[] dirtyProperties = entry.persister.findDirty(values, entry.loadedState, delegate, session)
    76          int fieldIndex = entry.persister.propertyNames.findIndexOf { fieldName == it }
    77          return fieldIndex in dirtyProperties
    78       }
    79 
    80       metaClass.getDirtyPropertyNames = { ->
    81          def session = sessionFactory.currentSession
    82          def entry = findEntityEntry(delegate, session)
    83          if (!entry) {
    84             return []
    85          }
    86 
    87          Object[] values = entry.persister.getPropertyValues(delegate, session.entityMode)
    88          int[] dirtyProperties = entry.persister.findDirty(values, entry.loadedState, delegate, session)
    89          def names = []
    90          for (index in dirtyProperties) {
    91             names << entry.persister.propertyNames[index]
    92          }
    93          names
    94       }
    95 
    96       metaClass.getPersistentValue = { String fieldName ->
    97          def session = sessionFactory.currentSession
    98          def entry = findEntityEntry(delegate, session, false)
    99          if (!entry) {
    100             return null
    101          }
    102 
    103          int fieldIndex = entry.persister.propertyNames.findIndexOf { fieldName == it }
    104          return fieldIndex == -1 ? null : entry.loadedState[fieldIndex]
    105       }
    106    }
    107 
    108    private findEntityEntry(instance, session, boolean forDirtyCheck = true) {
    109       def entry = session.persistenceContext.getEntry(instance)
    110       if (!entry) {
    111          return null
    112       }
    113 
    114       if (forDirtyCheck && !entry.requiresDirtyCheck(instance) && entry.loadedState) {
    115          return null
    116       }
    117 
    118       entry
    119    }
    120 
    12139} // end class
  • trunk/grails-app/conf/BuildConfig.groovy

    r636 r913  
    11grails.project.class.dir = "target/classes"
    22grails.project.test.class.dir = "target/test-classes"
    3 grails.project.test.reports.dir = "target/test-reports"
     3grails.project.test.reports.dir = "target/test-reports"
    44
    55def env = System.getProperty('grails.env')
     
    88    case "production":
    99        //grails.project.war.file = "target/${appName}-${appVersion}.war"
    10         grails.project.war.file="target/${appName}Live.war"
     10        grails.project.war.file = "target/${appName}Live.war"
    1111        break
    1212    case "development":
    13         grails.project.war.file="target/${appName}Dev.war"
     13        grails.project.war.file = "target/${appName}Dev.war"
    1414        break
    1515    default:
    16         grails.project.war.file="target/${appName}.war"
     16        grails.project.war.file = "target/${appName}.war"
    1717        break
    1818}
    1919
    2020grails.war.resources = { stagingDir, args ->
    21     // Remove some duplicate jars.
    22     delete file: "${stagingDir}/WEB-INF/lib/jasperreports-2.0.5.jar"
    23     delete file: "${stagingDir}/WEB-INF/lib/jasperreports-3.1.2.jar"
    24     delete file: "${stagingDir}/WEB-INF/lib/aspectjrt-1.5.4.jar"
    25     delete file: "${stagingDir}/WEB-INF/lib/commons-digester-1.7.jar"
    26     delete file: "${stagingDir}/WEB-INF/lib/iText-2.0.8.jar"
     21    // Remove some duplicate/not required jars.
     22    // From export plugin lib dir.
    2723    delete file: "${stagingDir}/WEB-INF/lib/iText-2.1.5.jar"
    28     delete file: "${stagingDir}/WEB-INF/lib/jfreechart-1.0.3.jar"
    29     delete file: "${stagingDir}/WEB-INF/lib/poi-3.0.2-FINAL-20080204.jar"
    30     delete file: "${stagingDir}/WEB-INF/lib/facebook-2.0.4.jar"
    31     // Included by searchable plugin.
    32     delete file: "${stagingDir}/WEB-INF/lib/compass-2.1.0.jar"
    33     delete file: "${stagingDir}/WEB-INF/lib/compass-2.1.0-src.jar"
    34     delete file: "${stagingDir}/WEB-INF/lib/lucene-core.jar"
    35     delete file: "${stagingDir}/WEB-INF/lib/lucene-analyzers.jar"
    36     delete file: "${stagingDir}/WEB-INF/lib/lucene-highlighter.jar"
    37     delete file: "${stagingDir}/WEB-INF/lib/lucene-queries.jar"
    38     delete file: "${stagingDir}/WEB-INF/lib/lucene-snowball.jar"
    39     delete file: "${stagingDir}/WEB-INF/lib/lucene-spellchecker.jar"
     24    // From acegi plugin lib dir.
     25    delete file: "${stagingDir}/WEB-INF/lib/facebook-java-api-2.0.4.jar"
     26    delete file: "${stagingDir}/WEB-INF/lib/easymock.jar"
     27    delete file: "${stagingDir}/WEB-INF/lib/cas-client-core-3.1.1.jar"
     28    delete file: "${stagingDir}/WEB-INF/lib/openid4java-0.9.2.jar"
     29
    4030}
    4131
     
    4333
    4434    // inherit Grails' default dependencies
    45     inherits( "global" ) {
     35    inherits("global") {
    4636        // uncomment to disable ehcache
    4737        // excludes 'ehcache'
     
    5141
    5242    repositories {
     43        grailsHome()
    5344        grailsPlugins()
    54         grailsHome()
     45        grailsCentral()
    5546
    5647        // uncomment the below to enable remote dependency resolution
     
    5849        //mavenLocal()
    5950        mavenCentral()
     51        mavenRepo "https://nexus.codehaus.org/content/repositories/snapshots"
    6052        //mavenRepo "http://snapshots.repository.codehaus.org"
    6153        //mavenRepo "http://repository.codehaus.org"
    6254        //mavenRepo "http://download.java.net/maven/2/"
    6355        //mavenRepo "http://repository.jboss.com/maven2/"
     56    }
     57
     58    plugins {
     59        runtime ':acegi:0.5.3'
     60        runtime ':export:0.7'
     61        runtime ':filterpane:0.7'
     62        runtime ':help-balloons:1.4'
     63        runtime(':jasper:1.1.3') {
     64            transitive = false
     65        }
     66        runtime ':navigation:1.1.1'
     67        runtime ':quartz:0.4.2'
     68        runtime ':richui:0.8'
     69        runtime ':searchable:0.6-SNAPSHOT'
     70
     71        test ':geb:0.6-SNAPSHOT'
     72        test ':spock:0.5-groovy-1.7'
    6473    }
    6574
     
    6978        runtime 'mysql:mysql-connector-java:5.1.9'
    7079
    71         runtime ('org.apache.poi:poi:3.5-FINAL') {
    72             excludes 'servlet-api', 'commons-logging', 'log4j'
     80        // Japser plugin.
     81        runtime('net.sf.jasperreports:jasperreports:3.7.2') {
     82            excludes 'antlr', 'commons-beanutils', 'commons-collections', 'commons-logging',
     83                    'ant', 'mondrian', 'commons-javaflow','barbecue', 'xml-apis-ext','xml-apis', 'xalan', 'groovy-all', 'hibernate', 'saaj-api', 'servlet-api',
     84                    'xercesImpl','xmlParserAPIs','spring-core','bsh', 'spring-beans', 'jaxen', 'barcode4j','batik-svg-dom','batik-xml','batik-awt-util','batik-dom',
     85                    'batik-css','batik-gvt','batik-script', 'batik-svggen','batik-util','batik-bridge','persistence-api','jdtcore','bcmail-jdk14','bcprov-jdk14','bctsp-jdk14'
     86        }
     87        runtime('org.apache.poi:poi:3.5-FINAL') {
     88            excludes 'log4j', 'commons-logging'
    7389        }
    7490
    75         runtime ('net.sf.jasperreports:jasperreports:3.7.2') {
     91        // Origin unknown, still required?
     92        runtime('org.apache.ant:ant:1.7.1')
     93        runtime('org.apache.ant:ant-launcher:1.7.1')
     94
     95        test('org.seleniumhq.selenium:selenium-htmlunit-driver:latest.release') {
    7696            excludes 'xml-apis'
    7797        }
    78 
    79         runtime ('org.compass-project:compass:2.1.4')
    80         runtime ('org.apache.lucene:lucene-core:2.4.1')
    81         runtime ('org.apache.lucene:lucene-analyzers:2.4.1')
    82         runtime ('org.apache.lucene:lucene-highlighter:2.4.1')
    83         runtime ('org.apache.lucene:lucene-queries:2.4.1')
    84         runtime ('org.apache.lucene:lucene-snowball:2.4.1')
    85         runtime ('org.apache.lucene:lucene-spellchecker:2.4.1')
    86 
    87         runtime ('org.apache.ant:ant:1.7.1')
    88         runtime ('org.apache.ant:ant-launcher:1.7.1')
    89 
    9098    }
    9199
  • trunk/grails-app/conf/SecurityConfig.groovy

    r532 r913  
    4444    '/plugins/*/css/**': ['IS_AUTHENTICATED_ANONYMOUSLY'],
    4545    '/plugins/*/js/**': ['IS_AUTHENTICATED_ANONYMOUSLY'],
    46     '/classDiagram*': ['IS_AUTHENTICATED_FULLY'],
    47     '/classDiagram/**': ['IS_AUTHENTICATED_FULLY'],
    4846    '/login*': ['IS_AUTHENTICATED_ANONYMOUSLY'],
    4947    '/login/**': ['IS_AUTHENTICATED_ANONYMOUSLY'],
Note: See TracChangeset for help on using the changeset viewer.