Permalink
Browse files

Fixing plugin home bug when no rated plugins.

git-svn-id: https://svn.codehaus.org/grails/trunk@8896 1cfb16fd-6d17-0410-8ff1-b7e8e1e2867d
  • Loading branch information...
1 parent ff6269a commit a5435f60947359fc85aa2fbfd97a9740b5fdde1a rhyolight committed Mar 13, 2009
View
@@ -80,107 +80,14 @@
<classpathentry kind="var" path="GRAILS_HOME/lib/start.jar" />
<classpathentry kind="var" path="GRAILS_HOME/lib/svnkit-1.2.0.jar" />
<classpathentry kind="var" path="GRAILS_HOME/lib/xpp3_min-1.1.3.4.O.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/dist/grails-bootstrap-1.1-SNAPSHOT.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/dist/grails-core-1.1-SNAPSHOT.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/dist/grails-crud-1.1-SNAPSHOT.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/dist/grails-gorm-1.1-SNAPSHOT.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/dist/grails-resources-1.1-SNAPSHOT.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/dist/grails-scripts-1.1-SNAPSHOT.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/dist/grails-spring-1.1-SNAPSHOT.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/dist/grails-test-1.1-SNAPSHOT.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/dist/grails-web-1.1-SNAPSHOT.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/dist/grails-webflow-1.1-SNAPSHOT.jar" />
-</classpath>
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-<classpathentry kind="src" path="src/java"/>
-<classpathentry kind="src" path="src/groovy"/>
-<classpathentry kind="src" path="grails-app/conf"/>
-<classpathentry kind="src" path="grails-app/controllers"/>
-<classpathentry kind="src" path="grails-app/domain"/>
-<classpathentry kind="src" path="grails-app/services"/>
-<classpathentry kind="src" path="grails-app/taglib"/>
-<classpathentry kind="src" path="test/integration"/>
-<classpathentry kind="src" path="test/unit"/>
-<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-<classpathentry kind="output" path="web-app/WEB-INF/classes"/>
-<classpathentry kind="var" path="GRAILS_HOME/ant/lib/ant.jar"/>
-<classpathentry kind="var" path="GRAILS_HOME/lib/ant-1.7.0.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/ant-junit-1.7.0.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/ant-launcher-1.7.0.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/ant-nodeps-1.7.0.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/ant-trax.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/antlr-2.7.6.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/aspectjrt.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/aspectjweaver.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/backport-util-concurrent-3.0.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/cglib-nodep-2.1_3.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/commons-beanutils-1.7.0.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/commons-cli-1.0.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/commons-codec-1.3.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/commons-collections-3.2.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/commons-dbcp-1.2.1.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/commons-el-1.0.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/commons-fileupload-1.1.1.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/commons-io-1.4.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/commons-lang-2.4.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/commons-pool-1.2.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/commons-validator-1.3.0.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/dom4j-1.6.1.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/ehcache-1.5.0.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/ejb3-persistence-3.3.0.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/gant_groovy1.6-1.6.0.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/groovy-all-1.6.0.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/hibernate-annotations-3.3.0.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/hibernate-commons-annotations-3.3.0.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/hibernate3-3.3.1.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/hsqldb-1.8.0.5.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/ivy-2.0.0.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/jasper-compiler-5.5.15.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/jasper-compiler-jdt-5.5.15.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/jasper-runtime-5.5.15.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/javassist-3.4.GA.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/jcl-over-slf4j-1.5.6.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/jetty-6.1.14.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/jetty-naming-6.1.14.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/jetty-plus-6.1.14.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/jetty-util-6.1.14.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/jline-0.9.91.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/jsp-api-2.0.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/jsp-api-2.1.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/jsr107cache-1.0.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/jstl-2.3.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/jstl-2.4.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/jta-1.1.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/junit-3.8.2.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/log4j-1.2.15.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/ognl-2.6.9.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/org.springframework.binding-2.0.3.RELEASE.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/org.springframework.js-2.0.3.RELEASE.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/org.springframework.webflow-2.0.3.RELEASE.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/oro-2.0.8.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/oscache-2.4.1.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/serializer.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/servlet-api-2.5-6.1.14.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/sitemesh-2.4.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/slf4j-api-1.5.6.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/slf4j-log4j12-1.5.6.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/spring-2.5.6.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/spring-test-2.5.6.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/spring-webmvc-2.5.6.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/standard-2.3.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/standard-2.4.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/start.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/svnkit-1.2.0.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/lib/xpp3_min-1.1.3.4.O.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/dist/grails-bootstrap-1.1-SNAPSHOT.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/dist/grails-core-1.1-SNAPSHOT.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/dist/grails-crud-1.1-SNAPSHOT.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/dist/grails-gorm-1.1-SNAPSHOT.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/dist/grails-resources-1.1-SNAPSHOT.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/dist/grails-scripts-1.1-SNAPSHOT.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/dist/grails-spring-1.1-SNAPSHOT.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/dist/grails-test-1.1-SNAPSHOT.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/dist/grails-web-1.1-SNAPSHOT.jar" />
-<classpathentry kind="var" path="GRAILS_HOME/dist/grails-webflow-1.1-SNAPSHOT.jar" />
+<classpathentry kind="var" path="GRAILS_HOME/dist/grails-bootstrap-1.1.jar" />
+<classpathentry kind="var" path="GRAILS_HOME/dist/grails-core-1.1.jar" />
+<classpathentry kind="var" path="GRAILS_HOME/dist/grails-crud-1.1.jar" />
+<classpathentry kind="var" path="GRAILS_HOME/dist/grails-gorm-1.1.jar" />
+<classpathentry kind="var" path="GRAILS_HOME/dist/grails-resources-1.1.jar" />
+<classpathentry kind="var" path="GRAILS_HOME/dist/grails-scripts-1.1.jar" />
+<classpathentry kind="var" path="GRAILS_HOME/dist/grails-spring-1.1.jar" />
+<classpathentry kind="var" path="GRAILS_HOME/dist/grails-test-1.1.jar" />
+<classpathentry kind="var" path="GRAILS_HOME/dist/grails-web-1.1.jar" />
+<classpathentry kind="var" path="GRAILS_HOME/dist/grails-webflow-1.1.jar" />
</classpath>
View
@@ -1,28 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>liquibase</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.codehaus.groovy.eclipse.groovyBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.codehaus.groovy.eclipse.groovyNature</nature>
- </natures>
-</projectDescription>
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
<name>site</name>
<comment></comment>
<projects>
@@ -1,10 +1,10 @@
#utf-8
-#Tue Mar 10 16:47:44 CDT 2009
+#Fri Mar 13 11:37:17 CDT 2009
plugins.mail=0.5
plugins.simple-blog=0.1.2
-app.grails.version=1.1-SNAPSHOT
+app.grails.version=1.1
plugins.bubbling=1.5.1
-plugins.hibernate=1.1-RC2
+plugins.hibernate=1.1
plugins.autobase=0.8.2.1
app.name=site
plugins.taggable=0.4.2
@@ -71,4 +71,4 @@ log4j = {
'org.hibernate'
warn 'org.mortbay.log'
-}
+}
@@ -16,7 +16,7 @@ class PluginController extends BaseWikiController {
static String HOME_WIKI = 'PluginHome'
static int PORTAL_MAX_RESULTS = 5
- static int PORTAL_MIN_RATINGS = 0
+ static int PORTAL_MIN_RATINGS = 1
def wikiPageService
@@ -43,12 +43,14 @@ class PluginController extends BaseWikiController {
}
def popularPlugins = Plugin.list().findAll {
- it.ratings.size() > PORTAL_MIN_RATINGS
+ it.ratings.size() >= PORTAL_MIN_RATINGS
}.sort {
it.averageRating
}.reverse()
// only the first few
- popularPlugins = popularPlugins[0..(popularPlugins.size() < PORTAL_MAX_RESULTS ? popularPlugins.size() : PORTAL_MAX_RESULTS - 1)]
+ if (popularPlugins.size()) {
+ popularPlugins = popularPlugins[0..(popularPlugins.size() < PORTAL_MAX_RESULTS ? popularPlugins.size() - 1 : PORTAL_MAX_RESULTS - 1)]
+ }
def newestPlugins = Plugin.withCriteria {
order('dateCreated', 'desc')
View
@@ -1,24 +1,27 @@
<ivy-module version="2.0">
- <info organisation="SpringSource" module="grails.org"/>
+ <info organisation="org.example" module="site"/>
<configurations defaultconfmapping="build->default;compile->compile(*),master(*);test,runtime->runtime(*),master(*)">
<conf name="build"/>
<conf name="compile"/>
<conf name="test" extends="compile"/>
<conf name="runtime" extends="compile"/>
</configurations>
<dependencies>
- <dependency org="org.grails" name="grails-bootstrap" rev="1.1-SNAPSHOT" conf="build"/>
- <dependency org="org.grails" name="grails-scripts" rev="1.1-SNAPSHOT" conf="build"/>
- <dependency org="org.grails" name="grails-gorm" rev="1.1-SNAPSHOT" conf="compile"/>
- <dependency org="org.grails" name="grails-web" rev="1.1-SNAPSHOT" conf="compile"/>
- <dependency org="org.grails" name="grails-test" rev="1.1-SNAPSHOT" conf="test"/>
- <dependency org="commons-codec" name="commons-codec" rev="1.3" conf="compile"/>
- <dependency org="net.sf.ehcache" name="ehcache" rev="1.5.0" transitive="false" conf="compile"/>
- <dependency org="backport-util-concurrent" name="backport-util-concurrent" rev="3.1" conf="runtime"/>
- <dependency org="net.sf.jsr107cache" name="jsr107cache" rev="1.0" conf="runtime"/>
- <dependency org="radeox" name="radeox" rev="1.0-b2" conf="compile"/>
+ <dependency org="org.grails" name="grails-bootstrap" rev="1.1" conf="build"/>
+ <dependency org="org.grails" name="grails-scripts" rev="1.1" conf="build"/>
+ <dependency org="org.grails" name="grails-gorm" rev="1.1" conf="compile"/>
+ <dependency org="org.grails" name="grails-web" rev="1.1" conf="compile"/>
+ <dependency org="org.grails" name="grails-test" rev="1.1" conf="test"/>
+ <dependency org="org.slf4j" name="slf4j-log4j12" rev="1.5.5" conf="runtime"/>
+ <dependency org="opensymphony" name="oscache" rev="2.4" conf="runtime">
+ <exclude org="javax.jms" module="jms" name="*" type="*" ext="*" conf="" matcher="exact"/>
+ <exclude org="commons-logging" module="commons-logging" name="*" type="*" ext="*" conf="" matcher="exact"/>
+ <exclude org="javax.servlet" module="servlet-api" name="*" type="*" ext="*" conf="" matcher="exact"/>
+ </dependency>
<dependency org="hsqldb" name="hsqldb" rev="1.8.0.5" conf="runtime"/>
+ <!--
<dependency org="mysql" name="mysql-connector-java" rev="5.1.6" conf="runtime"/>
- <dependency org="org.slf4j" name="slf4j-log4j12" rev="1.5.5" conf="runtime"/>
+ <dependency org="postgresql" name="postgresql" rev="8.3-603.jdbc3" conf="runtime"/>
+ -->
</dependencies>
</ivy-module>
@@ -209,9 +209,9 @@ for "${c.title}" [here|${ConfigurationHolder.config.grails.serverURL}/plugin/${p
private void addComment(text, instance, poster) {
def comment = grailsApp.getDomainClass("org.grails.comments.Comment").clazz.newInstance(body:text, posterId: poster.id, posterClass: poster.class.name)
+ assert comment.save(flush:true)
def link = grailsApp.getDomainClass("org.grails.comments.CommentLink").clazz.newInstance(comment:comment, commentRef:instance.id, type:GrailsNameUtils.getPropertyName(instance.class))
- assert comment.save()
- assert link.save()
+ assert link.save(flush:true)
}
private void copyFile(File source, File destination) {
View
@@ -9,7 +9,7 @@
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;runtimeClasspathEntry containerPath=&quot;org.eclipse.jdt.launching.JRE_CONTAINER&quot; javaProject=&quot;site&quot; path=&quot;1&quot; type=&quot;4&quot;/&gt;&#10;"/>
-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;runtimeClasspathEntry containerPath=&quot;GRAILS_HOME/dist/grails-bootstrap-1.1-SNAPSHOT.jar&quot; path=&quot;3&quot; type=&quot;3&quot;/&gt;&#10;"/>
+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;runtimeClasspathEntry containerPath=&quot;GRAILS_HOME/dist/grails-bootstrap-1.1.jar&quot; path=&quot;3&quot; type=&quot;3&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;runtimeClasspathEntry containerPath=&quot;GRAILS_HOME/lib/groovy-all-1.6.0.jar&quot; path=&quot;3&quot; type=&quot;3&quot;/&gt;&#10;"/>
</listAttribute>
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
View
@@ -51,7 +51,6 @@
<sourceFolder url="file://$MODULE_DIR$/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../test/integration" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/../test/unit" isTestSource="true" />
- <excludeFolder url="file://$MODULE_DIR$/../plugins/commentable-0.2/grails-app/views/test" />
<excludeFolder url="file://$MODULE_DIR$/../web-app/js/prototype" />
<excludeFolder url="file://$MODULE_DIR$/../web-app/js/yui" />
<excludeFolder url="file://$MODULE_DIR$/../web-app/js/yui-cms" />
@@ -60,6 +59,7 @@
<orderEntry type="library" name="grails-1.1-SNAPSHOT" level="application" />
<orderEntry type="library" name="grails-1.1-SNAPSHOT" level="application" />
<orderEntry type="library" name="groovy-1.6-beta-2" level="application" />
+ <orderEntry type="library" name="grails-1.1" level="application" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library">

0 comments on commit a5435f6

Please sign in to comment.