Skip to content

Commit

Permalink
simple wiki from grails.org wiki.
Browse files Browse the repository at this point in the history
  • Loading branch information
tyama committed Oct 11, 2010
1 parent c2b7f07 commit f6d4604
Show file tree
Hide file tree
Showing 3 changed files with 517 additions and 0 deletions.
40 changes: 40 additions & 0 deletions grails-app/services/org/jggug/wiki/CacheService.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package org.jggug.wiki

import net.sf.ehcache.Ehcache
import net.sf.ehcache.Element

class CacheService {

static transactional = false

Ehcache contentCache
Ehcache wikiCache

def getContent(key) {
contentCache.get(key)?.getValue()
}

def putContent(key,value) {
def old = getContent(key)
contentCache.put(new Element(key,value))
return old
}

def removeContent(key) {
contentCache.remove key
}

def getWikiText(key) {
wikiCache.get(key)?.getValue()
}

def removeWikiText(key) {
wikiCache.remove key
}

def putWikiText(key,value) {
def old = getWikiText(key)
wikiCache.put(new Element(key,value))
return old
}
}
Loading

0 comments on commit f6d4604

Please sign in to comment.