roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ko...@apache.org
Subject svn commit: r1680531 - in /roller/trunk: ./ app/ app/src/main/java/org/apache/roller/weblogger/business/ app/src/main/java/org/apache/roller/weblogger/business/jpa/ app/src/main/java/org/apache/roller/weblogger/business/startup/ app/src/main/java/org/a...
Date Wed, 20 May 2015 11:37:08 GMT
Author: kohei
Date: Wed May 20 11:37:08 2015
New Revision: 1680531

URL: http://svn.apache.org/r1680531
Log:
ROL-2063 NextLink appears in latest entry of permalink, Update Roller to 5.2.0-SNAPSHOT

Added:
    roller/trunk/app/src/main/resources/sql/510-to-520-migration.vm
Modified:
    roller/trunk/app/pom.xml
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/WeblogEntryManager.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogEntryManagerImpl.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/startup/DatabaseInstaller.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryEdit.java
    roller/trunk/app/src/main/resources/sql/dbscripts.properties
    roller/trunk/app/src/main/resources/sql/macros.vm
    roller/trunk/app/src/main/resources/sql/mysql.properties
    roller/trunk/app/src/main/resources/sql/oracle.properties
    roller/trunk/app/src/main/resources/sql/postgresql.properties
    roller/trunk/assembly-release/pom.xml
    roller/trunk/assembly-release/sign-release.sh
    roller/trunk/it-selenium/pom.xml
    roller/trunk/pom.xml

Modified: roller/trunk/app/pom.xml
URL: http://svn.apache.org/viewvc/roller/trunk/app/pom.xml?rev=1680531&r1=1680530&r2=1680531&view=diff
==============================================================================
--- roller/trunk/app/pom.xml (original)
+++ roller/trunk/app/pom.xml Wed May 20 11:37:08 2015
@@ -7,7 +7,7 @@
     <parent>
         <groupId>org.apache.roller</groupId>
         <artifactId>roller-project</artifactId>
-        <version>5.1.2</version>
+        <version>5.2.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/WeblogEntryManager.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/WeblogEntryManager.java?rev=1680531&r1=1680530&r2=1680531&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/WeblogEntryManager.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/WeblogEntryManager.java
Wed May 20 11:37:08 2015
@@ -398,10 +398,5 @@ public interface WeblogEntryManager {
      */    
     long getEntryCount(Weblog websiteData) throws WebloggerException;
 
-    /**
-     * Evict an entry from cache
-     */
-    void evict(WeblogEntry entry) throws WebloggerException;
-    
 }
 

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogEntryManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogEntryManagerImpl.java?rev=1680531&r1=1680530&r2=1680531&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogEntryManagerImpl.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogEntryManagerImpl.java
Wed May 20 11:37:08 2015
@@ -1353,14 +1353,6 @@ public class JPAWeblogEntryManagerImpl i
     }
 
     /**
-     * @inheritDoc
-     */
-    @Override
-    public void evict(WeblogEntry entry) throws WebloggerException {
-        strategy.getEntityManager(false).getEntityManagerFactory().getCache().evict(WeblogEntry.class,
entry.getId());
-    }
-
-    /**
      * Appends given expression to given whereClause. If whereClause already
      * has other conditions, an " AND " is also appended before appending
      * the expression

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/startup/DatabaseInstaller.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/startup/DatabaseInstaller.java?rev=1680531&r1=1680530&r2=1680531&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/startup/DatabaseInstaller.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/startup/DatabaseInstaller.java
Wed May 20 11:37:08 2015
@@ -242,6 +242,10 @@ public class DatabaseInstaller {
                 upgradeTo510(con, runScripts);
                 dbversion = 510;
             }
+            if(dbversion < 520) {
+                upgradeTo520(con, runScripts);
+                dbversion = 520;
+            }
             
             // make sure the database version is the exact version
             // we are upgrading too.
@@ -754,7 +758,34 @@ public class DatabaseInstaller {
             throw new StartupException("Problem upgrading database to version 510", ex);
         }        
 	}
-    
+
+    /**
+     * Upgrade database to Roller 5.2
+     */
+    private void upgradeTo520(Connection con, boolean runScripts) throws StartupException
{
+
+        // first we need to run upgrade scripts
+        SQLScriptRunner runner = null;
+        try {
+            if (runScripts) {
+                String handle = getDatabaseHandle(con);
+                String scriptPath = handle + "/510-to-520-migration.sql";
+                successMessage("Running database upgrade script: "+scriptPath);
+                runner = new SQLScriptRunner(scripts.getDatabaseScript(scriptPath));
+                runner.runScript(con, true);
+                messages.addAll(runner.getMessages());
+            }
+        } catch(Exception ex) {
+            log.error("ERROR running 520 database upgrade script", ex);
+            if (runner != null) {
+                messages.addAll(runner.getMessages());
+            }
+
+            errorMessage("Problem upgrading database to version 520", ex);
+            throw new StartupException("Problem upgrading database to version 520", ex);
+        }
+    }
+
     /**
      * Use database product name to get the database script directory name.
      */

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryEdit.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryEdit.java?rev=1680531&r1=1680530&r2=1680531&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryEdit.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryEdit.java
Wed May 20 11:37:08 2015
@@ -264,10 +264,6 @@ public final class EntryEdit extends UIA
                 weblogEntryManager.saveWeblogEntry(weblogEntry);
                 WebloggerFactory.getWeblogger().flush();
 
