Changeset 876 for branches


Ignore:
Timestamp:
Mar 21, 2011, 5:07:36 PM (9 years ago)
Author:
gav
Message:

Upgrade branches/features/grailsUpgrade to Grails-1.3.5, including plugin upgrades and some todo removals.

Location:
branches/features/grailsUpgrade
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/features/grailsUpgrade/application.properties

    r798 r876  
    11#Grails Metadata file
    22#Thu Jan 27 17:24:52 EST 2011
    3 app.grails.version=1.2.2
     3app.grails.version=1.3.5
    44app.name=gnuMims
    55app.servlet.version=2.4
    66app.vcsRevision=$Rev$
    77app.version=
    8 plugins.acegi=0.5.2
    9 plugins.class-diagram=0.5.1
    10 plugins.export=0.6
    11 plugins.filterpane=0.6.8
    12 plugins.help-balloons=1.3
    13 plugins.hibernate=1.2.2
    14 plugins.jasper=0.9.7
     8plugins.acegi=0.5.3
     9plugins.class-diagram=0.5.2
     10plugins.export=0.7
     11plugins.filterpane=0.7
     12plugins.help-balloons=1.4
     13plugins.hibernate=1.3.5
     14plugins.jasper=1.1.3
    1515plugins.navigation=1.1.1
    1616plugins.quartz=0.4.2
    1717plugins.richui=0.8
    18 plugins.searchable=0.5.5
    19 plugins.tomcat=1.2.2
     18plugins.searchable=0.6-SNAPSHOT
     19plugins.tomcat=1.3.5
  • branches/features/grailsUpgrade/grails-app/conf/BootStrap.groovy

    r814 r876  
    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
  • branches/features/grailsUpgrade/grails-app/conf/BuildConfig.groovy

    r636 r876  
    2929    delete file: "${stagingDir}/WEB-INF/lib/poi-3.0.2-FINAL-20080204.jar"
    3030    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"
    4031}
    4132
     
    5142
    5243    repositories {
     44        grailsHome()
    5345        grailsPlugins()
    54         grailsHome()
     46        grailsCentral()
    5547
    5648        // uncomment the below to enable remote dependency resolution
     
    7769        }
    7870
    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 
    8771        runtime ('org.apache.ant:ant:1.7.1')
    8872        runtime ('org.apache.ant:ant-launcher:1.7.1')
  • branches/features/grailsUpgrade/web-app/WEB-INF/tld/grails.tld

    r449 r876  
    55            http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
    66        version="2.0">
    7     <description>The Grails (Groovy on Rails) custom tag library</description>
     7    <description>The Grails custom tag library</description>
    88    <tlib-version>0.2</tlib-version>
    99    <short-name>grails</short-name>
    1010    <uri>http://grails.codehaus.org/tags</uri>
    11 
    1211
    1312    <tag>
Note: See TracChangeset for help on using the changeset viewer.