You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by gm...@apache.org on 2013/06/08 04:01:49 UTC
svn commit: r1490900 - in /roller/trunk: pom.xml
weblogger-business/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogEntryManagerImpl.java
weblogger-business/src/main/resources/org/apache/roller/weblogger/config/roller.properties
Author: gmazza
Date: Sat Jun 8 02:01:49 2013
New Revision: 1490900
URL: http://svn.apache.org/r1490900
Log:
fix for ROL-1778 preview not working on Derby for unpublished articles, tested on MySQL and Derby.
Modified:
roller/trunk/pom.xml
roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogEntryManagerImpl.java
roller/trunk/weblogger-business/src/main/resources/org/apache/roller/weblogger/config/roller.properties
Modified: roller/trunk/pom.xml
URL: http://svn.apache.org/viewvc/roller/trunk/pom.xml?rev=1490900&r1=1490899&r2=1490900&view=diff
==============================================================================
--- roller/trunk/pom.xml (original)
+++ roller/trunk/pom.xml Sat Jun 8 02:01:49 2013
@@ -156,7 +156,7 @@
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
- <version>1.1.1</version>
+ <version>1.1.3</version>
<scope>compile</scope>
</dependency>
Modified: roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogEntryManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogEntryManagerImpl.java?rev=1490900&r1=1490899&r2=1490900&view=diff
==============================================================================
--- roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogEntryManagerImpl.java (original)
+++ roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogEntryManagerImpl.java Sat Jun 8 02:01:49 2013
@@ -414,6 +414,11 @@ public class JPAWeblogEntryManagerImpl i
return Collections.emptyList();
}
+ // no next entry if WeblogEntry not yet published (draft view)
+ if (next && (current.getPubTime() == null)) {
+ return Collections.emptyList();
+ }
+
Query query = null;
List results = null;
WeblogCategory category = null;
@@ -439,8 +444,11 @@ public class JPAWeblogEntryManagerImpl i
params.add(size++, current.getPubTime());
whereClause.append(" AND e.pubTime > ?" + size);
} else {
- params.add(size++, current.getPubTime());
- whereClause.append(" AND e.pubTime < ?" + size);
+ // pub time null if current article not yet published, in Draft view
+ if (current.getPubTime() != null) {
+ params.add(size++, current.getPubTime());
+ whereClause.append(" AND e.pubTime < ?" + size);
+ }
}
if (catName != null && !catName.trim().equals("/")) {
Modified: roller/trunk/weblogger-business/src/main/resources/org/apache/roller/weblogger/config/roller.properties
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-business/src/main/resources/org/apache/roller/weblogger/config/roller.properties?rev=1490900&r1=1490899&r2=1490900&view=diff
==============================================================================
--- roller/trunk/weblogger-business/src/main/resources/org/apache/roller/weblogger/config/roller.properties (original)
+++ roller/trunk/weblogger-business/src/main/resources/org/apache/roller/weblogger/config/roller.properties Sat Jun 8 02:01:49 2013
@@ -1,5 +1,5 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. The ASF licenses this file to You
+# contributor license agreements. The ASF licenses this file to You
# under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License.
# You may obtain a copy of the License at
@@ -687,6 +687,8 @@ log4j.logger.com.danga.MemCached=ERROR
# Ask OpenJPA to log to Log4J via Apache Commons Logging
openjpa.Log=commons
+# OpenJPA logger categories
+# see http://openjpa.apache.org/builds/2.2.2/apache-openjpa/docs/manual.html#ref_guide_logging
log4j.logger.openjpa.Tool=ERROR
log4j.logger.openjpa.Runtime=ERROR
log4j.logger.openjpa.Remote=ERROR
@@ -694,7 +696,8 @@ log4j.logger.openjpa.DataCache=ERROR
log4j.logger.openjpa.MetaData=ERROR
log4j.logger.openjpa.Enhance=ERROR
log4j.logger.openjpa.Query=ERROR
-log4j.logger.openjpa.jdbc.SQL=ERROR
+log4j.logger.openjpa.SQL=ERROR
+log4j.logger.openjpa.SQLDiag=ERROR
log4j.logger.openjpa.jdbc.JDBC=ERROR
log4j.logger.openjpa.jdbc.Schema=ERROR