-                // necessary to work around timestamp resolution issue in some databases
-                // see also https://issues.apache.org/jira/browse/ROL-2063
-                weblogEntryManager.evict(weblogEntry);
-
                 // notify search of the new entry
                 if (weblogEntry.isPublished()) {
                     indexMgr.addEntryReIndexOperation(entry);

Added: roller/trunk/app/src/main/resources/sql/510-to-520-migration.vm
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/resources/sql/510-to-520-migration.vm?rev=1680531&view=auto
==============================================================================
--- roller/trunk/app/src/main/resources/sql/510-to-520-migration.vm (added)
+++ roller/trunk/app/src/main/resources/sql/510-to-520-migration.vm Wed May 20 11:37:08 2015
@@ -0,0 +1,54 @@
+#**
+ 510-to-520-migration.vm: Velocity template that generates vendor-specific database scripts
+
+ DON'T RUN THIS, IT'S NOT A DATABASE CREATION SCRIPT!!!
+ **#
+
+#**
+ PostgreSQL respects original not null attribute.
+ **#
+#macro(expandTimestamp $tableName $columnName)
+#if($db.DBTYPE == "MYSQL")
+#alterColumnType($tableName $columnName 'datetime(3)')
+#elseif ($db.DBTYPE == "ORACLE")
+#alterColumnType($tableName $columnName 'timestamp(3)')
+#elseif ($db.DBTYPE == "POSTGRESQL")
+#alterColumnType($tableName $columnName 'timestamp(3) with time zone')
+#end
+#end
+
+#macro(expandTimestampNotNull $tableName $columnName)
+#if($db.DBTYPE == "MYSQL")
+#alterColumnType($tableName $columnName 'datetime(3) not null')
+#elseif ($db.DBTYPE == "ORACLE")
+#alterColumnType($tableName $columnName 'timestamp(3) not null')
+#elseif ($db.DBTYPE == "POSTGRESQL")
+#alterColumnType($tableName $columnName 'timestamp(3) with time zone')
+#end
+#end
+
+-- Expanding datetime or timestamp columns
+-- Affects only for MySQL, Oracle, PostgreSQL
+
+#expandTimestampNotNull('pingqueueentry' 'entrytime')
+#expandTimestamp('pingtarget' 'lastsuccess')
+#expandTimestampNotNull('rag_entry' 'published')
+#expandTimestamp('rag_entry' 'updated')
+#expandTimestamp('rag_subscription' 'last_updated')
+#expandTimestamp('roller_audit_log' 'change_time')
+#expandTimestampNotNull('roller_comment' 'posttime')
+#expandTimestampNotNull('roller_mediafile' 'date_uploaded')
+#expandTimestamp('roller_mediafile' 'last_updated')
+#expandTimestampNotNull('roller_oauthaccessor' 'created')
+#expandTimestampNotNull('roller_oauthaccessor' 'updated')
+#expandTimestampNotNull('roller_permission' 'datecreated')
+#expandTimestamp('roller_tasklock' 'timeacquired')
+#expandTimestamp('roller_tasklock' 'lastrun')
+#expandTimestampNotNull('roller_user' 'datecreated')
+#expandTimestampNotNull('roller_weblogentrytag' 'time')
+#expandTimestampNotNull('roller_weblogentrytagagg' 'lastused')
+#expandTimestampNotNull('weblog' 'datecreated')
+#expandTimestamp('weblog' 'lastmodified')
+#expandTimestampNotNull('weblog_custom_template' 'updatetime')
+#expandTimestamp('weblogentry' 'pubtime')
+#expandTimestampNotNull('weblogentry' 'updatetime')

Modified: roller/trunk/app/src/main/resources/sql/dbscripts.properties
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/resources/sql/dbscripts.properties?rev=1680531&r1=1680530&r2=1680531&view=diff
==============================================================================
--- roller/trunk/app/src/main/resources/sql/dbscripts.properties (original)
+++ roller/trunk/app/src/main/resources/sql/dbscripts.properties Wed May 20 11:37:08 2015
@@ -6,4 +6,4 @@ databases=db2 derby hsqldb mssql mysql o
 
 # list all db templates to generate, separated by spaces
 templates=createdb 310-to-400-migration 400-to-500-migration  \
-500-to-510-migration
+500-to-510-migration 510-to-520-migration

Modified: roller/trunk/app/src/main/resources/sql/macros.vm
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/resources/sql/macros.vm?rev=1680531&r1=1680530&r2=1680531&view=diff
==============================================================================
--- roller/trunk/app/src/main/resources/sql/macros.vm (original)
+++ roller/trunk/app/src/main/resources/sql/macros.vm Wed May 20 11:37:08 2015
@@ -146,3 +146,14 @@ drop table if exists $tableName;
 	concat($s1, $s2) 
 #end 
 #end
+
+
+#macro(alterColumnType $tableName $columnName $columnType)
+#if($db.DBTYPE == "MYSQL" || $db.DBTYPE == "ORACLE")
+alter table $tableName modify $columnName $columnType;
+#elseif ($db.DBTYPE == "POSTGRESQL")
+alter table $tableName alter column $columnName type $columnType;
+#else
+-- You should alter type of column $columnName of table $tableName to $columnType
+#end
+#end
\ No newline at end of file

Modified: roller/trunk/app/src/main/resources/sql/mysql.properties
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/resources/sql/mysql.properties?rev=1680531&r1=1680530&r2=1680531&view=diff
==============================================================================
--- roller/trunk/app/src/main/resources/sql/mysql.properties (original)
+++ roller/trunk/app/src/main/resources/sql/mysql.properties Wed May 20 11:37:08 2015
@@ -24,5 +24,5 @@ BOOLEAN_TRUE=1
 INDEXSIZE=(40)
 INDEXSIZE_LARGE=(100)
 ADDL_FK_PARAMS=    
-TIMESTAMP_SQL_TYPE_NULL=datetime NULL
-TIMESTAMP_SQL_TYPE=datetime
+TIMESTAMP_SQL_TYPE_NULL=datetime(3) NULL
+TIMESTAMP_SQL_TYPE=datetime(3)

Modified: roller/trunk/app/src/main/resources/sql/oracle.properties
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/resources/sql/oracle.properties?rev=1680531&r1=1680530&r2=1680531&view=diff
==============================================================================
--- roller/trunk/app/src/main/resources/sql/oracle.properties (original)
+++ roller/trunk/app/src/main/resources/sql/oracle.properties Wed May 20 11:37:08 2015
@@ -24,5 +24,5 @@ BOOLEAN_TRUE=1
 INDEXSIZE=
 INDEXSIZE_LARGE=
 ADDL_FK_PARAMS=
-TIMESTAMP_SQL_TYPE_NULL=timestamp(2) null
-TIMESTAMP_SQL_TYPE=timestamp(2)
+TIMESTAMP_SQL_TYPE_NULL=timestamp(3) null
+TIMESTAMP_SQL_TYPE=timestamp(3)

Modified: roller/trunk/app/src/main/resources/sql/postgresql.properties
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/resources/sql/postgresql.properties?rev=1680531&r1=1680530&r2=1680531&view=diff
==============================================================================
--- roller/trunk/app/src/main/resources/sql/postgresql.properties (original)
+++ roller/trunk/app/src/main/resources/sql/postgresql.properties Wed May 20 11:37:08 2015
@@ -24,5 +24,5 @@ BOOLEAN_TRUE=true
 INDEXSIZE=
 INDEXSIZE_LARGE=
 ADDL_FK_PARAMS=
-TIMESTAMP_SQL_TYPE_NULL=timestamp(2) with time zone null
-TIMESTAMP_SQL_TYPE=timestamp(2) with time zone
+TIMESTAMP_SQL_TYPE_NULL=timestamp(3) with time zone null
+TIMESTAMP_SQL_TYPE=timestamp(3) with time zone

Modified: roller/trunk/assembly-release/pom.xml
URL: http://svn.apache.org/viewvc/roller/trunk/assembly-release/pom.xml?rev=1680531&r1=1680530&r2=1680531&view=diff
==============================================================================
--- roller/trunk/assembly-release/pom.xml (original)
+++ roller/trunk/assembly-release/pom.xml Wed May 20 11:37:08 2015
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.roller</groupId>
         <artifactId>roller-project</artifactId>
-        <version>5.1.2</version>
+        <version>5.2.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

Modified: roller/trunk/assembly-release/sign-release.sh
URL: http://svn.apache.org/viewvc/roller/trunk/assembly-release/sign-release.sh?rev=1680531&r1=1680530&r2=1680531&view=diff
==============================================================================
--- roller/trunk/assembly-release/sign-release.sh (original)
+++ roller/trunk/assembly-release/sign-release.sh Wed May 20 11:37:08 2015
@@ -1,5 +1,5 @@
 export rcstring=""
-export vstring="5.1.2"
+export vstring="5.2.0"
 
 gpg --armor --detach-sig target/roller-release-${vstring}${rcstring}-standard.tar.gz
 gpg --armor --detach-sig target/roller-release-${vstring}${rcstring}-standard.zip

Modified: roller/trunk/it-selenium/pom.xml
URL: http://svn.apache.org/viewvc/roller/trunk/it-selenium/pom.xml?rev=1680531&r1=1680530&r2=1680531&view=diff
==============================================================================
--- roller/trunk/it-selenium/pom.xml (original)
+++ roller/trunk/it-selenium/pom.xml Wed May 20 11:37:08 2015
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.roller</groupId>
         <artifactId>roller-project</artifactId>
-        <version>5.1.2</version>
+        <version>5.2.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

Modified: roller/trunk/pom.xml
URL: http://svn.apache.org/viewvc/roller/trunk/pom.xml?rev=1680531&r1=1680530&r2=1680531&view=diff
==============================================================================
--- roller/trunk/pom.xml (original)
+++ roller/trunk/pom.xml Wed May 20 11:37:08 2015
@@ -5,7 +5,7 @@
     <modelVersion>4.0.0</modelVersion>
     <groupId>org.apache.roller</groupId>
     <artifactId>roller-project</artifactId>
-    <version>5.1.2</version>
+    <version>5.2.0-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <prerequisites>
@@ -30,7 +30,7 @@
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
         <derby.version>10.11.1.1</derby.version>
-        <roller.version>5.1.2</roller.version>
+        <roller.version>5.2.0-SNAPSHOT</roller.version>
     </properties>
 
     <modules>



Mime
View raw message