Skip to content

Commit

Permalink
Upgraded Groovy++ plugin version, made some minor compatibility chang…
Browse files Browse the repository at this point in the history
…es, and added MIXED mode to PluginService.
  • Loading branch information
pledbrook committed Jan 27, 2011
1 parent d29d47a commit 4a6e435
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
4 changes: 2 additions & 2 deletions grails.org/application.properties
@@ -1,7 +1,7 @@
#Grails Metadata file
#Wed Jan 12 15:13:19 GMT 2011
#Thu Jan 27 14:14:15 GMT 2011
app.grails.version=1.3.6
app.name=site
app.servlet.version=2.4
app.version=1.0.1-SNAPSHOT
plugins.groovy-plus-plus=0.4.98
plugins.groovy-plus-plus=0.4.152
Expand Up @@ -348,8 +348,8 @@ class PluginController extends BaseWikiController {
try {
def maxResults = params.int('max') ?: 10
def offset = params.int('offset') ?: 0
def (plugins, pluginCount) = pluginService.listPluginsByTagWithTotal(params.tagName, max: maxResults, offset: offset)
return [currentPlugins: plugins, totalPlugins: pluginCount, tagName:params.tagName, max: maxResults, offset: offset]
def result = pluginService.listPluginsByTagWithTotal(params.tagName, max: maxResults, offset: offset)
return [currentPlugins: result[0], totalPlugins: result[1], tagName:params.tagName, max: maxResults, offset: offset]
}
catch (TagNotFoundException ex) {
render view: "tagNotFound", model: [tagName: ex.tagName ?: '', msgCode: ex.code]
Expand Down
Expand Up @@ -8,6 +8,7 @@ import org.grails.taggable.Tag
import org.grails.taggable.TagLink
import org.grails.wiki.WikiPage

@Typed(TypePolicy.MIXED)
class PluginService {

static int DEFAULT_MAX = 5
Expand Down Expand Up @@ -44,11 +45,11 @@ class PluginService {

def listPopularPluginsWithTotal(Map args = [max: 200]) {
// The Rateable plugin's query only accepts pagination arguments.
def params = [:]
def params = [cache: true]
if (args["max"] != null) params["max"] = args["max"]
if (args["offset"] != null) params["offset"] = args["offset"]
return [
Plugin.listOrderByAverageRating(cache:true, *:params),
Plugin.listOrderByAverageRating(params),
Plugin.countRated() ]
}

Expand Down Expand Up @@ -82,7 +83,8 @@ class PluginService {
result << TagLink.countByTagAndType(tag, 'plugin')
}
else {
result << [] << 0
result << []
result << 0
}

return result
Expand All @@ -92,6 +94,7 @@ class PluginService {
translateMasterPlugins(generateMasterPlugins())
}

@Typed(TypePolicy.DYNAMIC)
def generateMasterPlugins() {
try {
def pluginLoc = ConfigurationHolder.config?.plugins?.pluginslist
Expand Down Expand Up @@ -273,6 +276,7 @@ class PluginService {
v1Num.compareTo(v2Num)
}

@Typed(TypePolicy.DYNAMIC)
def getGrailsVersion(plugin) {
def xmlLoc = "${ConfigurationHolder.config?.plugins?.location}/grails-${plugin.name}/tags/LATEST_RELEASE/plugin.xml"
def xmlUrl = new URL(xmlLoc)
Expand Down Expand Up @@ -395,7 +399,7 @@ class PluginService {
return [sort: "lastReleased", order: "desc"]

default:
return ""
return [:]
}
}

Expand Down

0 comments on commit 4a6e435

Please sign in to comment.