roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gma...@apache.org
Subject svn commit: r1545976 - in /roller/trunk/app/src/main: java/org/apache/roller/weblogger/pojos/WeblogEntry.java resources/org/apache/roller/weblogger/config/roller.properties
Date Wed, 27 Nov 2013 09:36:25 GMT
Author: gmazza
Date: Wed Nov 27 09:36:25 2013
New Revision: 1545976

URL: http://svn.apache.org/r1545976
Log:
ROL-1978 switch blog entry titles to using hyphens instead of underscores as word separators,
new weblogentry.title.userUnderscoreSeparator Roller property to override.

Modified:
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntry.java
    roller/trunk/app/src/main/resources/org/apache/roller/weblogger/config/roller.properties

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntry.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntry.java?rev=1545976&r1=1545975&r2=1545976&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntry.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntry.java Wed
Nov 27 09:36:25 2013
@@ -50,6 +50,7 @@ import org.apache.roller.weblogger.busin
 import org.apache.roller.weblogger.business.WeblogEntryManager;
 import org.apache.roller.weblogger.business.WebloggerFactory;
 import org.apache.roller.weblogger.business.plugins.entry.WeblogEntryPlugin;
+import org.apache.roller.weblogger.config.WebloggerConfig;
 import org.apache.roller.weblogger.config.WebloggerRuntimeConfig;
 import org.apache.roller.weblogger.util.HTMLSanitizer;
 import org.apache.roller.weblogger.util.I18nMessages;
@@ -70,7 +71,10 @@ public class WeblogEntry implements Seri
     public static final String PUBLISHED = "PUBLISHED";
     public static final String PENDING   = "PENDING";
     public static final String SCHEDULED = "SCHEDULED";
-    
+
+    private static final char TITLE_SEPARATOR =
+        WebloggerConfig.getBooleanProperty("weblogentry.title.useUnderscoreSeparator") ?
'_' : '-';
+
     // Simple properies
     private String    id            = UUIDGenerator.generateUUID();
     private String    title         = null;
@@ -84,7 +88,7 @@ public class WeblogEntry implements Seri
     private Timestamp updateTime    = null;
     private String    plugins       = null;
     private Boolean   allowComments = Boolean.TRUE;
-    private Integer   commentDays   = new Integer(7);
+    private Integer   commentDays   = 7;
     private Boolean   rightToLeft   = Boolean.FALSE;
     private Boolean   pinnedToMain  = Boolean.FALSE;
     private String    status        = DRAFT;
@@ -880,7 +884,7 @@ public class WeblogEntry implements Seri
             while (toker.hasMoreTokens() && count < 5) {
                 String s = toker.nextToken();
                 s = s.toLowerCase();
-                tmp = (tmp == null) ? s : tmp + "_" + s;
+                tmp = (tmp == null) ? s : tmp + TITLE_SEPARATOR + s;
                 count++;
             }
             base = tmp;

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=1545976&r1=1545975&r2=1545976&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
Wed Nov 27 09:36:25 2013
@@ -680,6 +680,12 @@ username.allowedChars=A-Za-z0-9
 # weblog entry editor
 weblogentry.editor.showFullPermalink=true
 
+# Starting with Roller 5.1 SEO-friendlier hyphens instead
+# of underscores used by default to separate words in blog
+# URLs.  Set to true below to use pre-5.1 default of
+# underscores instead.
+weblogentry.title.useUnderscoreSeparator=false
+
 # editor theme to be used (corresponds to directory name under /theme)
 editor.theme=tan
 



Mime
View raw message