roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gma...@apache.org
Subject svn commit: r1622082 - in /roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/velocity: ThemeResourceLoader.java VelocityRenderer.java
Date Tue, 02 Sep 2014 18:30:36 GMT
Author: gmazza
Date: Tue Sep  2 18:30:36 2014
New Revision: 1622082

URL: http://svn.apache.org/r1622082
Log:
ROL-2051 revert to standard rendition where mobile not defined.

Modified:
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/velocity/ThemeResourceLoader.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/velocity/VelocityRenderer.java

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/velocity/ThemeResourceLoader.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/velocity/ThemeResourceLoader.java?rev=1622082&r1=1622081&r2=1622082&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/velocity/ThemeResourceLoader.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/velocity/ThemeResourceLoader.java
Tue Sep  2 18:30:36 2014
@@ -30,6 +30,7 @@ import org.apache.commons.collections.Ex
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.roller.weblogger.pojos.TemplateRendition;
+import org.apache.roller.weblogger.pojos.TemplateRendition.RenditionType;
 import org.apache.velocity.exception.ResourceNotFoundException;
 import org.apache.velocity.runtime.resource.Resource;
 import org.apache.velocity.runtime.resource.loader.ResourceLoader;
@@ -69,11 +70,11 @@ public class ThemeResourceLoader extends
                     "Need to specify a template name!");
         }
 
-        TemplateRendition.RenditionType renditionType = TemplateRendition.RenditionType.STANDARD;
+        RenditionType renditionType = RenditionType.STANDARD;
         if (name.contains("|")) {
             String[] pair = name.split("\\|");
             name = pair[0];
-            renditionType = TemplateRendition.RenditionType.valueOf(pair[1].toUpperCase());
+            renditionType = RenditionType.valueOf(pair[1].toUpperCase());
         }
 
         try {
@@ -98,8 +99,13 @@ public class ThemeResourceLoader extends
             }
 
             final String contents;
+
             if (template.getTemplateRendition(renditionType) != null) {
                 contents = template.getTemplateRendition(renditionType).getTemplate();
+            } else if (renditionType != RenditionType.STANDARD
+                    && template.getTemplateRendition(RenditionType.STANDARD) != null)
{
+                // fall back to standard rendition type if others not defined
+                contents = template.getTemplateRendition(RenditionType.STANDARD).getTemplate();
             } else {
                 throw new ResourceNotFoundException("Rendering [" + renditionType.name()
                         + "] of Template [" + split[1] + "] not found.");

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/velocity/VelocityRenderer.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/velocity/VelocityRenderer.java?rev=1622082&r1=1622081&r2=1622082&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/velocity/VelocityRenderer.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/rendering/velocity/VelocityRenderer.java
Tue Sep  2 18:30:36 2014
@@ -109,7 +109,7 @@ public class VelocityRenderer implements
         } catch (Exception ex) {
             // some kind of generic/unknown exception, dump it to the logs
             log.error(
-                    "Unknown exception creatting renderer for "
+                    "Unknown exception creating renderer for "
                             + template.getId(), ex);
 
             // throw if back to the caller



Mime
View raw message