Permalink
Browse files

added the grails project files initial codebase

  • Loading branch information...
1 parent 526b314 commit 83a1a06d9cb15da17c0baabce024b9c59fbdcb9e @jettro committed Nov 6, 2009
Showing with 15,163 additions and 0 deletions.
  1. +8 −0 application.properties
  2. +76 −0 grails-app/conf/BootStrap.groovy
  3. +73 −0 grails-app/conf/Config.groovy
  4. +32 −0 grails-app/conf/DataSource.groovy
  5. +11 −0 grails-app/conf/UrlMappings.groovy
  6. +4 −0 grails-app/conf/spring/resources.groovy
  7. +4 −0 grails-app/controllers/CommentController.groovy
  8. +3 −0 grails-app/controllers/EnvironmentController.groovy
  9. +3 −0 grails-app/controllers/NetworkDefinitionController.groovy
  10. +22 −0 grails-app/controllers/OverviewController.groovy
  11. +3 −0 grails-app/controllers/ServerController.groovy
  12. +3 −0 grails-app/controllers/StatusController.groovy
  13. +3 −0 grails-app/controllers/VlanController.groovy
  14. +15 −0 grails-app/domain/Comment.groovy
  15. +15 −0 grails-app/domain/Environment.groovy
  16. +14 −0 grails-app/domain/NetworkDefinition.groovy
  17. +23 −0 grails-app/domain/Server.groovy
  18. +13 −0 grails-app/domain/Status.groovy
  19. +15 −0 grails-app/domain/Vlan.groovy
  20. +34 −0 grails-app/i18n/messages.properties
  21. +30 −0 grails-app/i18n/messages_de.properties
  22. +30 −0 grails-app/i18n/messages_es.properties
  23. +19 −0 grails-app/i18n/messages_fr.properties
  24. +19 −0 grails-app/i18n/messages_it.properties
  25. +19 −0 grails-app/i18n/messages_ja.properties
  26. +34 −0 grails-app/i18n/messages_nl.properties
  27. +34 −0 grails-app/i18n/messages_pt_BR.properties
  28. +31 −0 grails-app/i18n/messages_ru.properties
  29. +35 −0 grails-app/i18n/messages_th.properties
  30. +18 −0 grails-app/i18n/messages_zh_CN.properties
  31. +54 −0 grails-app/views/error.gsp
  32. +20 −0 grails-app/views/index.gsp
  33. +17 −0 grails-app/views/layouts/main.gsp
  34. +24 −0 grails-app/views/overview/comments.gsp
  35. +46 −0 grails-app/views/overview/index.gsp
  36. +17 −0 grails-app/views/shared/_comment.gsp
  37. +30 −0 test/reports/TEST-ServerControllerTests.xml
  38. +37 −0 test/reports/TESTS-TestSuites.xml
  39. +2 −0 test/reports/html/0_ServerControllerTests-err.txt
  40. +85 −0 test/reports/html/0_ServerControllerTests-errors.html
  41. +2 −0 test/reports/html/0_ServerControllerTests-out.txt
  42. +85 −0 test/reports/html/0_ServerControllerTests.html
  43. +27 −0 test/reports/html/all-tests.html
  44. +15 −0 test/reports/html/allclasses-frame.html
  45. +27 −0 test/reports/html/alltests-errors.html
  46. +22 −0 test/reports/html/alltests-fails.html
  47. +19 −0 test/reports/html/index.html
  48. +18 −0 test/reports/html/overview-frame.html
  49. +41 −0 test/reports/html/overview-summary.html
  50. +24 −0 test/reports/html/package-frame.html
  51. +27 −0 test/reports/html/package-summary.html
  52. +48 −0 test/reports/html/stylesheet.css
  53. +1 −0 test/reports/plain/TEST-ServerControllerTests-err.txt
  54. +1 −0 test/reports/plain/TEST-ServerControllerTests-out.txt
  55. +32 −0 test/reports/plain/TEST-ServerControllerTests.txt
  56. +15 −0 test/unit/CommentControllerTests.groovy
  57. +15 −0 test/unit/CommentTests.groovy
  58. +15 −0 test/unit/EnvironmentControllerTests.groovy
  59. +15 −0 test/unit/EnvironmentTests.groovy
  60. +15 −0 test/unit/NetworkDefinitionControllerTests.groovy
  61. +15 −0 test/unit/NetworkDefinitionTests.groovy
  62. +15 −0 test/unit/OverviewControllerTests.groovy
  63. +17 −0 test/unit/ServerControllerTests.groovy
  64. +14 −0 test/unit/ServerTests.groovy
  65. +15 −0 test/unit/StatusControllerTests.groovy
  66. +15 −0 test/unit/StatusTests.groovy
  67. +15 −0 test/unit/VlanControllerTests.groovy
  68. +15 −0 test/unit/VlanTests.groovy
  69. +47 −0 web-app/WEB-INF/applicationContext.xml
  70. +14 −0 web-app/WEB-INF/sitemesh.xml
  71. +563 −0 web-app/WEB-INF/tld/c.tld
  72. +671 −0 web-app/WEB-INF/tld/fmt.tld
  73. +551 −0 web-app/WEB-INF/tld/grails.tld
  74. +311 −0 web-app/WEB-INF/tld/spring.tld
  75. +336 −0 web-app/css/main.css
  76. BIN web-app/images/favicon.ico
  77. BIN web-app/images/grails_logo.jpg
  78. BIN web-app/images/skin/database_add.png
  79. BIN web-app/images/skin/database_delete.png
  80. BIN web-app/images/skin/database_edit.png
  81. BIN web-app/images/skin/database_save.png
  82. BIN web-app/images/skin/database_table.png
  83. BIN web-app/images/skin/exclamation.png
  84. BIN web-app/images/skin/house.png
  85. BIN web-app/images/skin/information.png
  86. BIN web-app/images/skin/shadow.jpg
  87. BIN web-app/images/skin/sorted_asc.gif
  88. BIN web-app/images/skin/sorted_desc.gif
  89. BIN web-app/images/spinner.gif
  90. +13 −0 web-app/js/application.js
  91. +7 −0 web-app/js/prototype/animation.js
  92. +136 −0 web-app/js/prototype/builder.js
  93. +965 −0 web-app/js/prototype/controls.js
  94. +974 −0 web-app/js/prototype/dragdrop.js
  95. +1,122 −0 web-app/js/prototype/effects.js
  96. +4,184 −0 web-app/js/prototype/prototype.js
  97. +2,691 −0 web-app/js/prototype/rico.js
  98. +58 −0 web-app/js/prototype/scriptaculous.js
  99. +275 −0 web-app/js/prototype/slider.js
  100. +55 −0 web-app/js/prototype/sound.js
  101. +568 −0 web-app/js/prototype/unittest.js
  102. +62 −0 web-app/plugins/db-util-0.4/css/dbUtil.css
