Permalink
Browse files

Added the most basic search implementation

  • Loading branch information...
1 parent 9139c0f commit bf63eacc6be84e89dd8e2a26b7d6f9b794e4bdf7 @jettro committed Jan 10, 2010
@@ -9,6 +9,7 @@
<root url="file://$MODULE_DIR$/../../.grails/1.2.0/projects/MyScheduling/plugins/grails-ui-1.2-SNAPSHOT/web-app" relative="/" />
<root url="file://$MODULE_DIR$/../../.grails/1.2.0/projects/MyScheduling/plugins/navigation-1.1/web-app" relative="/" />
<root url="file://$MODULE_DIR$/../../.grails/1.2.0/projects/MyScheduling/plugins/db-util-0.4/web-app" relative="/" />
+ <root url="file://$MODULE_DIR$/../../.grails/1.2.0/projects/MyScheduling/plugins/searchable-0.5.5/web-app" relative="/" />
</webroots>
<sourceRoots />
</configuration>
@@ -48,6 +49,12 @@
<sourceFolder url="file://$MODULE_DIR$/../../.grails/1.2.0/projects/MyScheduling/plugins/navigation-1.1/grails-app/services" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../.grails/1.2.0/projects/MyScheduling/plugins/navigation-1.1/grails-app/taglib" isTestSource="false" />
</content>
+ <content url="file://$MODULE_DIR$/../../.grails/1.2.0/projects/MyScheduling/plugins/searchable-0.5.5">
+ <sourceFolder url="file://$MODULE_DIR$/../../.grails/1.2.0/projects/MyScheduling/plugins/searchable-0.5.5/src/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/../../.grails/1.2.0/projects/MyScheduling/plugins/searchable-0.5.5/src/groovy" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/../../.grails/1.2.0/projects/MyScheduling/plugins/searchable-0.5.5/grails-app/controllers" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/../../.grails/1.2.0/projects/MyScheduling/plugins/searchable-0.5.5/grails-app/services" isTestSource="false" />
+ </content>
<content url="file://$MODULE_DIR$/../../.grails/1.2.0/projects/MyScheduling/plugins/tomcat-1.2.0">
<sourceFolder url="file://$MODULE_DIR$/../../.grails/1.2.0/projects/MyScheduling/plugins/tomcat-1.2.0/src/groovy" isTestSource="false" />
</content>
@@ -67,6 +74,7 @@
<root url="file://$MODULE_DIR$/../../.grails/1.2.0/projects/MyScheduling/plugins/db-util-0.4/lib" />
<root url="file://$MODULE_DIR$/../../.grails/1.2.0/projects/MyScheduling/plugins/mail-0.9/lib" />
<root url="file://$MODULE_DIR$/../../.grails/1.2.0/projects/MyScheduling/plugins/acegi-0.5.2/lib" />
+ <root url="file://$MODULE_DIR$/../../.grails/1.2.0/projects/MyScheduling/plugins/searchable-0.5.5/lib" />
</CLASSES>
<JAVADOC />
<SOURCES />
@@ -75,6 +83,7 @@
<jarDirectory url="file://$MODULE_DIR$/../../.grails/1.2.0/projects/MyScheduling/plugins/grails-ui-1.2-SNAPSHOT/lib" recursive="false" />
<jarDirectory url="file://$MODULE_DIR$/../../.grails/1.2.0/projects/MyScheduling/plugins/joda-time-0.5/lib" recursive="false" />
<jarDirectory url="file://$MODULE_DIR$/../../.grails/1.2.0/projects/MyScheduling/plugins/mail-0.9/lib" recursive="false" />
+ <jarDirectory url="file://$MODULE_DIR$/../../.grails/1.2.0/projects/MyScheduling/plugins/searchable-0.5.5/lib" recursive="false" />
<jarDirectory url="file://$MODULE_DIR$/../../.grails/1.2.0/projects/MyScheduling/plugins/tomcat-1.2.0/lib" recursive="false" />
</library>
</orderEntry>
View
1 README
@@ -12,6 +12,7 @@ next to the plugins that are used out-of-the-box.
- mail-0.9 (well I guess for sending emails)
- navigation-1.1 (used for the main and top navigation)
- yui-2.7.0.1 (comes with the grails-ui plugin)
+- searchable-0.5.5 (plugin using compass and lucene to make you groovy domain objects searchable)
I am writing a series of blog posts to explain what I am creating:
http://www.gridshore.nl/2009/12/20/starting-with-grails/
View
@@ -1,5 +1,5 @@
#Grails Metadata file
-#Mon Jan 04 13:06:10 CET 2010
+#Sat Jan 09 18:26:43 CET 2010
app.grails.version=1.2.0
app.name=MyScheduling
app.servlet.version=2.4
@@ -12,5 +12,6 @@ plugins.hibernate=1.2.0
plugins.joda-time=0.5
plugins.mail=0.9
plugins.navigation=1.1
+plugins.searchable=0.5.5
plugins.tomcat=1.2.0
plugins.yui=2.7.0.1
@@ -3,79 +3,100 @@ import nl.gridshore.scheduling.Project
import nl.gridshore.scheduling.Role
import nl.gridshore.scheduling.Requestmap
import nl.gridshore.scheduling.User
+import nl.gridshore.scheduling.MeetingNotes
class BootStrap {
def authenticateService
- def init = { servletContext ->
- def jettro = new Person(name:'Jettro',partTimeFactor:1)
- jettro.save()
- def roberto = new Person(name:'Roberto',partTimeFactor:1)
- roberto.save()
- def allard = new Person(name:'Allard',partTimeFactor:1)
- allard.save()
- def bram = new Person(name:'Bram',partTimeFactor:0.8)
- bram.save()
+ def init = {servletContext ->
+ def jettro = new Person(name: 'Jettro', partTimeFactor: 1)
+ jettro.save()
+ def roberto = new Person(name: 'Roberto', partTimeFactor: 1)
+ roberto.save()
+ def allard = new Person(name: 'Allard', partTimeFactor: 1)
+ allard.save()
+ def bram = new Person(name: 'Bram', partTimeFactor: 0.8)
+ bram.save()
- def cqrs4j = new Project(name:'CQRS4j')
- cqrs4j.save()
- def myscheduling = new Project(name:'MyScheduling')
- myscheduling.save()
- def newsfeed = new Project(name:'news-feed')
- newsfeed.save()
+ def cqrs4j = new Project(name: 'CQRS4j')
+ cqrs4j.save()
+ def myscheduling = new Project(name: 'MyScheduling')
+ myscheduling.save()
+ def newsfeed = new Project(name: 'news-feed')
+ newsfeed.save()
- jettro.addToProjects myscheduling
- jettro.addToProjects newsfeed
- jettro.addToProjects cqrs4j
- allard.addToProjects cqrs4j
- roberto.addToProjects newsfeed
+ jettro.addToProjects myscheduling
+ jettro.addToProjects newsfeed
+ jettro.addToProjects cqrs4j
+ allard.addToProjects cqrs4j
+ roberto.addToProjects newsfeed
- // security
- // roles
- def roleAdmin = new Role(authority:"ROLE_ADMIN",description:"admin")
- roleAdmin.save()
- def roleSysAdmin = new Role(authority:"ROLE_SYSADMIN",description:"sysadmin")
- roleSysAdmin.save()
+ // security
+ // roles
+ def roleAdmin = new Role(authority: "ROLE_ADMIN", description: "admin")
+ roleAdmin.save()
+ def roleSysAdmin = new Role(authority: "ROLE_SYSADMIN", description: "sysadmin")
+ roleSysAdmin.save()
- // request maps
- def securePerson = new Requestmap(url:"/person/**",configAttribute:"ROLE_ADMIN")
- securePerson.save()
- def secureProject = new Requestmap(url:"/project/**",configAttribute:"ROLE_ADMIN")
- secureProject.save()
- def secureUser = new Requestmap(url:"/user/**",configAttribute:"ROLE_ADMIN")
- secureUser.save()
- def secureRole = new Requestmap(url:"/role/**",configAttribute:"ROLE_SYSADMIN")
- secureRole.save()
- def secureRequestmap = new Requestmap(url:"/requestmap/**",configAttribute:"ROLE_SYSADMIN")
- secureRequestmap.save()
+ // request maps
+ def securePerson = new Requestmap(url: "/person/**", configAttribute: "ROLE_ADMIN")
+ securePerson.save()
+ def secureProject = new Requestmap(url: "/project/**", configAttribute: "ROLE_ADMIN")
+ secureProject.save()
+ def secureUser = new Requestmap(url: "/user/**", configAttribute: "ROLE_ADMIN")
+ secureUser.save()
+ def secureRole = new Requestmap(url: "/role/**", configAttribute: "ROLE_SYSADMIN")
+ secureRole.save()
+ def secureRequestmap = new Requestmap(url: "/requestmap/**", configAttribute: "ROLE_SYSADMIN")
+ secureRequestmap.save()
- // users
- def passwdAdmin = authenticateService.encodePassword('admin')
- def admin = new User(
- username:"admin",
- userRealName:"Administrator",
- passwd:passwdAdmin,
- enabled:true,
- email:"admin@myscheduling",
- emailShow:true,
- description:'Can be used to do administrative tasks')
- admin.save()
- admin.addToAuthorities roleAdmin
+ // users
+ def passwdAdmin = authenticateService.encodePassword('admin')
+ def admin = new User(
+ username: "admin",
+ userRealName: "Administrator",
+ passwd: passwdAdmin,
+ enabled: true,
+ email: "admin@myscheduling",
+ emailShow: true,
+ description: 'Can be used to do administrative tasks')
+ admin.save()
+ admin.addToAuthorities roleAdmin
- def passwdSysadmin = authenticateService.encodePassword('sysadmin')
- def sysadmin = new User(
- username:"sysadmin",
- userRealName:"System Administrator",
- passwd:passwdSysadmin,
- enabled:true,
- email:"sysadmin@myscheduling",
- emailShow:true,
- description:'Can be used to do system administrative tasks')
- sysadmin.save()
- sysadmin.addToAuthorities roleAdmin
- sysadmin.addToAuthorities roleSysAdmin
- }
- def destroy = {
- }
+ def passwdSysadmin = authenticateService.encodePassword('sysadmin')
+ def sysadmin = new User(
+ username: "sysadmin",
+ userRealName: "System Administrator",
+ passwd: passwdSysadmin,
+ enabled: true,
+ email: "sysadmin@myscheduling",
+ emailShow: true,
+ description: 'Can be used to do system administrative tasks')
+ sysadmin.save()
+ sysadmin.addToAuthorities roleAdmin
+ sysadmin.addToAuthorities roleSysAdmin
+
+ def meetWeek1 = new MeetingNotes(
+ weekNr: 1,
+ user: admin,
+ notes: '''Everybody is on a holiday'''
+ )
+ meetWeek1.save()
+ def meetWeek2 = new MeetingNotes(
+ weekNr: 2,
+ user: admin,
+ notes: '''<strong>news-feed</strong><br><ul><li>Jettro wrote a blog post and the project is now in sleeping mode.</li></ul><div><strong>MyScheduling</strong><br><ul><li>Jettro wrote a blog post and is moving on</li></ul><div><strong>CQRS4j</strong><br><ul><li>Allard published the code and wrote some documentation</li></ul><div>Nothing other special things happening'''
+ )
+ meetWeek2.save()
+ def meetWeek3 = new MeetingNotes(
+ weekNr: 3,
+ user: admin,
+ notes: '''<strong>CQRS4J<br><ul><li><span style="font-weight: normal;">Allard wants to spend much time on it this week.</span></li><li><span style="font-weight: normal;">Uri want to help out and create a nice front-end.</span></li></ul><div><span style="font-weight: normal;"><strong>MyScheduling</strong><br><ul><li>Jettro is creating the next step</li></ul><div>Besides that everything is going fine</span></strong>'''
+ )
+ meetWeek3.save()
+
+ }
+ def destroy = {
+ }
}
@@ -13,4 +13,9 @@ class MeetingNotes {
notes type: "text"
}
+ static searchable = true
+
+ String toString() {
+ return "Week number : ${weekNr}"
+ }
}

0 comments on commit bf63eac

Please sign in to comment.