roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ghu...@apache.org
Subject svn commit: r1513378 - in /roller/trunk/app/src/main: java/org/apache/roller/weblogger/ui/rendering/velocity/RollerVelocity.java resources/org/apache/roller/weblogger/config/roller.properties webapp/WEB-INF/velocity.properties
Date Tue, 13 Aug 2013 07:19:12 GMT
Author: ghuber
Date: Tue Aug 13 07:19:12 2013
New Revision: 1513378

URL: http://svn.apache.org/r1513378
Log:
Include velocity.properties changes for theme reloading via roller.properties themes.reload.mode
setting.

Modified:
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/velocity/RollerVelocity.java
    roller/trunk/app/src/main/resources/org/apache/roller/weblogger/config/roller.properties
    roller/trunk/app/src/main/webapp/WEB-INF/velocity.properties

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/velocity/RollerVelocity.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/velocity/RollerVelocity.java?rev=1513378&r1=1513377&r2=1513378&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/velocity/RollerVelocity.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/velocity/RollerVelocity.java
Tue Aug 13 07:19:12 2013
@@ -20,8 +20,10 @@ package org.apache.roller.weblogger.ui.r
 
 import java.io.InputStream;
 import java.util.Properties;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.roller.weblogger.config.WebloggerConfig;
 import org.apache.roller.weblogger.ui.core.RollerContext;
 import org.apache.roller.weblogger.ui.rendering.mobile.MobileDeviceRepository;
 import org.apache.velocity.Template;
@@ -56,6 +58,17 @@ public class RollerVelocity {
                     RollerContext.getServletContext().getResourceAsStream(VELOCITY_CONFIG);
             
             velocityProps.load(instream);
+            
+            // Development theme reloading
+            Boolean themeReload = WebloggerConfig.getBooleanProperty("themes.reload.mode");
+            
+            // Override for theme reloading
+            if (themeReload) {
+                velocityProps.setProperty("class.resource.loader.cache", "false");
+                velocityProps.setProperty("webapp.resource.loader.cache", "false");
+                velocityProps.setProperty("webapp.resource.loader.modificationCheckInterval",
"2");
+                velocityProps.setProperty("velocimacro.library.autoreload", "true");
+            }
            
             log.debug("Velocity engine props = "+velocityProps);
             

Modified: roller/trunk/app/src/main/resources/org/apache/roller/weblogger/config/roller.properties
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/resources/org/apache/roller/weblogger/config/roller.properties?rev=1513378&r1=1513377&r2=1513378&view=diff
==============================================================================
--- roller/trunk/app/src/main/resources/org/apache/roller/weblogger/config/roller.properties
(original)
+++ roller/trunk/app/src/main/resources/org/apache/roller/weblogger/config/roller.properties
Tue Aug 13 07:19:12 2013
@@ -127,8 +127,10 @@ search.index.dir=${user.home}/roller_dat
 themes.dir=${webapp.context}
 
 # Allow theme reloading during development
-# NB remember also to always delete the style-sheet from the weblog you're using
-# See also velocity.properties for reloading macros in /WEB-INF/velocity... 
+# 1. You must be logged in.
+# 2. Delete the style-sheet (Design | Style Sheet tab) from the weblog/theme you're changing.
+# 3. To reload macros under path /WEB-INF/velocity, first modify the macro file and then
trigger 
+#    the reload by changing a template on the theme currently working on, then refresh the
page.
 themes.reload.mode=false
 
 #-----------------------------------------------------------------------------

Modified: roller/trunk/app/src/main/webapp/WEB-INF/velocity.properties
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/WEB-INF/velocity.properties?rev=1513378&r1=1513377&r2=1513378&view=diff
==============================================================================
--- roller/trunk/app/src/main/webapp/WEB-INF/velocity.properties (original)
+++ roller/trunk/app/src/main/webapp/WEB-INF/velocity.properties Tue Aug 13 07:19:12 2013
@@ -22,14 +22,14 @@ theme.resource.loader.public.name=theme
 theme.resource.loader.description=Roller Theme Resource Loader
 theme.resource.loader.class=org.apache.roller.weblogger.ui.rendering.velocity.ThemeResourceLoader
 theme.resource.loader.cache=false
-theme.resource.loader.modificationCheckInterval=2
+theme.resource.loader.modificationCheckInterval=60
 
 # for the loader we call 'roller', use the RollerResourceLoader
 roller.resource.loader.public.name=roller
 roller.resource.loader.description=Roller Main Resource Loader
 roller.resource.loader.class=org.apache.roller.weblogger.ui.rendering.velocity.RollerResourceLoader
 roller.resource.loader.cache=false
-roller.resource.loader.modificationCheckInterval=2
+roller.resource.loader.modificationCheckInterval=60
 
 # for the loader we call 'class', use the ClasspathResourceLoader
 class.resource.loader.description = Velocity Classpath Resource Loader
@@ -41,10 +41,8 @@ class.resource.loader.modificationCheckI
 webapp.resource.loader.description=Webapp Resource Loader
 webapp.resource.loader.class=org.apache.roller.weblogger.ui.rendering.velocity.WebappResourceLoader
 webapp.resource.loader.cache=true
-#webapp.resource.loader.cache=false
 webapp.resource.loader.path=/WEB-INF/velocity,/WEB-INF/velocity/templates,/WEB-INF/velocity/templates/feeds,templates/weblog,templates/planet
 webapp.resource.loader.modificationCheckInterval=60
-#webapp.resource.loader.modificationCheckInterval=2
 
 # log invalid template references?
 # set this to false to have a quieter velocity.log
@@ -57,14 +55,8 @@ runtime.log.logsystem.log4j.category=org
 # Override the default global library, set to blank to load no default
 velocimacro.library = weblog.vm,feeds.vm,roller-custom.vm
 
-# To reload via WebappResourceLoader change above: cache=false and modificationCheckInterval=2
-# and then below autoreload=true.  The trigger is via the theme reloading property themes.reload.mode=true
-# ie change required file (under path /WEB-INF/velocity), then a template on the theme currently
working on 
-# and refresh.
-# Change to false for deployment environments.
-# Caching for the 'class' & 'webapp' ResourceLoaders must be false for this to work
+# See RollerVelocity for reloading "webapp.resource.loader.path" files via WebappResourceLoader
settings
 velocimacro.library.autoreload=false
-#velocimacro.library.autoreload=true
 
 # Allow Velocimacros to be defined in regular templates
 velocimacro.permissions.allow.inline=true



Mime
View raw message