View
@@ -0,0 +1,8 @@
+#utf-8
+#Wed Nov 04 11:28:17 CET 2009
+app.version=0.1
+app.servlet.version=2.4
+app.grails.version=1.1.1
+plugins.db-util=0.4
+plugins.hibernate=1.1.1
+app.name=myfirstserverpark
@@ -0,0 +1,76 @@
+class BootStrap {
+
+ def init = { servletContext ->
+ def statussus = ['OK','WARNING','PROBLEM','COLD']
+ statussus.each {
+ statusName ->
+ def newStatus = new Status(name: statusName)
+ newStatus.save()
+ }
+
+ def vlans = [['Middleware','877'],['Backend','878'],['Beheer','879'],['Backup','888']]
+ vlans.each {
+ vlanFunction,vlanName ->
+ def newVlan = new Vlan(name:vlanName,function:vlanFunction)
+ newVlan.save()
+ }
+
+ def environments = ['Ontwikkel','Test','Acceptatie','Production']
+ environments.each {
+ name ->
+ def environment = new Environment(name:name)
+ environment.save()
+ }
+
+ def okStatus = Status.findByName("OK")
+ def warningStatus = Status.findByName("WARNING")
+ def errorStatus = Status.findByName("PROBLEM")
+ def coldStatus = Status.findByName("COLD")
+
+ def vlan877 = Vlan.findByName("877")
+ def vlan878 = Vlan.findByName("878")
+ def vlan879 = Vlan.findByName("879")
+ def vlan888 = Vlan.findByName("888")
+
+ def s1729 = new Server(name:"s1729",function:"svn + wiki",status:okStatus, externalIp:"77.245.92.78")
+ s1729.addToNetworks (new NetworkDefinition(ipAddress:"10.2.7.2", vlan:vlan878))
+ s1729.addToNetworks (new NetworkDefinition(ipAddress:"10.2.8.6", vlan:vlan879))
+ s1729.addToNetworks (new NetworkDefinition(ipAddress:"10.2.187.10", vlan:vlan888))
+ s1729.save()
+ def s1731 = new Server(name:"s1731",function:"site 1",status:okStatus, externalIp:"77.245.92.75")
+ s1731.addToNetworks (new NetworkDefinition(ipAddress:"10.2.6.2", vlan:vlan877))
+ s1731.addToNetworks (new NetworkDefinition(ipAddress:"10.2.8.3", vlan:vlan879))
+ s1731.addToNetworks (new NetworkDefinition(ipAddress:"10.2.187.7", vlan:vlan888))
+ s1731.save()
+ def s1732 = new Server(name:"s1732",function:"site 2",status:errorStatus, externalIp:"77.245.92.76")
+ s1732.addToNetworks (new NetworkDefinition(ipAddress:"10.2.6.4", vlan:vlan877))
+ s1732.addToNetworks (new NetworkDefinition(ipAddress:"10.2.8.4", vlan:vlan879))
+ s1732.addToNetworks (new NetworkDefinition(ipAddress:"10.2.187.8", vlan:vlan888))
+ s1732.save()
+ def s1733 = new Server(name:"s1733",function:"standby",status:coldStatus, externalIp:"77.245.92.78")
+ s1733.addToNetworks (new NetworkDefinition(ipAddress:"10.2.6.6", vlan:vlan877))
+ s1733.addToNetworks (new NetworkDefinition(ipAddress:"10.2.8.5", vlan:vlan879))
+ s1733.addToNetworks (new NetworkDefinition(ipAddress:"10.2.187.9", vlan:vlan888))
+ s1733.save()
+ def s1734 = new Server(name:"s1734",function:"database",status:warningStatus, externalIp:"77.245.92.79")
+ s1734.addToNetworks (new NetworkDefinition(ipAddress:"10.2.7.4", vlan:vlan878))
+ s1734.addToNetworks (new NetworkDefinition(ipAddress:"10.2.8.7", vlan:vlan879))
+ s1734.addToNetworks (new NetworkDefinition(ipAddress:"10.2.187.11", vlan:vlan888))
+ s1734.save()
+ def s1735 = new Server(name:"s1735",function:"cms + importer",status:okStatus, externalIp:"77.245.92.80")
+ s1735.addToNetworks (new NetworkDefinition(ipAddress:"10.2.7.6", vlan:vlan878))
+ s1735.addToNetworks (new NetworkDefinition(ipAddress:"10.2.8.8", vlan:vlan879))
+ s1735.addToNetworks (new NetworkDefinition(ipAddress:"10.2.187.12", vlan:vlan888))
+ s1735.save()
+
+ def ontwikkel = Environment.findByName("Ontwikkel")
+ ontwikkel.addToServers (s1729)
+ ontwikkel.addToServers (s1731)
+ ontwikkel.addToServers (s1732)
+ ontwikkel.addToServers (s1733)
+ ontwikkel.addToServers (s1734)
+ ontwikkel.addToServers (s1735)
+ }
+ def destroy = {
+ }
+}
@@ -0,0 +1,73 @@
+// locations to search for config files that get merged into the main config
+// config files can either be Java properties files or ConfigSlurper scripts
+
+// grails.config.locations = [ "classpath:${appName}-config.properties",
+// "classpath:${appName}-config.groovy",
+// "file:${userHome}/.grails/${appName}-config.properties",
+// "file:${userHome}/.grails/${appName}-config.groovy"]
+
+// if(System.properties["${appName}.config.location"]) {
+// grails.config.locations << "file:" + System.properties["${appName}.config.location"]
+// }
+grails.mime.file.extensions = true // enables the parsing of file extensions from URLs into the request format
+grails.mime.use.accept.header = false
+grails.mime.types = [ html: ['text/html','application/xhtml+xml'],
+ xml: ['text/xml', 'application/xml'],
+ text: 'text/plain',
+ js: 'text/javascript',
+ rss: 'application/rss+xml',
+ atom: 'application/atom+xml',
+ css: 'text/css',
+ csv: 'text/csv',
+ all: '*/*',
+ json: ['application/json','text/json'],
+ form: 'application/x-www-form-urlencoded',
+ multipartForm: 'multipart/form-data'
+ ]
+// The default codec used to encode data with ${}
+grails.views.default.codec="none" // none, html, base64
+grails.views.gsp.encoding="UTF-8"
+grails.converters.encoding="UTF-8"
+
+// enabled native2ascii conversion of i18n properties files
+grails.enable.native2ascii = true
+
+// set per-environment serverURL stem for creating absolute links
+environments {
+ production {
+ grails.serverURL = "http://www.changeme.com"
+ }
+ development {
+ grails.serverURL = "http://localhost:8080/${appName}"
+ }
+ test {
+ grails.serverURL = "http://localhost:8080/${appName}"
+ }
+
+}
+
+// log4j configuration
+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'
+
+ warn 'org.mortbay.log'
+}
+
+
+
@@ -0,0 +1,32 @@
+dataSource {
+ pooled = true
+ driverClassName = "org.hsqldb.jdbcDriver"
+ username = "sa"
+ password = ""
+}
+hibernate {
+ cache.use_second_level_cache=true
+ cache.use_query_cache=true
+ cache.provider_class='com.opensymphony.oscache.hibernate.OSCacheProvider'
+}
+// environment specific settings
+environments {
+ development {
+ dataSource {
+ dbCreate = "create-drop" // one of 'create', 'create-drop','update'
+ url = "jdbc:hsqldb:mem:devDB"
+ }
+ }
+ test {
+ dataSource {
+ dbCreate = "update"
+ url = "jdbc:hsqldb:mem:testDb"
+ }
+ }
+ production {
+ dataSource {
+ dbCreate = "update"
+ url = "jdbc:hsqldb:file:prodDb;shutdown=true"
+ }
+ }
+}
@@ -0,0 +1,11 @@
+class UrlMappings {
+ static mappings = {
+ "/$controller/$action?/$id?"{
+ constraints {
+ // apply constraints here
+ }
+ }
+ "/"(view:"/index")
+ "500"(view:'/error')
+ }
+}
@@ -0,0 +1,4 @@
+// Place your Spring DSL code here
+beans = {
+
+}
@@ -0,0 +1,4 @@
+class CommentController {
+ def scaffold = true
+
+}
@@ -0,0 +1,3 @@
+class EnvironmentController {
+ def scaffold = true
+}
@@ -0,0 +1,3 @@
+class NetworkDefinitionController {
+ def scaffold = true
+}
@@ -0,0 +1,22 @@
+class OverviewController {
+
+ def show = {
+ redirect(uri:"/server/show/${params.id}")
+ }
+
+ def comments = {
+ def currentServer = Server.findById(params.id.toLong())
+ def allComments = Comment.withCriteria {
+ server {
+ eq("id",currentServer.id)
+ }
+ }
+ render(template:"/shared/comment",model:[comments:allComments, server:currentServer])
+ }
+
+ def index = {
+ def environments = Environment.list()
+ println environments
+ [environments:environments]
+ }
+}
@@ -0,0 +1,3 @@
+class ServerController {
+ def scaffold = true
+}
@@ -0,0 +1,3 @@
+class StatusController {
+ def scaffold = true
+}
@@ -0,0 +1,3 @@
+class VlanController {
+ def scaffold = true
+}
@@ -0,0 +1,15 @@
+class Comment {
+ String name
+ String content
+
+ static belongsTo = [server:Server]
+
+ static mapping = {
+ content type: "text"
+ }
+
+ static constraints = {
+ name(blank:false, maxSize:50)
+ content(blank:false, widget:"textarea")
+ }
+}
@@ -0,0 +1,15 @@
+class Environment {
+ String name
+
+ static hasMany = [servers:Server]
+
+ static constraints = {
+ name(blank:false, maxSize:50)
+ }
+
+ def String toString() {
+ return name + ": " + servers.size();
+ }
+
+
+}
@@ -0,0 +1,14 @@
+class NetworkDefinition {
+ String ipAddress
+ Vlan vlan
+
+ static belongsTo = [server:Server]
+
+ static constraints = {
+ ipAddress(matches : "(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)")
+ }
+
+ public String toString() {
+ return vlan + ' ' + ipAddress
+ }
+}
@@ -0,0 +1,23 @@
+class Server {
+ String name
+ String function
+ String externalIp
+
+ // relationships
+ Status status
+ static hasMany = [networks:NetworkDefinition]
+
+ static belongsTo = Environment
+
+ static constraints = {
+ name(blank:false, maxSize:50)
+ function(blank:false, maxSize:50)
+ externalIp(matches : "(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)")
+ }
+
+ def String toString() {
+ return name
+ }
+
+
+}
@@ -0,0 +1,13 @@
+class Status {
+ String name
+
+ static constraints = {
+ name(blank:false, maxSize:50)
+ }
+
+ def String toString() {
+ return name
+ }
+
+
+}
@@ -0,0 +1,15 @@
+class Vlan {
+ String name
+ String function
+
+ static constraints = {
+ name(blank:false, maxSize:50)
+ function(blank:false, maxSize:100)
+ }
+
+ def String toString() {
+ return name + ': ' + function
+ }
+
+
+}
@@ -0,0 +1,34 @@
+default.doesnt.match.message=Property [{0}] of class [{1}] with value [{2}] does not match the required pattern [{3}]
+default.invalid.url.message=Property [{0}] of class [{1}] with value [{2}] is not a valid URL
+default.invalid.creditCard.message=Property [{0}] of class [{1}] with value [{2}] is not a valid credit card number
+default.invalid.email.message=Property [{0}] of class [{1}] with value [{2}] is not a valid e-mail address
+default.invalid.range.message=Property [{0}] of class [{1}] with value [{2}] does not fall within the valid range from [{3}] to [{4}]
+default.invalid.size.message=Property [{0}] of class [{1}] with value [{2}] does not fall within the valid size range from [{3}] to [{4}]
+default.invalid.max.message=Property [{0}] of class [{1}] with value [{2}] exceeds maximum value [{3}]
+default.invalid.min.message=Property [{0}] of class [{1}] with value [{2}] is less than minimum value [{3}]
+default.invalid.max.size.message=Property [{0}] of class [{1}] with value [{2}] exceeds the maximum size of [{3}]
+default.invalid.min.size.message=Property [{0}] of class [{1}] with value [{2}] is less than the minimum size of [{3}]
+default.invalid.validator.message=Property [{0}] of class [{1}] with value [{2}] does not pass custom validation
+default.not.inlist.message=Property [{0}] of class [{1}] with value [{2}] is not contained within the list [{3}]
+default.blank.message=Property [{0}] of class [{1}] cannot be blank
+default.not.equal.message=Property [{0}] of class [{1}] with value [{2}] cannot equal [{3}]
+default.null.message=Property [{0}] of class [{1}] cannot be null
+default.not.unique.message=Property [{0}] of class [{1}] with value [{2}] must be unique
+
+default.paginate.prev=Previous
+default.paginate.next=Next
+default.boolean.true=True
+default.boolean.false=False
+default.date.format=yyyy-MM-dd HH:mm:ss z
+default.number.format=0
+
+# Data binding errors. Use "typeMismatch.$className.$propertyName to customize (eg typeMismatch.Book.author)
+typeMismatch.java.net.URL=Property {0} must be a valid URL
+typeMismatch.java.net.URI=Property {0} must be a valid URI
+typeMismatch.java.util.Date=Property {0} must be a valid Date
+typeMismatch.java.lang.Double=Property {0} must be a valid number
+typeMismatch.java.lang.Integer=Property {0} must be a valid number
+typeMismatch.java.lang.Long=Property {0} must be a valid number
+typeMismatch.java.lang.Short=Property {0} must be a valid number
+typeMismatch.java.math.BigDecimal=Property {0} must be a valid number
+typeMismatch.java.math.BigInteger=Property {0} must be a valid number
Oops, something went wrong.

0 comments on commit 83a1a06

Please sign in to comment.