Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #4 from burtbeckwith/master

cleanup
  • Loading branch information...
commit 327bdedaff2523828e19767ca7d4afe6d356cf41 2 parents 5cbe639 + dd5ab6f
@fabiooshiro authored
Showing with 159 additions and 3,330 deletions.
  1. +2 −2 .gitignore
  2. +16 −71 PlasticCriteriaGrailsPlugin.groovy
  3. +9 −10 README.md
  4. +0 −6 application.properties
  5. +21 −32 grails-app/conf/BuildConfig.groovy
  6. +4 −24 grails-app/conf/Config.groovy
  7. +10 −39 grails-app/conf/DataSource.groovy
  8. +0 −13 grails-app/conf/UrlMappings.groovy
  9. +4 −5 grails-app/domain/plastic/criteria/Artist.groovy
  10. +8 −9 grails-app/domain/plastic/criteria/Portrait.groovy
  11. 0  grails-app/i18n/messages.properties
  12. +0 −11 grails-app/views/error.gsp
  13. +0 −38 plugin.xml
  14. +0 −10 scripts/_Install.groovy
  15. +0 −5 scripts/_Uninstall.groovy
  16. +0 −10 scripts/_Upgrade.groovy
  17. +41 −40 src/groovy/plastic/criteria/CriteriaDocTests.groovy
  18. +40 −40 src/groovy/plastic/criteria/PlasticCriteria.groovy
  19. +0 −15 test/integration/plastic/criteria/PlasticCriteriaIntegrationTests.groovy
  20. +4 −8 test/unit/plastic/criteria/PlasticCriteriaTests.groovy
  21. +0 −33 web-app/WEB-INF/applicationContext.xml
  22. +0 −14 web-app/WEB-INF/sitemesh.xml
  23. +0 −572 web-app/WEB-INF/tld/c.tld
  24. +0 −671 web-app/WEB-INF/tld/fmt.tld
  25. +0 −550 web-app/WEB-INF/tld/grails.tld
  26. +0 −311 web-app/WEB-INF/tld/spring.tld
  27. +0 −109 web-app/css/errors.css
  28. +0 −591 web-app/css/main.css
  29. +0 −82 web-app/css/mobile.css
  30. BIN  web-app/images/apple-touch-icon-retina.png
  31. BIN  web-app/images/apple-touch-icon.png
  32. BIN  web-app/images/favicon.ico
  33. BIN  web-app/images/grails_logo.jpg
  34. BIN  web-app/images/grails_logo.png
  35. BIN  web-app/images/leftnav_btm.png
  36. BIN  web-app/images/leftnav_midstretch.png
  37. BIN  web-app/images/leftnav_top.png
  38. BIN  web-app/images/skin/database_add.png
  39. BIN  web-app/images/skin/database_delete.png
  40. BIN  web-app/images/skin/database_edit.png
  41. BIN  web-app/images/skin/database_save.png
  42. BIN  web-app/images/skin/database_table.png
  43. BIN  web-app/images/skin/exclamation.png
  44. BIN  web-app/images/skin/house.png
  45. BIN  web-app/images/skin/information.png
  46. BIN  web-app/images/skin/shadow.jpg
  47. BIN  web-app/images/skin/sorted_asc.gif
  48. BIN  web-app/images/skin/sorted_desc.gif
  49. BIN  web-app/images/spinner.gif
  50. BIN  web-app/images/springsource.png
  51. +0 −9 web-app/js/application.js
