Skip to content
Browse files

Upgraded Groovy++ plugin version, made some minor compatibility chang…

…es, and added MIXED mode to PluginService.
  • Loading branch information...
1 parent d29d47a commit 4a6e435cda3d8cf7ced7a8eeee55f5871275d559 @pledbrook pledbrook committed
View
4 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
View
4 grails.org/grails-app/controllers/org/grails/plugin/PluginController.groovy
@@ -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]
View
12 grails.org/grails-app/services/org/grails/plugin/PluginService.groovy
@@ -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
@@ -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() ]
}
@@ -82,7 +83,8 @@ class PluginService {
result << TagLink.countByTagAndType(tag, 'plugin')
}
else {
- result << [] << 0
+ result << []
+ result << 0
}
return result
@@ -92,6 +94,7 @@ class PluginService {
translateMasterPlugins(generateMasterPlugins())
}
+ @Typed(TypePolicy.DYNAMIC)
def generateMasterPlugins() {
try {
def pluginLoc = ConfigurationHolder.config?.plugins?.pluginslist
@@ -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)
@@ -395,7 +399,7 @@ class PluginService {
return [sort: "lastReleased", order: "desc"]
default:
- return ""
+ return [:]
}
}

0 comments on commit 4a6e435

Please sign in to comment.
Something went wrong with that request. Please try again.