View
4 .gitignore
@@ -5,5 +5,5 @@ target
*.log
*.zip
.DS_Store
-web-app/plugins
-web-app/WEB-INF/lib
+web-app
+plugin.xml
View
87 PlasticCriteriaGrailsPlugin.groovy
@@ -1,74 +1,19 @@
class PlasticCriteriaGrailsPlugin {
- // the plugin version
- def version = "0.6"
- // the version or versions of Grails the plugin is designed for
- def grailsVersion = "1.3 > *"
- // the other plugins this plugin depends on
- def dependsOn = [:]
- // resources that are excluded from plugin packaging
- def pluginExcludes = [
- 'grails-app/views/error.gsp',
- 'grails-app/domain/plastic/criteria/Artist.groovy',
- 'grails-app/domain/plastic/criteria/Portrait.groovy',
+ def version = "0.6"
+ def grailsVersion = "1.3 > *"
+ def pluginExcludes = [
+ 'grails-app/domain/**',
'src/groovy/plastic/criteria/CriteriaDocTests.groovy'
- ]
-
- // TODO Fill in these fields
- def title = "Plastic Criteria Plugin" // Headline display name of the plugin
- def author = "Fabio Issamu Oshiro"
- def authorEmail = ""
- def description = '''\
-Mock Grails Criteria for Unit Tests
-'''
-
- // URL to the plugin's documentation
- def documentation = "http://grails.org/plugin/plastic-criteria"
-
- // 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: "Investtools", url: "http://www.investtools.com.br/" ]
-
- // 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: "JIRA", url: "http://jira.grails.org/browse/GPMYPLUGIN" ]
-
- // Online location of the plugin's browseable source code.
- def scm = [ url: "https://github.com/fabiooshiro/plastic-criteria" ]
-
- def doWithWebDescriptor = { xml ->
- // TODO Implement additions to web.xml (optional), this event occurs before
- }
-
- 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)
- }
+ ]
+
+ def title = "Plastic Criteria Plugin"
+ def author = "Fabio Issamu Oshiro"
+ def authorEmail = ""
+ def description = 'Mock Grails Criteria for Unit Tests'
+ def documentation = "http://grails.org/plugin/plastic-criteria"
+
+// def license = "WTFPL"
+ def organization = [ name: "Investtools", url: "http://www.investtools.com.br/" ]
+ def issueManagement = [ system: "GitHub", url: "https://github.com/fabiooshiro/plastic-criteria/issues" ]
+ def scm = [ url: "https://github.com/fabiooshiro/plastic-criteria" ]
}
View
19 README.md
@@ -21,9 +21,9 @@ Grails 2.0.x edit your <your-project>/grails-app/conf/BuildConfig.groovy
// (...)
plugins {
// (...) another plugins
-
+
// add this line
- test ":plastic-criteria:0.4"
+ test ":plastic-criteria:0.6"
}
// (...)
```
@@ -36,27 +36,27 @@ package plastic.test
import grails.test.mixin.*
// import mockCriteria() static method
-import static plastic.criteria.PlasticCriteria.*
+import static plastic.criteria.PlasticCriteria.*
@TestFor(Product)
class ProductTests {
-
+
void testSomething() {
new Product(name: 'Foo', value: 10).save()
new Product(name: 'Foo', value: 20).save()
new Product(name: 'Bar', value: 200).save()
new Product(name: 'Bar', value: 100).save()
-
+
// replace default criteria mock
- mockCriteria([Product])
-
+ mockCriteria([Product])
+
def results = Product.withCriteria{
projections{
groupProperty('name') // now you have groupProperty
sum('value')
}
}
-
+
assert [['Foo', 30 ], ['Bar', 300]] == results
}
}
@@ -67,7 +67,7 @@ just
```
import static plastic.criteria.PlasticCriteria.*;
```
-and
+and
```
mockCriteria([Product])
```
@@ -76,4 +76,3 @@ mockCriteria([Product])
<a href="https://twitter.com/fabiooshiro">Sr. Oshiro</a>,
<a href="http://www.facebook.com/MaxMustang23">Max Mustang</a>,
<a href="https://twitter.com/dtuler">Danilo Tuler</a>
-
View
6 application.properties
@@ -1,7 +1 @@
-#Grails Metadata file
-#Mon Jan 21 11:35:17 BRST 2013
app.grails.version=2.1.3
-app.name=plastic-criteria
-plugins.hibernate=2.1.3
-plugins.rest-client-builder=1.0.2
-plugins.svn=1.0.1
View
53 grails-app/conf/BuildConfig.groovy
@@ -1,39 +1,28 @@
-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.target.level = 1.6
-//grails.project.war.file = "target/${appName}-${appVersion}.war"
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'
- repositories {
- grailsCentral()
- // uncomment the below to enable remote dependency resolution
- // from public Maven repositories
- mavenCentral()
- mavenLocal()
- //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.5'
- // build ":release:2.0.0"
+ inherits 'global'
+ log 'warn'
+
+ repositories {
+ grailsCentral()
+ mavenLocal()
+ mavenCentral()
+ }
+
+ dependencies {
compile 'javassist:javassist:3.12.1.GA'
- }
+ }
+
+ plugins {
+ build ':release:2.2.0', ':rest-client-builder:1.0.3', {
+ export = false
+ }
- plugins {
- build(":tomcat:$grailsVersion",
- ":release:2.0.0") {
- export = false
- }
- }
+ runtime ":hibernate:$grailsVersion", {
+ export = false
+ }
+ }
}
View
28 grails-app/conf/Config.groovy
@@ -1,26 +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'
}
-grails.views.default.codec="none" // none, html, base64
-grails.views.gsp.encoding="UTF-8"
View
49 grails-app/conf/DataSource.groovy
@@ -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 = true
- 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"
- }
- }
- test {
- dataSource {
- dbCreate = "update"
- url = "jdbc:h2:mem:testDb;MVCC=TRUE"
- }
- }
- production {
- dataSource {
- dbCreate = "update"
- url = "jdbc:h2:prodDb;MVCC=TRUE"
- 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'
}
View
13 grails-app/conf/UrlMappings.groovy
@@ -1,13 +0,0 @@
-class UrlMappings {
-
- static mappings = {
- "/$controller/$action?/$id?"{
- constraints {
- // apply constraints here
- }
- }
-
- "/"(view:"/index")
- "500"(view:'/error')
- }
-}
View
9 grails-app/domain/plastic/criteria/Artist.groovy
@@ -1,13 +1,12 @@
-package plastic.criteria;
+package plastic.criteria
-public class Artist {
+class Artist {
String name
-
+
String toString(){
name
}
-
+
static hasMany = [portraits: Portrait]
-
}
View
17 grails-app/domain/plastic/criteria/Portrait.groovy
@@ -1,25 +1,24 @@
-package plastic.criteria;
+package plastic.criteria
-public class Portrait {
+class Portrait {
static belongsTo = [artist: Artist]
-
+
String name
-
+
BigDecimal value
-
+
BigDecimal lastSoldPrice
-
+
String color
-
+
String toString(){
"${name} (id: ${id})"
}
-
+
static constraints = {
color nullable: true
value nullable: true
lastSoldPrice nullable: true
}
-
}
View
0  grails-app/i18n/messages.properties
No changes.
View
11 grails-app/views/error.gsp
@@ -1,11 +0,0 @@
-<!doctype html>
-<html>
- <head>
- <title>Grails Runtime Exception</title>
- <meta name="layout" content="main">
- <link rel="stylesheet" href="${resource(dir: 'css', file: 'errors.css')}" type="text/css">
- </head>
- <body>
- <g:renderException exception="${exception}" />
- </body>
-</html>
View
38 plugin.xml
@@ -1,38 +0,0 @@
-<plugin name='plastic-criteria' version='0.5' grailsVersion='2.2.0 &gt; *'>
- <author>Fabio Issamu Oshiro</author>
- <title>Plastic Criteria Plugin</title>
- <description>Mock Grails Criteria for Unit Tests
-</description>
- <documentation>http://grails.org/plugin/plastic-criteria</documentation>
- <type>PlasticCriteriaGrailsPlugin</type>
- <resources>
- <resource>plastic.criteria.Artist</resource>
- <resource>plastic.criteria.Portrait</resource>
- </resources>
- <repositories>
- <repository name='grailsCentral' url='http://grails.org/plugins' />
- <repository name='mavenCentral' url='http://repo1.maven.org/maven2/' />
- <repository name='http://download.java.net/maven/2/' url='http://download.java.net/maven/2/' />
- </repositories>
- <dependencies>
- <runtime>
- <dependency group='mysql' name='mysql-connector-java' version='5.1.21' />
- </runtime>
- </dependencies>
- <plugins>
- <compile>
- <plugin group='org.grails.plugins' name='mail' version='1.0.1' />
- <plugin group='org.grails.plugins' name='cache' version='1.0.1' />
- </compile>
- <runtime>
- <plugin group='org.grails.plugins' name='jquery' version='1.8.3' />
- <plugin group='org.grails.plugins' name='hibernate' version='2.2.0' />
- <plugin group='org.grails.plugins' name='resources' version='1.1.6' />
- </runtime>
- <build>
- <plugin group='org.grails.plugins' name='tomcat' version='2.2.0' />
- </build>
- </plugins>
- <runtimePluginRequirements />
- <behavior />
-</plugin>
View
10 scripts/_Install.groovy
@@ -1,10 +0,0 @@
-//
-// This script is executed by Grails after plugin was installed to project.
-// This script is a Gant script so you can use all special variables provided
-// by Gant (such as 'baseDir' which points on project base dir). You can
-// use 'ant' to access a global instance of AntBuilder
-//
-// For example you can create directory under project tree:
-//
-// ant.mkdir(dir:"${basedir}/grails-app/jobs")
-//
View
5 scripts/_Uninstall.groovy
@@ -1,5 +0,0 @@
-//
-// This script is executed by Grails when the plugin is uninstalled from project.
-// Use this script if you intend to do any additional clean-up on uninstall, but
-// beware of messing up SVN directories!
-//
View
10 scripts/_Upgrade.groovy
@@ -1,10 +0,0 @@
-//
-// This script is executed by Grails during application upgrade ('grails upgrade'
-// command). This script is a Gant script so you can use all special variables
-// provided by Gant (such as 'baseDir' which points on project base dir). You can
-// use 'ant' to access a global instance of AntBuilder
-//
-// For example you can create directory under project tree:
-//
-// ant.mkdir(dir:"${basedir}/grails-app/jobs")
-//
View
81 src/groovy/plastic/criteria/CriteriaDocTests.groovy
@@ -1,9 +1,10 @@
-package plastic.criteria;
+package plastic.criteria
+
+import static org.junit.Assert.*
-import static org.junit.Assert.*;
import org.hibernate.FetchMode
-public class CriteriaDocTests {
+class CriteriaDocTests {
void testGroupProperty() {
def pablo = new Artist(name: 'Pablo').save()
@@ -19,7 +20,7 @@ public class CriteriaDocTests {
}
assert [[32.00, pablo], [20.00, salvador]] == artistValue
}
-
+
void test2xGroupProperty(){
def pablo = new Artist(name: 'Pablo').save()
def salvador = new Artist(name: 'Salvador').save()
@@ -37,7 +38,7 @@ public class CriteriaDocTests {
}
assert [[10.00, pablo], [20.00, salvador]] == artistValue
}
-
+
void testAnd(){
def pablo = new Artist(name: 'Pablo').save()
new Portrait(artist: pablo, name: "Les Demoiselles d'Avignon", value: 10.00, color: 'orange').save()
@@ -49,11 +50,11 @@ public class CriteriaDocTests {
}
eq('color', 'blue')
}
-
+
assert 1 == portraits.size()
assert "Les Noces de Pierrette" == portraits[0].name
}
-
+
void testOr(){
def artitst = new Artist(name: 'Brilhante').save()
def plastic1 = new Portrait(artist: artitst, name: 'Soleil levant').save()
@@ -65,7 +66,7 @@ public class CriteriaDocTests {
eq('name', 'The Madonna of Port Lligat')
}
}
-
+
assert [plastic1, plastic2] == ls
}
@@ -81,7 +82,7 @@ public class CriteriaDocTests {
}
assert 2.0 == average
}
-
+
void testSum(){
def artitst = new Artist(name: 'Brilhante').save()
new Portrait(artist: artitst, name: 'Soleil levant', value: 1.0).save()
@@ -94,7 +95,7 @@ public class CriteriaDocTests {
}
assert 6.0 == total
}
-
+
void testMin(){
def artitst = new Artist(name: 'Brilhante').save()
new Portrait(artist: artitst, name: 'Soleil levant', value: 1.0).save()
@@ -107,7 +108,7 @@ public class CriteriaDocTests {
}
assert 1.0 == res
}
-
+
void testMax(){
def artitst = new Artist(name: 'Brilhante').save()
new Portrait(artist: artitst, name: 'Soleil levant', value: 1.0).save()
@@ -120,7 +121,7 @@ public class CriteriaDocTests {
}
assert 3.0 == res
}
-
+
void testIgnoreCase(){
def artitst = new Artist(name: 'Brilhante').save()
def a = new Portrait(artist: artitst, name: 'Soleil levant', value: 1.0).save()
@@ -129,10 +130,10 @@ public class CriteriaDocTests {
def results = Portrait.withCriteria{
eq('name', 'SOLEIL LEVANT', [ignoreCase: true])
}
-
+
assert [a, b] == results
}
-
+
void testLike(){
def artitst = new Artist(name: 'Brilhante').save()
def a = new Portrait(artist: artitst, name: 'Soleil levant', value: 1.0).save()
@@ -143,7 +144,7 @@ public class CriteriaDocTests {
}
assert [a, b] == results
}
-
+
void testNot(){
def artitst = new Artist(name: 'Brilhante').save()
def a = new Portrait(artist: artitst, name: 'Soleil levant', value: 1.0).save()
@@ -156,7 +157,7 @@ public class CriteriaDocTests {
}
assert [c] == results
}
-
+
void testMissingMethodException(){
try{
Portrait.withCriteria{
@@ -167,7 +168,7 @@ public class CriteriaDocTests {
assert e.message?.contains('.myMissingMethod()')
}
}
-
+
void testRowCount(){
def artitst = new Artist(name: 'Brilhante').save()
def a = new Portrait(artist: artitst, name: 'Soleil levant', value: 1.0).save()
@@ -180,7 +181,7 @@ public class CriteriaDocTests {
}
assert 3 == res[0]
}
-
+
// not working in H2
void xtestRowCountAndGroupProperty(){
def monet = new Artist(name: 'Monet').save()
@@ -210,7 +211,7 @@ public class CriteriaDocTests {
assert a == res[0]
assert c == res[1]
}
-
+
void testEqProperty(){
def artitst = new Artist(name: 'Brilhante').save()
def soleill = new Portrait(value: 20.0, lastSoldPrice: 10.0, name: 'Soleil levant',artist: artitst ).save()
@@ -287,41 +288,41 @@ public class CriteriaDocTests {
assert 1 == res.size()
assert soleill == res.first()
}
-
+
void testProjectionProperty(){
def monet = new Artist(name: 'Monet').save()
-
+
new Portrait(artist: monet, name: 'Soleil levant 1', value: 1.0).save()
new Portrait(artist: monet, name: 'Soleil levant 2', value: 1.0).save()
new Portrait(artist: monet, name: 'Soleil levant 3', value: 1.0).save()
-
+
def rs = Portrait.withCriteria {
projections {
property('artist')
}
}
-
+
assert 3 == rs.size()
rs.each{
assert it instanceof Artist
assert it.name == 'Monet'
}
}
-
+
void testProjectionProperties(){
def monet = new Artist(name: 'Monet').save()
-
+
new Portrait(artist: monet, name: 'Soleil levant 1', value: 1.0).save()
new Portrait(artist: monet, name: 'Soleil levant 2', value: 1.0).save()
new Portrait(artist: monet, name: 'Soleil levant 3', value: 1.0).save()
-
+
def rs = Portrait.withCriteria {
projections {
property('artist')
property('value')
}
}
-
+
assert 3 == rs.size()
rs.each{
assert it[0] instanceof Artist
@@ -329,25 +330,25 @@ public class CriteriaDocTests {
assert it[1] == 1.0
}
}
-
+
void testProjectionPropertyAndSum(){
def monet = new Artist(name: 'Monet').save()
-
+
new Portrait(artist: monet, name: 'Soleil levant 1', value: 1.0).save()
new Portrait(artist: monet, name: 'Soleil levant 2', value: 1.0).save()
new Portrait(artist: monet, name: 'Soleil levant 3', value: 1.0).save()
-
+
def rs = Portrait.withCriteria {
projections {
property('artist')
sum('value')
}
}
-
+
assert 1 == rs.size()
assert [[monet, 3.0]] == rs
}
-
+
void testOrderBy(){
def a = new Artist(name: 'Andreas Achenbach').save()
def c = new Artist(name: 'Constance Gordon-Cumming').save()
@@ -368,7 +369,7 @@ public class CriteriaDocTests {
}
assert ['Andreas Achenbach', 'Botero', 'Constance Gordon-Cumming'] == artistList
}
-
+
//next release 0.5
void testDistinctWithArrayParam(){
def b = new Artist(name: 'Tomie Oshiro').save()
@@ -390,36 +391,36 @@ public class CriteriaDocTests {
void test_sum_null(){
def monet = new Artist(name: 'Monet').save()
-
+
new Portrait(artist: monet, name: 'Soleil levant 1').save()
new Portrait(artist: monet, name: 'Soleil levant 2').save()
new Portrait(artist: monet, name: 'Soleil levant 3').save()
-
+
def rs = Portrait.withCriteria {
projections {
property('artist')
sum('value')
}
}
-
+
assert 1 == rs.size()
assert [[monet, null]] == rs
}
void test_sum_with_null(){
def monet = new Artist(name: 'Monet').save()
-
+
new Portrait(artist: monet, name: 'Soleil levant 1').save()
new Portrait(artist: monet, name: 'Soleil levant 2', value: 1.1).save()
new Portrait(artist: monet, name: 'Soleil levant 3').save()
-
+
def rs = Portrait.withCriteria {
projections {
property('artist')
sum('value')
}
}
-
+
assert 1 == rs.size()
assert [[monet, 1.1]] == rs
}
@@ -466,7 +467,7 @@ public class CriteriaDocTests {
eq('artist', monet)
uniqueResult = true
}
- assert res == null
+ assert res == null
}
void test_plastic_criteria_over_arrayList(){
View
80 src/groovy/plastic/criteria/PlasticCriteria.groovy
@@ -1,6 +1,6 @@
-package plastic.criteria;
+package plastic.criteria
-public class PlasticCriteria {
+class PlasticCriteria {
def _clazz
def _maxRes
def _props = []
@@ -10,7 +10,7 @@ public class PlasticCriteria {
def _distinctProp
def _leCriticalList = [tp: 'and', ls: []]
def _prefix = ''
-
+
def _instanceValue
def _criteriaValue
def _critOptions
@@ -36,25 +36,25 @@ public class PlasticCriteria {
"gtProperty":{ _instanceValue > _criteriaValue },
"ltProperty":{ _instanceValue < _criteriaValue }
]
-
- public PlasticCriteria(List list){
- this._clazz = [list: {list}]
+
+ PlasticCriteria(List list){
+ _clazz = [list: {list}]
}
- public PlasticCriteria(clazz){
- this._clazz = clazz
+ PlasticCriteria(clazz){
+ _clazz = clazz
}
-
- public PlasticCriteria(clazz, pref){
+
+ PlasticCriteria(clazz, pref){
_prefix = pref + '.'
}
-
+
static void mockCriteria(List clazzes){
clazzes.each{
mockCriteria(it)
- }
+ }
}
-
+
static void mockCriteria(Class clazz){
clazz.metaClass.'static'.withCriteria = { Closure cls ->
new PlasticCriteria(clazz).list(cls)
@@ -68,83 +68,83 @@ public class PlasticCriteria {
ge(prop, firstValue)
le(prop, secondValue)
}
-
+
def listDistinct(cls){
-
+
}
-
+
def maxResults(limit){
_maxRes = limit
}
-
+
def distinct(prop){
_distinctProp = prop
}
-
+
def property(prop){
_props.add(prop)
}
-
+
def min(prop){
_hasCalcProp = true
_props.add("min $prop")
}
-
+
def max(prop){
_hasCalcProp = true
_props.add("max $prop")
}
-
+
def sum(prop){
_hasCalcProp = true
_props.add("sum $prop")
}
-
+
def avg(prop){
_hasCalcProp = true
_props.add("avg $prop")
}
-
+
def groupProperty(prop){
_groupProps.add(prop)
_props.add(prop)
}
-
+
def rowCount(){
_hasCalcProp = true
_props.add("rowCount ")
}
-
+
def projections(clos){
clos.delegate = this
clos()
}
-
+
def order(prop, order){
_orders.add("${prop} ${order}")
}
-
+
def methodMissing(String name, args){
if(theImplementations.containsKey(name)){
_leCriticalList.ls.add([criteriaName: name, prop: _prefix + args[0], val: ((args.length > 1) ? args[1] : 'null'), opt: ((args.length > 2) ? args[2] : [:])])
}else{
if(!args || !(args[0] instanceof Closure)) throw new MissingMethodException(name, this.class, args)
- def fc = new PlasticCriteria(this._clazz, name)
+ def fc = new PlasticCriteria(_clazz, name)
args[0].resolveStrategy = Closure.DELEGATE_FIRST
args[0].delegate = fc
args[0]()
fc._leCriticalList.ls.each{ v ->
- this._leCriticalList.ls.add(v)
+ _leCriticalList.ls.add(v)
}
fc._orders.each{
- this._orders.add((name + '.' + it))
+ _orders.add((name + '.' + it))
}
if(fc._distinctProp){
- this._distinctProp = name + '.' + fc._distinctProp
+ _distinctProp = name + '.' + fc._distinctProp
}
}
}
-
+
def theAndOrNotPush(tp, clos){
def thePersistenceOfMemory = _leCriticalList
_leCriticalList = [tp: tp, ls: []]
@@ -153,19 +153,19 @@ public class PlasticCriteria {
clos()
_leCriticalList = thePersistenceOfMemory
}
-
+
def and(clos){
theAndOrNotPush('and', clos)
}
-
+
def or(clos){
theAndOrNotPush('or', clos)
}
-
+
def not(clos){
theAndOrNotPush('not', clos)
}
-
+
def list(clos){
clos.delegate = this
clos()
@@ -239,7 +239,7 @@ public class PlasticCriteria {
return ls
}
}
-
+
def _runCriteria(cri, obj){
if(cri.criteriaName.endsWith('Property')){
_criteriaValue = obj."${cri.val}"
@@ -250,7 +250,7 @@ public class PlasticCriteria {
_critOptions = cri.opt
return theImplementations[cri.criteriaName]()
}
-
+
def knokinOnHeavensDoor(criList, obj){
def gotoParadise
if(criList.tp == 'and'){
@@ -282,7 +282,7 @@ public class PlasticCriteria {
}
return res
}
-
+
def _filteredList(){
def r = []
_clazz.list().each{ obj ->
@@ -308,7 +308,7 @@ public class PlasticCriteria {
}
return r
}
-
+
def get(clos){
def ls = list(clos)
return ls ? ls.first() : null
View
15 test/integration/plastic/criteria/PlasticCriteriaIntegrationTests.groovy
@@ -1,15 +0,0 @@
-package plastic.criteria;
-
-import static org.junit.Assert.*;
-
-import org.junit.Before;
-import org.junit.Test;
-
-public class PlasticCriteriaIntegrationTests extends CriteriaDocTests{
-
- @Before
- void setUp(){
-
- }
-
-}
View
12 test/unit/plastic/criteria/PlasticCriteriaTests.groovy
@@ -1,18 +1,14 @@
-package plastic.criteria;
+package plastic.criteria
-import static org.junit.Assert.*;
-import static plastic.criteria.PlasticCriteria.*;
-import grails.test.mixin.Mock;
+import static plastic.criteria.PlasticCriteria.*
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.Before
@Mock([Artist, Portrait])
-public class PlasticCriteriaTests extends CriteriaDocTests{
+class PlasticCriteriaTests extends CriteriaDocTests{
@Before
void setUp(){
mockCriteria([Artist, Portrait])
}
-
}
View
33 web-app/WEB-INF/applicationContext.xml
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="
-http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
-
- <bean id="grailsApplication" class="org.codehaus.groovy.grails.commons.GrailsApplicationFactoryBean">
- <description>Grails application factory bean</description>
- <property name="grailsDescriptor" value="/WEB-INF/grails.xml" />
- <property name="grailsResourceLoader" ref="grailsResourceLoader" />
- </bean>
-
- <bean id="pluginManager" class="org.codehaus.groovy.grails.plugins.GrailsPluginManagerFactoryBean">
- <description>A bean that manages Grails plugins</description>
- <property name="grailsDescriptor" value="/WEB-INF/grails.xml" />
- <property name="application" ref="grailsApplication" />
- </bean>
-
- <bean id="grailsConfigurator" class="org.codehaus.groovy.grails.commons.spring.GrailsRuntimeConfigurator">
- <constructor-arg>
- <ref bean="grailsApplication" />
- </constructor-arg>
- <property name="pluginManager" ref="pluginManager" />
- </bean>
-
- <bean id="grailsResourceLoader" class="org.codehaus.groovy.grails.commons.GrailsResourceLoaderFactoryBean" />
-
- <bean id="characterEncodingFilter" class="org.springframework.web.filter.CharacterEncodingFilter">
- <property name="encoding">
- <value>utf-8</value>
- </property>
- </bean>
-</beans>
View
14 web-app/WEB-INF/sitemesh.xml
@@ -1,14 +0,0 @@
-<sitemesh>
- <page-parsers>
- <parser content-type="text/html"
- class="org.codehaus.groovy.grails.web.sitemesh.GrailsHTMLPageParser" />
- <parser content-type="text/html;charset=ISO-8859-1"
- class="org.codehaus.groovy.grails.web.sitemesh.GrailsHTMLPageParser" />
- <parser content-type="text/html;charset=UTF-8"
- class="org.codehaus.groovy.grails.web.sitemesh.GrailsHTMLPageParser" />
- </page-parsers>
-
- <decorator-mappers>
- <mapper class="org.codehaus.groovy.grails.web.sitemesh.GrailsLayoutDecoratorMapper" />
- </decorator-mappers>
-</sitemesh>
View
572 web-app/WEB-INF/tld/c.tld
@@ -1,572 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-
-<taglib xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd"
- version="2.1">
-
- <description>JSTL 1.2 core library</description>
- <display-name>JSTL core</display-name>
- <tlib-version>1.2</tlib-version>
- <short-name>c</short-name>
- <uri>http://java.sun.com/jsp/jstl/core</uri>
-
- <validator>
- <description>
- Provides core validation features for JSTL tags.
- </description>
- <validator-class>
- org.apache.taglibs.standard.tlv.JstlCoreTLV
- </validator-class>
- </validator>
-
- <tag>
- <description>
- Catches any Throwable that occurs in its body and optionally
- exposes it.
- </description>
- <name>catch</name>
- <tag-class>org.apache.taglibs.standard.tag.common.core.CatchTag</tag-class>
- <body-content>JSP</body-content>
- <attribute>
- <description>
-Name of the exported scoped variable for the
-exception thrown from a nested action. The type of the
-scoped variable is the type of the exception thrown.
- </description>
- <name>var</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
- <description>
- Simple conditional tag that establishes a context for
- mutually exclusive conditional operations, marked by
- &lt;when&gt; and &lt;otherwise&gt;
- </description>
- <name>choose</name>
- <tag-class>org.apache.taglibs.standard.tag.common.core.ChooseTag</tag-class>
- <body-content>JSP</body-content>
- </tag>
-
- <tag>
- <description>
- Simple conditional tag, which evalutes its body if the
- supplied condition is true and optionally exposes a Boolean
- scripting variable representing the evaluation of this condition
- </description>
- <name>if</name>
- <tag-class>org.apache.taglibs.standard.tag.rt.core.IfTag</tag-class>
- <body-content>JSP</body-content>
- <attribute>
- <description>
-The test condition that determines whether or
-not the body content should be processed.
- </description>
- <name>test</name>
- <required>true</required>
- <rtexprvalue>true</rtexprvalue>
- <type>boolean</type>
- </attribute>
- <attribute>
- <description>
-Name of the exported scoped variable for the
-resulting value of the test condition. The type
-of the scoped variable is Boolean.
- </description>
- <name>var</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Scope for var.
- </description>
- <name>scope</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
- <description>
- Retrieves an absolute or relative URL and exposes its contents
- to either the page, a String in 'var', or a Reader in 'varReader'.
- </description>
- <name>import</name>
- <tag-class>org.apache.taglibs.standard.tag.rt.core.ImportTag</tag-class>
- <tei-class>org.apache.taglibs.standard.tei.ImportTEI</tei-class>
- <body-content>JSP</body-content>
- <attribute>
- <description>
-The URL of the resource to import.
- </description>
- <name>url</name>
- <required>true</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Name of the exported scoped variable for the
-resource's content. The type of the scoped
-variable is String.
- </description>
- <name>var</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Scope for var.
- </description>
- <name>scope</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Name of the exported scoped variable for the
-resource's content. The type of the scoped
-variable is Reader.
- </description>
- <name>varReader</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Name of the context when accessing a relative
-URL resource that belongs to a foreign
-context.
- </description>
- <name>context</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Character encoding of the content at the input
-resource.
- </description>
- <name>charEncoding</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
- <description>
- The basic iteration tag, accepting many different
- collection types and supporting subsetting and other
- functionality
- </description>
- <name>forEach</name>
- <tag-class>org.apache.taglibs.standard.tag.rt.core.ForEachTag</tag-class>
- <tei-class>org.apache.taglibs.standard.tei.ForEachTEI</tei-class>
- <body-content>JSP</body-content>
- <attribute>
- <description>
-Collection of items to iterate over.
- </description>
- <name>items</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- <type>java.lang.Object</type>
- <deferred-value>
- <type>java.lang.Object</type>
- </deferred-value>
- </attribute>
- <attribute>
- <description>
-If items specified:
-Iteration begins at the item located at the
-specified index. First item of the collection has
-index 0.
-If items not specified:
-Iteration begins with index set at the value
-specified.
- </description>
- <name>begin</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- <type>int</type>
- </attribute>
- <attribute>
- <description>
-If items specified:
-Iteration ends at the item located at the
-specified index (inclusive).
-If items not specified:
-Iteration ends when index reaches the value
-specified.
- </description>
- <name>end</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- <type>int</type>
- </attribute>
- <attribute>
- <description>
-Iteration will only process every step items of
-the collection, starting with the first one.
- </description>
- <name>step</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- <type>int</type>
- </attribute>
- <attribute>
- <description>
-Name of the exported scoped variable for the
-current item of the iteration. This scoped
-variable has nested visibility. Its type depends
-on the object of the underlying collection.
- </description>
- <name>var</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Name of the exported scoped variable for the
-status of the iteration. Object exported is of type
-javax.servlet.jsp.jstl.core.LoopTagStatus. This scoped variable has nested
-visibility.
- </description>
- <name>varStatus</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
- <description>
- Iterates over tokens, separated by the supplied delimeters
- </description>
- <name>forTokens</name>
- <tag-class>org.apache.taglibs.standard.tag.rt.core.ForTokensTag</tag-class>
- <body-content>JSP</body-content>
- <attribute>
- <description>
-String of tokens to iterate over.
- </description>
- <name>items</name>
- <required>true</required>
- <rtexprvalue>true</rtexprvalue>
- <type>java.lang.String</type>
- <deferred-value>
- <type>java.lang.String</type>
- </deferred-value>
- </attribute>
- <attribute>
- <description>
-The set of delimiters (the characters that
-separate the tokens in the string).
- </description>
- <name>delims</name>
- <required>true</required>
- <rtexprvalue>true</rtexprvalue>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <description>
-Iteration begins at the token located at the
-specified index. First token has index 0.
- </description>
- <name>begin</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- <type>int</type>
- </attribute>
- <attribute>
- <description>
-Iteration ends at the token located at the
-specified index (inclusive).
- </description>
- <name>end</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- <type>int</type>
- </attribute>
- <attribute>
- <description>
-Iteration will only process every step tokens
-of the string, starting with the first one.
- </description>
- <name>step</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- <type>int</type>
- </attribute>
- <attribute>
- <description>
-Name of the exported scoped variable for the
-current item of the iteration. This scoped
-variable has nested visibility.
- </description>
- <name>var</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Name of the exported scoped variable for the
-status of the iteration. Object exported is of
-type
-javax.servlet.jsp.jstl.core.LoopTag
-Status. This scoped variable has nested
-visibility.
- </description>
- <name>varStatus</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
- <description>
- Like &lt;%= ... &gt;, but for expressions.
- </description>
- <name>out</name>
- <tag-class>org.apache.taglibs.standard.tag.rt.core.OutTag</tag-class>
- <body-content>JSP</body-content>
- <attribute>
- <description>
-Expression to be evaluated.
- </description>
- <name>value</name>
- <required>true</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Default value if the resulting value is null.
- </description>
- <name>default</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Determines whether characters &lt;,&gt;,&amp;,'," in the
-resulting string should be converted to their
-corresponding character entity codes. Default value is
-true.
- </description>
- <name>escapeXml</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- </tag>
-
-
- <tag>
- <description>
- Subtag of &lt;choose&gt; that follows &lt;when&gt; tags
- and runs only if all of the prior conditions evaluated to
- 'false'
- </description>
- <name>otherwise</name>
- <tag-class>org.apache.taglibs.standard.tag.common.core.OtherwiseTag</tag-class>
- <body-content>JSP</body-content>
- </tag>
-
- <tag>
- <description>
- Adds a parameter to a containing 'import' tag's URL.
- </description>
- <name>param</name>
- <tag-class>org.apache.taglibs.standard.tag.rt.core.ParamTag</tag-class>
- <body-content>JSP</body-content>
- <attribute>
- <description>
-Name of the query string parameter.
- </description>
- <name>name</name>
- <required>true</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Value of the parameter.
- </description>
- <name>value</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
- <description>
- Redirects to a new URL.
- </description>
- <name>redirect</name>
- <tag-class>org.apache.taglibs.standard.tag.rt.core.RedirectTag</tag-class>
- <body-content>JSP</body-content>
- <attribute>
- <description>
-The URL of the resource to redirect to.
- </description>
- <name>url</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Name of the context when redirecting to a relative URL
-resource that belongs to a foreign context.
- </description>
- <name>context</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
- <description>
- Removes a scoped variable (from a particular scope, if specified).
- </description>
- <name>remove</name>
- <tag-class>org.apache.taglibs.standard.tag.common.core.RemoveTag</tag-class>
- <body-content>empty</body-content>
- <attribute>
- <description>
-Name of the scoped variable to be removed.
- </description>
- <name>var</name>
- <required>true</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Scope for var.
- </description>
- <name>scope</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
- <description>
- Sets the result of an expression evaluation in a 'scope'
- </description>
- <name>set</name>
- <tag-class>org.apache.taglibs.standard.tag.rt.core.SetTag</tag-class>
- <body-content>JSP</body-content>
- <attribute>
- <description>
-Name of the exported scoped variable to hold the value
-specified in the action. The type of the scoped variable is
-whatever type the value expression evaluates to.
- </description>
- <name>var</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Expression to be evaluated.
- </description>
- <name>value</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- <deferred-value>
- <type>java.lang.Object</type>
- </deferred-value>
- </attribute>
- <attribute>
- <description>
-Target object whose property will be set. Must evaluate to
-a JavaBeans object with setter property property, or to a
-java.util.Map object.
- </description>
- <name>target</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Name of the property to be set in the target object.
- </description>
- <name>property</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Scope for var.
- </description>
- <name>scope</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
- <description>
- Creates a URL with optional query parameters.
- </description>
- <name>url</name>
- <tag-class>org.apache.taglibs.standard.tag.rt.core.UrlTag</tag-class>
- <body-content>JSP</body-content>
- <attribute>
- <description>
-Name of the exported scoped variable for the
-processed url. The type of the scoped variable is
-String.
- </description>
- <name>var</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Scope for var.
- </description>
- <name>scope</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-URL to be processed.
- </description>
- <name>value</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Name of the context when specifying a relative URL
-resource that belongs to a foreign context.
- </description>
- <name>context</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
- <description>
- Subtag of &lt;choose&gt; that includes its body if its
- condition evalutes to 'true'
- </description>
- <name>when</name>
- <tag-class>org.apache.taglibs.standard.tag.rt.core.WhenTag</tag-class>
- <body-content>JSP</body-content>
- <attribute>
- <description>
-The test condition that determines whether or not the
-body content should be processed.
- </description>
- <name>test</name>
- <required>true</required>
- <rtexprvalue>true</rtexprvalue>
- <type>boolean</type>
- </attribute>
- </tag>
-
-</taglib>
View
671 web-app/WEB-INF/tld/fmt.tld
@@ -1,671 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-
-<taglib xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd"
- version="2.1">
-
- <description>JSTL 1.2 i18n-capable formatting library</description>
- <display-name>JSTL fmt</display-name>
- <tlib-version>1.2</tlib-version>
- <short-name>fmt</short-name>
- <uri>http://java.sun.com/jsp/jstl/fmt</uri>
-
- <validator>
- <description>
- Provides core validation features for JSTL tags.
- </description>
- <validator-class>
- org.apache.taglibs.standard.tlv.JstlFmtTLV
- </validator-class>
- </validator>
-
- <tag>
- <description>
- Sets the request character encoding
- </description>
- <name>requestEncoding</name>
- <tag-class>org.apache.taglibs.standard.tag.rt.fmt.RequestEncodingTag</tag-class>
- <body-content>empty</body-content>
- <attribute>
- <description>
-Name of character encoding to be applied when
-decoding request parameters.
- </description>
- <name>value</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
- <description>
- Stores the given locale in the locale configuration variable
- </description>
- <name>setLocale</name>
- <tag-class>org.apache.taglibs.standard.tag.rt.fmt.SetLocaleTag</tag-class>
- <body-content>empty</body-content>
- <attribute>
- <description>
-A String value is interpreted as the
-printable representation of a locale, which
-must contain a two-letter (lower-case)
-language code (as defined by ISO-639),
-and may contain a two-letter (upper-case)
-country code (as defined by ISO-3166).
-Language and country codes must be
-separated by hyphen (-) or underscore
-(_).
- </description>
- <name>value</name>
- <required>true</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Vendor- or browser-specific variant.
-See the java.util.Locale javadocs for
-more information on variants.
- </description>
- <name>variant</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Scope of the locale configuration variable.
- </description>
- <name>scope</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
- <description>
- Specifies the time zone for any time formatting or parsing actions
- nested in its body
- </description>
- <name>timeZone</name>
- <tag-class>org.apache.taglibs.standard.tag.rt.fmt.TimeZoneTag</tag-class>
- <body-content>JSP</body-content>
- <attribute>
- <description>
-The time zone. A String value is interpreted as
-a time zone ID. This may be one of the time zone
-IDs supported by the Java platform (such as
-"America/Los_Angeles") or a custom time zone
-ID (such as "GMT-8"). See
-java.util.TimeZone for more information on
-supported time zone formats.
- </description>
- <name>value</name>
- <required>true</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
- <description>
- Stores the given time zone in the time zone configuration variable
- </description>
- <name>setTimeZone</name>
- <tag-class>org.apache.taglibs.standard.tag.rt.fmt.SetTimeZoneTag</tag-class>
- <body-content>empty</body-content>
- <attribute>
- <description>
-The time zone. A String value is interpreted as
-a time zone ID. This may be one of the time zone
-IDs supported by the Java platform (such as
-"America/Los_Angeles") or a custom time zone
-ID (such as "GMT-8"). See java.util.TimeZone for
-more information on supported time zone
-formats.
- </description>
- <name>value</name>
- <required>true</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Name of the exported scoped variable which
-stores the time zone of type
-java.util.TimeZone.
- </description>
- <name>var</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Scope of var or the time zone configuration
-variable.
- </description>
- <name>scope</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
- <description>
- Loads a resource bundle to be used by its tag body
- </description>
- <name>bundle</name>
- <tag-class>org.apache.taglibs.standard.tag.rt.fmt.BundleTag</tag-class>
- <body-content>JSP</body-content>
- <attribute>
- <description>
-Resource bundle base name. This is the bundle's
-fully-qualified resource name, which has the same
-form as a fully-qualified class name, that is, it uses
-"." as the package component separator and does not
-have any file type (such as ".class" or ".properties")
-suffix.
- </description>
- <name>basename</name>
- <required>true</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Prefix to be prepended to the value of the message
-key of any nested &lt;fmt:message&gt; action.
- </description>
- <name>prefix</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
- <description>
- Loads a resource bundle and stores it in the named scoped variable or
- the bundle configuration variable
- </description>
- <name>setBundle</name>
- <tag-class>org.apache.taglibs.standard.tag.rt.fmt.SetBundleTag</tag-class>
- <body-content>empty</body-content>
- <attribute>
- <description>
-Resource bundle base name. This is the bundle's
-fully-qualified resource name, which has the same
-form as a fully-qualified class name, that is, it uses
-"." as the package component separator and does not
-have any file type (such as ".class" or ".properties")
-suffix.
- </description>
- <name>basename</name>
- <required>true</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Name of the exported scoped variable which stores
-the i18n localization context of type
-javax.servlet.jsp.jstl.fmt.LocalizationC
-ontext.
- </description>
- <name>var</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Scope of var or the localization context
-configuration variable.
- </description>
- <name>scope</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
- <description>
- Maps key to localized message and performs parametric replacement
- </description>
- <name>message</name>
- <tag-class>org.apache.taglibs.standard.tag.rt.fmt.MessageTag</tag-class>
- <body-content>JSP</body-content>
- <attribute>
- <description>
-Message key to be looked up.
- </description>
- <name>key</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Localization context in whose resource
-bundle the message key is looked up.
- </description>
- <name>bundle</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Name of the exported scoped variable
-which stores the localized message.
- </description>
- <name>var</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Scope of var.
- </description>
- <name>scope</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
- <description>
- Supplies an argument for parametric replacement to a containing
- &lt;message&gt; tag
- </description>
- <name>param</name>
- <tag-class>org.apache.taglibs.standard.tag.rt.fmt.ParamTag</tag-class>
- <body-content>JSP</body-content>
- <attribute>
- <description>
-Argument used for parametric replacement.
- </description>
- <name>value</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
- <description>
- Formats a numeric value as a number, currency, or percentage
- </description>
- <name>formatNumber</name>
- <tag-class>org.apache.taglibs.standard.tag.rt.fmt.FormatNumberTag</tag-class>
- <body-content>JSP</body-content>
- <attribute>
- <description>
-Numeric value to be formatted.
- </description>
- <name>value</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Specifies whether the value is to be
-formatted as number, currency, or
-percentage.
- </description>
- <name>type</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Custom formatting pattern.
- </description>
- <name>pattern</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-ISO 4217 currency code. Applied only
-when formatting currencies (i.e. if type is
-equal to "currency"); ignored otherwise.
- </description>
- <name>currencyCode</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Currency symbol. Applied only when
-formatting currencies (i.e. if type is equal
-to "currency"); ignored otherwise.
- </description>
- <name>currencySymbol</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Specifies whether the formatted output
-will contain any grouping separators.
- </description>
- <name>groupingUsed</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Maximum number of digits in the integer
-portion of the formatted output.
- </description>
- <name>maxIntegerDigits</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Minimum number of digits in the integer
-portion of the formatted output.
- </description>
- <name>minIntegerDigits</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Maximum number of digits in the
-fractional portion of the formatted output.
- </description>
- <name>maxFractionDigits</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Minimum number of digits in the
-fractional portion of the formatted output.
- </description>
- <name>minFractionDigits</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Name of the exported scoped variable
-which stores the formatted result as a
-String.
- </description>
- <name>var</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Scope of var.
- </description>
- <name>scope</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
- <description>
- Parses the string representation of a number, currency, or percentage
- </description>
- <name>parseNumber</name>
- <tag-class>org.apache.taglibs.standard.tag.rt.fmt.ParseNumberTag</tag-class>
- <body-content>JSP</body-content>
- <attribute>
- <description>
-String to be parsed.
- </description>
- <name>value</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Specifies whether the string in the value
-attribute should be parsed as a number,
-currency, or percentage.
- </description>
- <name>type</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Custom formatting pattern that determines
-how the string in the value attribute is to be
-parsed.
- </description>
- <name>pattern</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Locale whose default formatting pattern (for
-numbers, currencies, or percentages,
-respectively) is to be used during the parse
-operation, or to which the pattern specified
-via the pattern attribute (if present) is
-applied.
- </description>
- <name>parseLocale</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Specifies whether just the integer portion of
-the given value should be parsed.
- </description>
- <name>integerOnly</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Name of the exported scoped variable which
-stores the parsed result (of type
-java.lang.Number).
- </description>
- <name>var</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Scope of var.
- </description>
- <name>scope</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
- <description>
- Formats a date and/or time using the supplied styles and pattern
- </description>
- <name>formatDate</name>
- <tag-class>org.apache.taglibs.standard.tag.rt.fmt.FormatDateTag</tag-class>
- <body-content>empty</body-content>
- <attribute>
- <description>
-Date and/or time to be formatted.
- </description>
- <name>value</name>
- <required>true</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Specifies whether the time, the date, or both
-the time and date components of the given
-date are to be formatted.
- </description>
- <name>type</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Predefined formatting style for dates. Follows
-the semantics defined in class
-java.text.DateFormat. Applied only
-when formatting a date or both a date and
-time (i.e. if type is missing or is equal to
-"date" or "both"); ignored otherwise.
- </description>
- <name>dateStyle</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Predefined formatting style for times. Follows
-the semantics defined in class
-java.text.DateFormat. Applied only
-when formatting a time or both a date and
-time (i.e. if type is equal to "time" or "both");
-ignored otherwise.
- </description>
- <name>timeStyle</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Custom formatting style for dates and times.
- </description>
- <name>pattern</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Time zone in which to represent the formatted
-time.
- </description>
- <name>timeZone</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Name of the exported scoped variable which
-stores the formatted result as a String.
- </description>
- <name>var</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Scope of var.
- </description>
- <name>scope</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- </tag>
-
- <tag>
- <description>
- Parses the string representation of a date and/or time
- </description>
- <name>parseDate</name>
- <tag-class>org.apache.taglibs.standard.tag.rt.fmt.ParseDateTag</tag-class>
- <body-content>JSP</body-content>
- <attribute>
- <description>
-Date string to be parsed.
- </description>
- <name>value</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Specifies whether the date string in the
-value attribute is supposed to contain a
-time, a date, or both.
- </description>
- <name>type</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Predefined formatting style for days
-which determines how the date
-component of the date string is to be
-parsed. Applied only when formatting a
-date or both a date and time (i.e. if type
-is missing or is equal to "date" or "both");
-ignored otherwise.
- </description>
- <name>dateStyle</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Predefined formatting styles for times
-which determines how the time
-component in the date string is to be
-parsed. Applied only when formatting a
-time or both a date and time (i.e. if type
-is equal to "time" or "both"); ignored
-otherwise.
- </description>
- <name>timeStyle</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Custom formatting pattern which
-determines how the date string is to be
-parsed.
- </description>
- <name>pattern</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Time zone in which to interpret any time
-information in the date string.
- </description>
- <name>timeZone</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Locale whose predefined formatting styles
-for dates and times are to be used during
-the parse operation, or to which the
-pattern specified via the pattern
-attribute (if present) is applied.
- </description>
- <name>parseLocale</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Name of the exported scoped variable in
-which the parsing result (of type
-java.util.Date) is stored.
- </description>
- <name>var</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- <attribute>
- <description>
-Scope of var.
- </description>
- <name>scope</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- </attribute>
- </tag>
-
-</taglib>
View
550 web-app/WEB-INF/tld/grails.tld
@@ -1,550 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
- http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
- version="2.0">
- <description>The Grails custom tag library</description>
- <tlib-version>0.2</tlib-version>
- <short-name>grails</short-name>
- <uri>http://grails.codehaus.org/tags</uri>
-
- <tag>
- <name>link</name>
- <tag-class>org.codehaus.groovy.grails.web.taglib.jsp.JspLinkTag</tag-class>
- <body-content>JSP</body-content>
- <attribute>
- <name>action</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>