roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r1588757 [8/25] - in /roller/branches/rome2/app/src: main/java/org/apache/roller/ main/java/org/apache/roller/planet/business/ main/java/org/apache/roller/planet/business/fetcher/ main/java/org/apache/roller/planet/business/jpa/ main/java/o...
Date Sun, 20 Apr 2014 13:39:01 GMT
Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogThemeTemplateCode.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogThemeTemplateCode.java?rev=1588757&r1=1588756&r2=1588757&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogThemeTemplateCode.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogThemeTemplateCode.java Sun Apr 20 13:38:51 2014
@@ -18,8 +18,8 @@
 
 package org.apache.roller.weblogger.pojos;
 
-import org.apache.commons.lang.builder.EqualsBuilder;
-import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
 import org.apache.roller.util.UUIDGenerator;
 
 import java.io.Serializable;

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogBookmarkFolderWrapper.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogBookmarkFolderWrapper.java?rev=1588757&r1=1588756&r2=1588757&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogBookmarkFolderWrapper.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogBookmarkFolderWrapper.java Sun Apr 20 13:38:51 2014
@@ -19,12 +19,7 @@
 package org.apache.roller.weblogger.pojos.wrapper;
 
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
-import java.util.Set;
-import java.util.TreeSet;
-import org.apache.roller.weblogger.WebloggerException;
-import org.apache.roller.weblogger.pojos.BookmarkComparator;
 import org.apache.roller.weblogger.pojos.WeblogBookmark;
 import org.apache.roller.weblogger.pojos.WeblogBookmarkFolder;
 
@@ -41,8 +36,7 @@ public final class WeblogBookmarkFolderW
     private WeblogBookmarkFolderWrapper(WeblogBookmarkFolder toWrap) {
         this.pojo = toWrap;
     }
-    
-    
+
     // wrap the given pojo if it is not null
     public static WeblogBookmarkFolderWrapper wrap(WeblogBookmarkFolder toWrap) {
         if (toWrap != null) {
@@ -50,90 +44,22 @@ public final class WeblogBookmarkFolderW
         }
         return null;
     }
-    
-    
+
     public String getId() {
         return this.pojo.getId();
     }
-    
-    
+
     public String getName() {
         return this.pojo.getName();
     }
-    
-    
-    public String getDescription() {
-        return this.pojo.getDescription();
-    }
-    
-    
-    public String getPath() {
-        return this.pojo.getPath();
-    }
-    
-    public WeblogBookmarkFolderWrapper getParent() {
-        return WeblogBookmarkFolderWrapper.wrap(this.pojo.getParent());
-    }
-    
-    public List getFolders() {
-        Set initialCollection = this.pojo.getFolders();
-        
-        // iterate through and wrap
-        // we force the use of an ArrayList because it should be good enough to cover
-        // for any Collection type we encounter.
-        List wrappedCollection = new ArrayList(initialCollection.size());
-        Iterator it = initialCollection.iterator();
-        int i = 0;
-        while(it.hasNext()) {
-            wrappedCollection.add(i,WeblogBookmarkFolderWrapper.wrap((WeblogBookmarkFolder) it.next()));
-            i++;
-        }
-        
-        return wrappedCollection;
-    }
-    
-        
-    public List getBookmarks() {
-        TreeSet initialCollection = new TreeSet(new BookmarkComparator());
-        initialCollection.addAll(this.pojo.getBookmarks());
-        
+
+    public List<WeblogBookmarkWrapper> getBookmarks() {
         // iterate through and wrap
-        // we force the use of an ArrayList because it should be good enough to cover
-        // for any Collection type we encounter.
-        ArrayList wrappedCollection = new ArrayList(initialCollection.size());
-        Iterator it = initialCollection.iterator();
-        int i = 0;
-        while(it.hasNext()) {
-            wrappedCollection.add(i,WeblogBookmarkWrapper.wrap((WeblogBookmark) it.next()));
-            i++;
+        List<WeblogBookmarkWrapper> wrappedCollection = new ArrayList<WeblogBookmarkWrapper>(this.pojo.getBookmarks().size());
+        for (WeblogBookmark bookmark : this.pojo.getBookmarks()) {
+            wrappedCollection.add(WeblogBookmarkWrapper.wrap(bookmark));
         }
-        
         return wrappedCollection;
     }    
-        
-    
-    public List retrieveBookmarks(boolean subfolders)
-            throws WebloggerException {
-        
-        List initialCollection = this.pojo.retrieveBookmarks(subfolders);
-        
-        // iterate through and wrap
-        // we force the use of an ArrayList because it should be good enough to cover
-        // for any Collection type we encounter.
-        ArrayList wrappedCollection = new ArrayList(initialCollection.size());
-        Iterator it = initialCollection.iterator();
-        int i = 0;
-        while(it.hasNext()) {
-            wrappedCollection.add(i,WeblogBookmarkWrapper.wrap((WeblogBookmark) it.next()));
-            i++;
-        }
-        
-        return wrappedCollection;
-    }
-    
-    // TODO: this method won't actually work and we probably don't need it here anyways?
-    public boolean descendentOf(WeblogBookmarkFolder ancestor) {
-        return this.pojo.descendentOf(ancestor);
-    }
-    
+
 }

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogBookmarkWrapper.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogBookmarkWrapper.java?rev=1588757&r1=1588756&r2=1588757&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogBookmarkWrapper.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogBookmarkWrapper.java Sun Apr 20 13:38:51 2014
@@ -33,8 +33,7 @@ public final class WeblogBookmarkWrapper
     private WeblogBookmarkWrapper(WeblogBookmark toWrap) {
         this.pojo = toWrap;
     }
-    
-    
+
     // wrap the given pojo if it is not null
     public static WeblogBookmarkWrapper wrap(WeblogBookmark toWrap) {
         if(toWrap != null) {
@@ -43,8 +42,7 @@ public final class WeblogBookmarkWrapper
         
         return null;
     }
-    
-    
+
     public String getId() {
         return this.pojo.getId();
     }
@@ -63,18 +61,11 @@ public final class WeblogBookmarkWrapper
     public String getUrl() {
         return this.pojo.getUrl();
     }
-    
-    
-    public Integer getWeight() {
-        return this.pojo.getWeight();
-    }
-    
-    
+
     public Integer getPriority() {
         return this.pojo.getPriority();
     }
-    
-    
+
     public String getImage() {
         return this.pojo.getImage();
     }

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogCategoryWrapper.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogCategoryWrapper.java?rev=1588757&r1=1588756&r2=1588757&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogCategoryWrapper.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogCategoryWrapper.java Sun Apr 20 13:38:51 2014
@@ -21,7 +21,6 @@ package org.apache.roller.weblogger.pojo
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Set;
 import org.apache.roller.weblogger.WebloggerException;
 import org.apache.roller.weblogger.business.URLStrategy;
 import org.apache.roller.weblogger.pojos.WeblogCategory;
@@ -75,45 +74,15 @@ public final class WeblogCategoryWrapper
     public String getImage() {
         return this.pojo.getImage();
     }
-    
-    
-    public String getPath() {
-        return this.pojo.getPath();
-    }
-    
-    
+
     public WeblogWrapper getWebsite() {
-        return WeblogWrapper.wrap(this.pojo.getWebsite(), urlStrategy);
-    }
-    
-    
-    public WeblogCategoryWrapper getParent() {
-        return WeblogCategoryWrapper.wrap(this.pojo.getParent(), urlStrategy);
-    }
-    
-    
-    public List getWeblogCategories() {
-        Set initialCollection = this.pojo.getWeblogCategories();
-        
-        // iterate through and wrap
-        // we force the use of an ArrayList because it should be good enough to cover
-        // for any Collection type we encounter.
-        ArrayList wrappedCollection = new ArrayList(initialCollection.size());
-        Iterator it = initialCollection.iterator();
-        int i = 0;
-        while(it.hasNext()) {
-            wrappedCollection.add(i,WeblogCategoryWrapper.wrap((WeblogCategory) it.next(), urlStrategy));
-            i++;
-        }
-        
-        return wrappedCollection;
+        return WeblogWrapper.wrap(this.pojo.getWeblog(), urlStrategy);
     }
-    
-    
-    public List retrieveWeblogEntries(boolean subcats)
+
+    public List retrieveWeblogEntries(boolean publishedOnly)
             throws WebloggerException {
         
-        List initialCollection = this.pojo.retrieveWeblogEntries(subcats);
+        List initialCollection = this.pojo.retrieveWeblogEntries(publishedOnly);
         
         // iterate through and wrap
         // we force the use of an ArrayList because it should be good enough to cover
@@ -130,12 +99,6 @@ public final class WeblogCategoryWrapper
     }
     
     
-    // TODO: this method doesn't work and propably doesn't need to be here anyways?
-    public boolean descendentOf(WeblogCategory ancestor) {
-        return this.pojo.descendentOf(ancestor);
-    }
-    
-    
     public boolean isInUse() {
         return this.pojo.isInUse();
     }

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryCommentWrapper.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryCommentWrapper.java?rev=1588757&r1=1588756&r2=1588757&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryCommentWrapper.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryCommentWrapper.java Sun Apr 20 13:38:51 2014
@@ -19,7 +19,7 @@
 package org.apache.roller.weblogger.pojos.wrapper;
 
 import java.sql.Timestamp;
-import org.apache.commons.lang.StringEscapeUtils;
+import org.apache.commons.lang3.StringEscapeUtils;
 import org.apache.roller.weblogger.business.URLStrategy;
 import org.apache.roller.weblogger.business.WebloggerFactory;
 import org.apache.roller.weblogger.business.plugins.PluginManager;
@@ -72,7 +72,7 @@ public final class WeblogEntryCommentWra
      * Value is always html escaped.
      */
     public String getName() {
-        return StringEscapeUtils.escapeHtml(this.pojo.getName());
+        return StringEscapeUtils.escapeHtml4(this.pojo.getName());
     }
     
     
@@ -82,7 +82,7 @@ public final class WeblogEntryCommentWra
      * Value is always html escaped.
      */
     public String getEmail() {
-        return StringEscapeUtils.escapeHtml(this.pojo.getEmail());
+        return StringEscapeUtils.escapeHtml4(this.pojo.getEmail());
     }
     
     
@@ -92,7 +92,7 @@ public final class WeblogEntryCommentWra
      * Value is always html escaped.
      */
     public String getUrl() {
-        return StringEscapeUtils.escapeHtml(this.pojo.getUrl());
+        return StringEscapeUtils.escapeHtml4(this.pojo.getUrl());
     }
     
     
@@ -108,7 +108,7 @@ public final class WeblogEntryCommentWra
         
         // escape content if content-type is text/plain
         if("text/plain".equals(this.pojo.getContentType())) {
-            content = StringEscapeUtils.escapeHtml(content);
+            content = StringEscapeUtils.escapeHtml4(content);
         }
         
         // apply plugins
@@ -151,7 +151,7 @@ public final class WeblogEntryCommentWra
      * Value is always html escaped.
      */
     public String getReferrer() {
-        return StringEscapeUtils.escapeHtml(this.pojo.getReferrer());
+        return StringEscapeUtils.escapeHtml4(this.pojo.getReferrer());
     }
     
     

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryWrapper.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryWrapper.java?rev=1588757&r1=1588756&r2=1588757&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryWrapper.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryWrapper.java Sun Apr 20 13:38:51 2014
@@ -39,7 +39,7 @@ import org.apache.roller.weblogger.util.
 /**
  * Pojo safety wrapper for WeblogEntry objects.
  */
-public class WeblogEntryWrapper {
+public final class WeblogEntryWrapper {
     
     // keep a reference to the wrapped pojo
     private final WeblogEntry pojo;

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogReferrerWrapper.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogReferrerWrapper.java?rev=1588757&r1=1588756&r2=1588757&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogReferrerWrapper.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogReferrerWrapper.java Sun Apr 20 13:38:51 2014
@@ -25,7 +25,7 @@ import org.apache.roller.weblogger.pojos
 /**
  * Pojo safety wrapper for WeblogReferrer object.
  */
-public class WeblogReferrerWrapper {
+public final class WeblogReferrerWrapper {
     
     // keep a reference to the wrapped pojo
     private final WeblogReferrer pojo;

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogWrapper.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogWrapper.java?rev=1588757&r1=1588756&r2=1588757&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogWrapper.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogWrapper.java Sun Apr 20 13:38:51 2014
@@ -18,7 +18,7 @@
 
 package org.apache.roller.weblogger.pojos.wrapper;
 
-import org.apache.commons.lang.StringEscapeUtils;
+import org.apache.commons.lang3.StringEscapeUtils;
 import org.apache.roller.weblogger.WebloggerException;
 import org.apache.roller.weblogger.business.URLStrategy;
 import org.apache.roller.weblogger.util.HTMLSanitizer;
@@ -80,22 +80,16 @@ public final class WeblogWrapper {
     }
     
     
-    public List getPages() throws WebloggerException {
-        
-        List initialCollection = this.pojo.getTheme().getTemplates();
-        
-        // iterate through and wrap
-        // we force the use of an ArrayList because it should be good enough to cover
-        // for any Collection type we encounter.
-        ArrayList wrappedCollection = new ArrayList(initialCollection.size());
-        Iterator it = initialCollection.iterator();
+    public List<ThemeTemplateWrapper> getPages() throws WebloggerException {
+        List<ThemeTemplate> unwrapped = this.pojo.getTheme().getTemplates();
+        List<ThemeTemplateWrapper> wrapped = new ArrayList<ThemeTemplateWrapper>(unwrapped.size());
+
         int i = 0;
-        while(it.hasNext()) {
-            wrappedCollection.add(i,ThemeTemplateWrapper.wrap((ThemeTemplate) it.next()));
+        for (ThemeTemplate template : unwrapped) {
+            wrapped.add(i,ThemeTemplateWrapper.wrap(template));
             i++;
         }
-        
-        return wrappedCollection;
+        return wrapped;
     }
     
     
@@ -110,7 +104,7 @@ public final class WeblogWrapper {
     
     
     public String getName() {
-        return StringEscapeUtils.escapeHtml(this.pojo.getName());
+        return StringEscapeUtils.escapeHtml4(this.pojo.getName());
     }
     
     
@@ -313,100 +307,61 @@ public final class WeblogWrapper {
     public WeblogEntryWrapper getWeblogEntry(String anchor) {
         return WeblogEntryWrapper.wrap(this.pojo.getWeblogEntry(anchor), urlStrategy);
     }
-    
-    
-    public List getWeblogCategories() {
-        Set initialCollection = this.pojo.getWeblogCategories();
-        
-        // iterate through and wrap
-        // we force the use of an ArrayList because it should be good enough to cover
-        // for any Collection type we encounter.
-        ArrayList wrappedCollection = new ArrayList(initialCollection.size());
-        Iterator it = initialCollection.iterator();
+
+
+    public List<WeblogCategoryWrapper> getWeblogCategories() {
+        List<WeblogCategory> unwrapped = this.pojo.getWeblogCategories();
+        List<WeblogCategoryWrapper> wrapped = new ArrayList<WeblogCategoryWrapper>(unwrapped.size());
+
         int i = 0;
-        while(it.hasNext()) {
-            wrappedCollection.add(i,WeblogCategoryWrapper.wrap((WeblogCategory) it.next(), urlStrategy));
+        for (WeblogCategory category : unwrapped) {
+            wrapped.add(i,WeblogCategoryWrapper.wrap(category, urlStrategy));
             i++;
         }
-        
-        return wrappedCollection;
+        return wrapped;
     }
-    
-    
-    public List getWeblogCategories(String categoryPath) {
-        Set initialCollection = this.pojo.getWeblogCategories(categoryPath);
-        
-        // iterate through and wrap
-        // we force the use of an ArrayList because it should be good enough to cover
-        // for any Collection type we encounter.
-        ArrayList wrappedCollection = new ArrayList(initialCollection.size());
-        Iterator it = initialCollection.iterator();
-        int i = 0;
-        while(it.hasNext()) {
-            wrappedCollection.add(i,WeblogCategoryWrapper.wrap((WeblogCategory) it.next(), urlStrategy));
-            i++;
-        }
-        
-        return wrappedCollection;
-    }
-    
-    
-    public WeblogCategoryWrapper getWeblogCategory(String categoryPath) {
-        return WeblogCategoryWrapper.wrap(this.pojo.getWeblogCategory(categoryPath), urlStrategy);
+
+    public WeblogCategoryWrapper getWeblogCategory(String categoryName) {
+        return WeblogCategoryWrapper.wrap(this.pojo.getWeblogCategory(categoryName), urlStrategy);
     }
+
     
-    
-    public List getRecentWeblogEntries(String cat,int length) {
-        List initialCollection = this.pojo.getRecentWeblogEntries(cat,length);
-        
-        // iterate through and wrap
-        // we force the use of an ArrayList because it should be good enough to cover
-        // for any Collection type we encounter.
-        ArrayList wrappedCollection = new ArrayList(initialCollection.size());
-        Iterator it = initialCollection.iterator();
+    public List<WeblogEntryWrapper> getRecentWeblogEntries(String cat,int length) {
+        List<WeblogEntry> unwrapped = this.pojo.getRecentWeblogEntries(cat, length);
+        List<WeblogEntryWrapper> wrapped = new ArrayList<WeblogEntryWrapper>(unwrapped.size());
+
         int i = 0;
-        while(it.hasNext()) {
-            wrappedCollection.add(i,WeblogEntryWrapper.wrap((WeblogEntry) it.next(), urlStrategy));
+        for (WeblogEntry we : unwrapped) {
+            wrapped.add(i,WeblogEntryWrapper.wrap(we, urlStrategy));
             i++;
         }
-        
-        return wrappedCollection;
+        return wrapped;
     }
     
     
-    public List getRecentWeblogEntriesByTag(String tag,int length) {
-        List initialCollection = this.pojo.getRecentWeblogEntriesByTag(tag,length);
-        
-        // iterate through and wrap
-        // we force the use of an ArrayList because it should be good enough to cover
-        // for any Collection type we encounter.
-        ArrayList wrappedCollection = new ArrayList(initialCollection.size());
-        Iterator it = initialCollection.iterator();
+    public List<WeblogEntryWrapper> getRecentWeblogEntriesByTag(String tag,int length) {
+        List<WeblogEntry> unwrapped = pojo.getRecentWeblogEntriesByTag(tag,length);
+        List<WeblogEntryWrapper> wrapped = new ArrayList<WeblogEntryWrapper>(unwrapped.size());
+
         int i = 0;
-        while(it.hasNext()) {
-            wrappedCollection.add(i,WeblogEntryWrapper.wrap((WeblogEntry) it.next(), urlStrategy));
+        for (WeblogEntry we : unwrapped) {
+            wrapped.add(i,WeblogEntryWrapper.wrap(we, urlStrategy));
             i++;
         }
-        
-        return wrappedCollection;
+        return wrapped;
     }
     
     
-    public List getRecentComments(int length) {
-        List initialCollection = this.pojo.getRecentComments(length);
-        
-        // iterate through and wrap
-        // we force the use of an ArrayList because it should be good enough to cover
-        // for any Collection type we encounter.
-        ArrayList wrappedCollection = new ArrayList(initialCollection.size());
-        Iterator it = initialCollection.iterator();
+    public List<WeblogEntryCommentWrapper> getRecentComments(int length) {
+        List<WeblogEntryComment> unwrapped = this.pojo.getRecentComments(length);
+        List<WeblogEntryCommentWrapper> wrapped = new ArrayList<WeblogEntryCommentWrapper>(unwrapped.size());
+
         int i = 0;
-        while(it.hasNext()) {
-            wrappedCollection.add(i,WeblogEntryCommentWrapper.wrap((WeblogEntryComment) it.next(), urlStrategy));
+        for (WeblogEntryComment wec : unwrapped) {
+            wrapped.add(i, WeblogEntryCommentWrapper.wrap(wec, urlStrategy));
             i++;
         }
-        
-        return wrappedCollection;
+        return wrapped;
     }
     
     
@@ -415,21 +370,15 @@ public final class WeblogWrapper {
     }
     
     
-    public List getTodaysReferrers() {
-        List initialCollection = this.pojo.getTodaysReferrers();
-        
-        // iterate through and wrap
-        // we force the use of an ArrayList because it should be good enough to cover
-        // for any Collection type we encounter.
-        ArrayList wrappedCollection = new ArrayList(initialCollection.size());
-        Iterator it = initialCollection.iterator();
+    public List<WeblogReferrerWrapper> getTodaysReferrers() {
+        List<WeblogReferrer> unwrapped = this.pojo.getTodaysReferrers();
+        List<WeblogReferrerWrapper> wrapped = new ArrayList<WeblogReferrerWrapper>(unwrapped.size());
         int i = 0;
-        while(it.hasNext()) {
-            wrappedCollection.add(i,WeblogReferrerWrapper.wrap((WeblogReferrer) it.next(), urlStrategy));
+        for (WeblogReferrer referrer : unwrapped) {
+            wrapped.add(i,WeblogReferrerWrapper.wrap(referrer, urlStrategy));
             i++;
         }
-        
-        return wrappedCollection;
+        return wrapped;
     }
     
     

Propchange: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/
------------------------------------------------------------------------------
  Merged /roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui:r1546818-1588713

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/CmaRollerContext.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/CmaRollerContext.java?rev=1588757&r1=1588756&r2=1588757&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/CmaRollerContext.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/CmaRollerContext.java Sun Apr 20 13:38:51 2014
@@ -19,8 +19,6 @@
 package org.apache.roller.weblogger.ui.core;
 
 import javax.servlet.ServletContext;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 
 
 /**
@@ -31,8 +29,6 @@ import org.apache.commons.logging.LogFac
  */
 public class CmaRollerContext extends RollerContext { 
     
-    private static Log log = LogFactory.getLog(CmaRollerContext.class);
-    
     public CmaRollerContext() {
         super();
     }

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/RollerContext.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/RollerContext.java?rev=1588757&r1=1588756&r2=1588757&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/RollerContext.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/RollerContext.java Sun Apr 20 13:38:51 2014
@@ -21,7 +21,6 @@ package org.apache.roller.weblogger.ui.c
 import java.io.File;
 import java.io.InputStream;
 import java.util.Properties;
-import java.util.Iterator;
 import javax.servlet.ServletContext;
 import javax.servlet.ServletContextEvent;
 import javax.servlet.ServletContextListener;
@@ -96,7 +95,7 @@ public class RollerContext extends Conte
         // First, initialize everything that requires no database
 
         // Keep a reference to ServletContext object
-        this.servletContext = sce.getServletContext();
+        RollerContext.servletContext = sce.getServletContext();
         
         // Call Spring's context ContextLoaderListener to initialize all the
         // context files specified in web.xml. This is necessary because
@@ -234,8 +233,7 @@ public class RollerContext extends Conte
         
         if (!rememberMeEnabled) {
             ProviderManager provider = (ProviderManager) ctx.getBean("_authenticationManager");
-            for (Iterator it = provider.getProviders().iterator(); it.hasNext();) {
-                AuthenticationProvider authProvider = (AuthenticationProvider) it.next();
+            for (AuthenticationProvider authProvider : provider.getProviders()) {
                 if (authProvider instanceof RememberMeAuthenticationProvider) {
                     provider.getProviders().remove(authProvider);
                 }
@@ -245,8 +243,11 @@ public class RollerContext extends Conte
         String encryptPasswords = WebloggerConfig.getProperty("passwds.encryption.enabled");
         boolean doEncrypt = Boolean.valueOf(encryptPasswords);
         
-        if (doEncrypt) {
-            DaoAuthenticationProvider provider = (DaoAuthenticationProvider) ctx.getBean("org.springframework.security.authentication.dao.DaoAuthenticationProvider#0");
+        String daoBeanName = "org.springframework.security.authentication.dao.DaoAuthenticationProvider#0";
+
+        // for LDAP-only authentication, no daoBeanName (i.e., UserDetailsService) may be provided in security.xml.
+        if (doEncrypt && ctx.containsBean(daoBeanName)) {
+            DaoAuthenticationProvider provider = (DaoAuthenticationProvider) ctx.getBean(daoBeanName);
             String algorithm = WebloggerConfig.getProperty("passwds.encryption.algorithm");
             PasswordEncoder encoder = null;
             if (algorithm.equalsIgnoreCase("SHA")) {
@@ -331,13 +332,9 @@ public class RollerContext extends Conte
             return null;
         }
         
-        if(null == clazz) {
-            return null;
-        }
-        
         Class[] interfaces = clazz.getInterfaces();
-        for (int i = 0; i < interfaces.length; i++) {
-            if (interfaces[i].equals(AutoProvision.class)) {
+        for (Class clazz2 : interfaces) {
+            if (clazz2.equals(AutoProvision.class)) {
                 try {
                     return (AutoProvision) clazz.newInstance();
                 } catch (InstantiationException e) {

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/RollerSession.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/RollerSession.java?rev=1588757&r1=1588756&r2=1588757&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/RollerSession.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/RollerSession.java Sun Apr 20 13:38:51 2014
@@ -103,7 +103,7 @@ public class RollerSession 
                         AutoProvision provisioner = RollerContext.getAutoProvision();
                         if(provisioner != null) {
                             boolean userProvisioned = provisioner.execute(request);
-                            if(userProvisioned) {
+                            if (userProvisioned) {
                                 // try lookup again real quick
                                 user = umgr.getUserByUserName(principal.getName());
                             }

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/CharEncodingFilter.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/CharEncodingFilter.java?rev=1588757&r1=1588756&r2=1588757&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/CharEncodingFilter.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/CharEncodingFilter.java Sun Apr 20 13:38:51 2014
@@ -40,7 +40,6 @@ import org.apache.commons.logging.LogFac
  */
 public class CharEncodingFilter implements Filter {
     
-    private FilterConfig mFilterConfig = null;
     private static Log mLogger =
             LogFactory.getFactory().getInstance(CharEncodingFilter.class);
     
@@ -48,7 +47,6 @@ public class CharEncodingFilter implemen
      * init
      */
     public void init(FilterConfig filterConfig) throws ServletException {
-        mFilterConfig = filterConfig;
     }
     
     /**

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/CustomOpenIDAuthenticationProcessingFilter.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/CustomOpenIDAuthenticationProcessingFilter.java?rev=1588757&r1=1588756&r2=1588757&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/CustomOpenIDAuthenticationProcessingFilter.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/CustomOpenIDAuthenticationProcessingFilter.java Sun Apr 20 13:38:51 2014
@@ -29,11 +29,9 @@ import javax.servlet.http.HttpServletRes
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.springframework.security.core.Authentication;
-import org.springframework.security.core.AuthenticationException;
 import org.springframework.security.core.GrantedAuthority;
 import org.springframework.security.openid.OpenIDAuthenticationToken;
 import org.springframework.security.openid.OpenIDAuthenticationFilter;
-import org.springframework.security.openid.OpenIDConsumer;
 //import org.springframework.security.userdetails.openid.OpenIDUserAttribute;
 
 
@@ -44,14 +42,14 @@ import org.springframework.security.open
 public class CustomOpenIDAuthenticationProcessingFilter 
         extends OpenIDAuthenticationFilter implements Filter {
 
-    private OpenIDConsumer consumer;
-    private String claimedIdentityFieldName = DEFAULT_CLAIMED_IDENTITY_FIELD;
     private static Log log = LogFactory.getLog(CustomOpenIDAuthenticationProcessingFilter.class);
 
+    /**
+     * @throws org.springframework.security.core.AuthenticationException
+     */
     @Override
-    public Authentication attemptAuthentication(HttpServletRequest req, HttpServletResponse rsp) throws AuthenticationException,
-            IOException {
-        OpenIDAuthenticationToken auth = null;
+    public Authentication attemptAuthentication(HttpServletRequest req, HttpServletResponse rsp) throws IOException {
+        OpenIDAuthenticationToken auth;
 
         // Processing standard OpenId user authentication    
         auth = (OpenIDAuthenticationToken) super.attemptAuthentication(req, rsp);

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/InitFilter.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/InitFilter.java?rev=1588757&r1=1588756&r2=1588757&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/InitFilter.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/InitFilter.java Sun Apr 20 13:38:51 2014
@@ -19,6 +19,7 @@
 package org.apache.roller.weblogger.ui.core.filters;
 
 import java.io.IOException;
+
 import javax.servlet.Filter;
 import javax.servlet.FilterChain;
 import javax.servlet.FilterConfig;
@@ -26,56 +27,56 @@ import javax.servlet.ServletException;
 import javax.servlet.ServletRequest;
 import javax.servlet.ServletResponse;
 import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.roller.weblogger.config.WebloggerRuntimeConfig;
 
-
 /**
- * A special initialization filter which ensures that we have an opportunity
- * to extract a few pieces of information about the environment we are running
- * in when the first request is sent.
- *
+ * A special initialization filter which ensures that we have an opportunity to
+ * extract a few pieces of information about the environment we are running in
+ * when the first request is sent.
+ * 
  * @web.filter name="InitFilter"
  */
 public class InitFilter implements Filter {
-    
+
     private static Log log = LogFactory.getLog(InitFilter.class);
-    
+
     private boolean initialized = false;
-    
-    
-    public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
-            throws IOException, ServletException {
-        
-        if(!initialized) {
+
+    public void doFilter(ServletRequest req, ServletResponse res,
+            FilterChain chain) throws IOException, ServletException {
+
+        if (!initialized) {
+
             // first request, lets do our initialization
             HttpServletRequest request = (HttpServletRequest) req;
-            HttpServletResponse response = (HttpServletResponse) res;
-            
+            // HttpServletResponse response = (HttpServletResponse) res;
+
             // determine absolute and relative url paths to the app
             String relPath = request.getContextPath();
             String absPath = this.getAbsoluteUrl(request);
-            
+
             // set them in our config
             WebloggerRuntimeConfig.setAbsoluteContextURL(absPath);
             WebloggerRuntimeConfig.setRelativeContextURL(relPath);
-            
-            log.debug("relPath = "+relPath);
-            log.debug("absPath = "+absPath);
-            
+
+            if (log.isDebugEnabled()) {
+                log.debug("relPath = " + relPath);
+                log.debug("absPath = " + absPath);
+            }
+
             this.initialized = true;
         }
-        
+
         chain.doFilter(req, res);
     }
-    
-    
+
     private String getAbsoluteUrl(HttpServletRequest request) {
-        
+
         String url = null;
-        
+
         String fullUrl = null;
 
         if (!request.isSecure()) {
@@ -84,33 +85,41 @@ public class InitFilter implements Filte
             fullUrl = "http://" + request.getServerName()
                     + request.getContextPath();
         }
-        
+
         // if the uri is only "/" then we are basically done
-        if("/".equals(request.getRequestURI())) {
-            log.info(fullUrl.substring(0, fullUrl.length()-1));
-            return fullUrl.substring(0, fullUrl.length()-1);
+        if ("/".equals(request.getRequestURI())) {
+            if (log.isDebugEnabled()) {
+                log.debug(fullUrl.substring(0, fullUrl.length() - 1));
+            }
+            return fullUrl.substring(0, fullUrl.length() - 1);
         }
-        
+
         // find first "/" starting after hostname is specified
-        int index = fullUrl.indexOf('/', fullUrl.indexOf(request.getServerName()));
-        
-        // extract just the part leading up to uri
-        url = fullUrl.substring(0, index);
-        
+        int index = fullUrl.indexOf('/',
+                fullUrl.indexOf(request.getServerName()));
+
+        if (index != -1) {
+            // extract just the part leading up to uri
+            url = fullUrl.substring(0, index);
+        } else {
+            url = fullUrl.trim();
+        }
+
         // then just add on the context path
         url += request.getContextPath();
-        
+
         // make certain that we don't end with a /
-        if(url.endsWith("/")) {
-            url = url.substring(0, url.length()-1);
+        if (url.endsWith("/")) {
+            url = url.substring(0, url.length() - 1);
         }
-        
+
         return url;
     }
-    
-    
-    public void init(FilterConfig filterConfig) throws ServletException {}
-    
-    public void destroy() {}
-    
+
+    public void init(FilterConfig filterConfig) throws ServletException {
+    }
+
+    public void destroy() {
+    }
+
 }

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/LoadSaltFilter.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/LoadSaltFilter.java?rev=1588757&r1=1588756&r2=1588757&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/LoadSaltFilter.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/LoadSaltFilter.java Sun Apr 20 13:38:51 2014
@@ -22,9 +22,7 @@ import java.io.IOException;
 import java.security.SecureRandom;
 import javax.servlet.*;
 import javax.servlet.http.HttpServletRequest;
-import org.apache.commons.lang.RandomStringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.apache.commons.lang3.RandomStringUtils;
 import org.apache.roller.weblogger.ui.rendering.util.cache.SaltCache;
 
 /**
@@ -32,7 +30,6 @@ import org.apache.roller.weblogger.ui.re
  * Roller. See also: ValidateSalt filter.
  */
 public class LoadSaltFilter implements Filter {
-    private static Log log = LogFactory.getLog(LoadSaltFilter.class);
 
     //@Override
     public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/RoleAssignmentFilter.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/RoleAssignmentFilter.java?rev=1588757&r1=1588756&r2=1588757&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/RoleAssignmentFilter.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/RoleAssignmentFilter.java Sun Apr 20 13:38:51 2014
@@ -38,8 +38,8 @@ import org.apache.roller.weblogger.pojos
 /**
  * Enable Roller's User Roles to work in CMA setup without a JDBC realm.
  * 
- * If you're using Container Manager Authenticaton (CMA) and you're not using 
- * the a JDBC realm that can add the User Roles defined by Roller, then you can
+ * If you're using Container Manager Authentication (CMA) and you're not using
+ * a JDBC realm that can add the User Roles defined by Roller, then you can
  * use this class to ensure that the request Role methods operate against the
  * User Roles as defined by Roller's User Manager.
  */

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/SchemeEnforcementFilter.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/SchemeEnforcementFilter.java?rev=1588757&r1=1588756&r2=1588757&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/SchemeEnforcementFilter.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/SchemeEnforcementFilter.java Sun Apr 20 13:38:51 2014
@@ -24,6 +24,7 @@
 package org.apache.roller.weblogger.ui.core.filters;
 
 import java.io.IOException;
+import java.util.Collections;
 import java.util.HashSet;
 import java.util.Set;
 
@@ -36,7 +37,7 @@ import javax.servlet.ServletResponse;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.roller.weblogger.config.WebloggerConfig;
@@ -141,11 +142,7 @@ public class SchemeEnforcementFilter imp
 
         int i = theUrl.lastIndexOf('.');
 
-        if (i <= 0 || i == theUrl.length() - 1) {
-            return true;
-        }
-
-        return ignored.contains(theUrl.substring(i + 1));
+        return i <= 0 || i == theUrl.length()-1 || ignored.contains(theUrl.substring(i + 1));
 
     }
 
@@ -188,15 +185,12 @@ public class SchemeEnforcementFilter imp
             String cfgs = WebloggerConfig
                     .getProperty("schemeenforcement.https.urls");
             String[] cfgsArray = cfgs.split(",");
-            for (int i = 0; i < cfgsArray.length; i++) {
-                this.allowedUrls.add(cfgsArray[i]);
-            }
+            Collections.addAll(this.allowedUrls, cfgsArray);
+
             cfgs = WebloggerConfig
                     .getProperty("schemeenforcement.https.ignored");
             cfgsArray = StringUtils.stripAll(StringUtils.split(cfgs, ","));
-            for (int i = 0; i < cfgsArray.length; i++) {
-                this.ignored.add(cfgsArray[i]);
-            }
+            Collections.addAll(this.ignored, cfgsArray);
 
             // some logging for the curious
             log.info("Scheme enforcement = enabled");

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/ValidateSaltFilter.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/ValidateSaltFilter.java?rev=1588757&r1=1588756&r2=1588757&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/ValidateSaltFilter.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/filters/ValidateSaltFilter.java Sun Apr 20 13:38:51 2014
@@ -30,7 +30,7 @@ import javax.servlet.ServletRequest;
 import javax.servlet.ServletResponse;
 import javax.servlet.http.HttpServletRequest;
 
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.roller.weblogger.config.WebloggerConfig;
 import org.apache.roller.weblogger.ui.rendering.util.cache.SaltCache;
 
@@ -47,10 +47,11 @@ public class ValidateSaltFilter implemen
 			FilterChain chain) throws IOException, ServletException {
 		HttpServletRequest httpReq = (HttpServletRequest) request;
 
-        // TODO multipart/form-data does not send parameters
+        // note enctype="multipart/form-data" does not send parameters (see ROL-1956)
+        // requests of this type are stored in salt.ignored.urls in roller.properties
         if (httpReq.getMethod().equals("POST") &&
                 !isIgnoredURL(((HttpServletRequest) request).getServletPath())) {
-            String salt = (String) httpReq.getParameter("salt");
+            String salt = httpReq.getParameter("salt");
             SaltCache saltCache = SaltCache.getInstance();
             if (salt == null || saltCache.get(salt) == null
                     || saltCache.get(salt).equals(false)) {
@@ -64,7 +65,7 @@ public class ValidateSaltFilter implemen
 	// @Override
 	public void init(FilterConfig filterConfig) throws ServletException {
 
-		// Construct our list of ignord urls
+		// Construct our list of ignored urls
 		String urls = WebloggerConfig.getProperty("salt.ignored.urls");
 		String[] urlsArray = StringUtils.stripAll(StringUtils.split(urls, ","));
 		for (int i = 0; i < urlsArray.length; i++) {
@@ -77,7 +78,7 @@ public class ValidateSaltFilter implemen
 	}
 
 	/**
-	 * Checks if this is an ignored url.
+	 * Checks if this is an ignored url defined in the salt.ignored.urls property
 	 * 
 	 * @param theUrl
 	 *            the the url

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/plugins/UIPluginManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/plugins/UIPluginManagerImpl.java?rev=1588757&r1=1588756&r2=1588757&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/plugins/UIPluginManagerImpl.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/plugins/UIPluginManagerImpl.java Sun Apr 20 13:38:51 2014
@@ -25,13 +25,13 @@ import java.util.Map;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.roller.weblogger.config.WebloggerConfig;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 
 
 /**
  * Plugin management for UI layer plugins.
  */
-public class UIPluginManagerImpl implements UIPluginManager {
+public final class UIPluginManagerImpl implements UIPluginManager {
     
     private static Log log = LogFactory.getLog(UIPluginManagerImpl.class);
     

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/security/AuthoritiesPopulator.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/security/AuthoritiesPopulator.java?rev=1588757&r1=1588756&r2=1588757&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/security/AuthoritiesPopulator.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/security/AuthoritiesPopulator.java Sun Apr 20 13:38:51 2014
@@ -54,25 +54,22 @@ public class AuthoritiesPopulator implem
             throw new IllegalArgumentException("The userData argument should not be null at this point.");
         }
 
-        User user = null;
-        List<String> roles = null;
+        User user;
+        List<String> roles = new ArrayList<String>();
         try {
             Weblogger roller = WebloggerFactory.getWeblogger();
             UserManager umgr = roller.getUserManager();
             user = umgr.getUserByUserName(username, Boolean.TRUE);
-            roles = umgr.getRoles(user);
+            if (user != null) {
+                roles = umgr.getRoles(user);
+            }
         } catch (WebloggerException ex) {
             throw new DataRetrievalFailureException("ERROR in user lookup", ex);
         }
 
-        if (user == null) {
-            throw new UsernameNotFoundException("ERROR user: " + username + " not found while granting authorities");
-        }
-
         int roleCount = roles.size() + (defaultRole != null ? 1 : 0);
-        List<GrantedAuthority> authorities = new ArrayList<GrantedAuthority>(roleCount); // SimpleGrantedAuthority[roleCount];
-        int i = 0;
-        for(String role : roles) {
+        List<GrantedAuthority> authorities = new ArrayList<GrantedAuthority>(roleCount);
+        for (String role : roles) {
             authorities.add(new SimpleGrantedAuthority(role));
         }
         

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/security/BasicUserAutoProvision.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/security/BasicUserAutoProvision.java?rev=1588757&r1=1588756&r2=1588757&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/security/BasicUserAutoProvision.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/security/BasicUserAutoProvision.java Sun Apr 20 13:38:51 2014
@@ -46,7 +46,7 @@ public class BasicUserAutoProvision impl
 	public boolean execute(HttpServletRequest request) {
 		User ud = CustomUserRegistry.getUserDetailsFromAuthentication(request);
 
-		if (ud != null) {
+		if (hasNecessaryFields(ud)) {
 			UserManager mgr;
 			try {
 				mgr = WebloggerFactory.getWeblogger().getUserManager();
@@ -67,12 +67,19 @@ public class BasicUserAutoProvision impl
 					}
 				}
 				WebloggerFactory.getWeblogger().flush();
+                return true;
 
-			} catch (WebloggerException e) {
+            } catch (WebloggerException e) {
 				log.warn("Error while auto-provisioning user from SSO.", e);
 			}
 		}
 
-		return true;
+        return false;
 	}
+
+    private boolean hasNecessaryFields(User user) {
+        return user != null && user.getUserName() != null && user.getFullName() != null
+                && user.getScreenName() != null && user.getEmailAddress() != null;
+    }
+
 }

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/security/CustomUserRegistry.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/security/CustomUserRegistry.java?rev=1588757&r1=1588756&r2=1588757&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/security/CustomUserRegistry.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/security/CustomUserRegistry.java Sun Apr 20 13:38:51 2014
@@ -116,6 +116,7 @@ public class CustomUserRegistry {
         
             if (!(oPrincipal instanceof UserDetails)) {
                 LOG.warn("Unsupported Principal type in Authentication. Skipping auto-registration.");
+                LOG.warn("oPrincipal found of type " + oPrincipal.getClass().getName() + "; needs to be UserDetails");
                 return null;
             }
         

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/security/RollerUserDetailsService.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/security/RollerUserDetailsService.java?rev=1588757&r1=1588756&r2=1588757&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/security/RollerUserDetailsService.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/security/RollerUserDetailsService.java Sun Apr 20 13:38:51 2014
@@ -14,7 +14,6 @@ import org.apache.roller.weblogger.busin
 import org.apache.roller.weblogger.business.UserManager;
 import org.apache.roller.weblogger.pojos.User;
 import org.apache.roller.weblogger.pojos.UserAttribute;
-import org.springframework.dao.DataAccessException;
 import org.springframework.dao.DataAccessResourceFailureException;
 import org.springframework.dao.DataRetrievalFailureException;
 
@@ -24,9 +23,11 @@ import org.springframework.dao.DataRetri
 public class RollerUserDetailsService implements UserDetailsService {
     private static Log log = LogFactory.getLog(RollerUserDetailsService.class);
     
-    public UserDetails loadUserByUsername(String userName) 
-            throws UsernameNotFoundException, DataAccessException {
-        Weblogger roller = null;
+    /**
+     * @throws UsernameNotFoundException, DataAccessException
+     */
+    public UserDetails loadUserByUsername(String userName) {
+        Weblogger roller;
         try {
             roller = WebloggerFactory.getWeblogger();
         } catch (Exception e) {
@@ -37,7 +38,7 @@ public class RollerUserDetailsService im
         }
         try {
             UserManager umgr = roller.getUserManager();
-            User userData = null;  
+            User userData;
             // OpenID user
             if (userName.startsWith("http://") || userName.startsWith("https://")) {
                 if (userName.endsWith("/")) {
@@ -68,10 +69,8 @@ public class RollerUserDetailsService im
                      name = userData.getUserName();
                      password = userData.getPassword();
                 }
-                UserDetails usr = new org.springframework.security.core.userdetails.User(name, password,
+                return new org.springframework.security.core.userdetails.User(name, password,
                         true, true, true, true, authorities);
-                return  usr;
-                
             } else {
                 // standard username/password auth
                 try {
@@ -96,7 +95,6 @@ public class RollerUserDetailsService im
      private ArrayList<SimpleGrantedAuthority> getAuthorities(User userData, UserManager umgr) throws WebloggerException {
          List<String> roles = umgr.getRoles(userData);
          ArrayList<SimpleGrantedAuthority> authorities = new ArrayList<SimpleGrantedAuthority>(roles.size());
-         int i = 0;
          for (String role : roles) {
              authorities.add(new SimpleGrantedAuthority(role));
          }

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/tags/calendar/BigWeblogCalendarModel.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/tags/calendar/BigWeblogCalendarModel.java?rev=1588757&r1=1588756&r2=1588757&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/tags/calendar/BigWeblogCalendarModel.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/tags/calendar/BigWeblogCalendarModel.java Sun Apr 20 13:38:51 2014
@@ -28,6 +28,7 @@ import org.apache.roller.weblogger.Weblo
 import org.apache.roller.weblogger.business.WebloggerFactory;
 import org.apache.roller.weblogger.business.WeblogEntryManager;
 import org.apache.roller.weblogger.pojos.WeblogEntry;
+import org.apache.roller.weblogger.pojos.WeblogEntrySearchCriteria;
 import org.apache.roller.weblogger.ui.rendering.util.WeblogPageRequest;
 import org.apache.roller.util.DateUtil;
 
@@ -39,10 +40,10 @@ public class BigWeblogCalendarModel exte
     
     private static Log mLogger = LogFactory.getLog(BigWeblogCalendarModel.class);
     
-    protected static final SimpleDateFormat STAR_DATE_FORMAT =
+    protected final SimpleDateFormat starDateFormat =
             DateUtil.get8charDateFormat();
     
-    protected static final SimpleDateFormat SINGLE_DAY_FORMAT =
+    protected final SimpleDateFormat singleDayFormat =
             new SimpleDateFormat("dd");
     
     
@@ -54,15 +55,14 @@ public class BigWeblogCalendarModel exte
     protected void loadWeblogEntries(Date startDate, Date endDate, String catName) {
         try {
             WeblogEntryManager mgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
-            monthMap = mgr.getWeblogEntryObjectMap(
-                    
-                    weblog,                  // website
-                    startDate,                 // startDate
-                    endDate,                   // endDate
-                    catName,                   // cat
-                    null,WeblogEntry.PUBLISHED, // status
-                    locale,
-                    0, -1);
+            WeblogEntrySearchCriteria wesc = new WeblogEntrySearchCriteria();
+            wesc.setWeblog(weblog);
+            wesc.setStartDate(startDate);
+            wesc.setEndDate(endDate);
+            wesc.setCatName(catName);
+            wesc.setStatus(WeblogEntry.PUBLISHED);
+            wesc.setLocale(locale);
+            monthMap = mgr.getWeblogEntryObjectMap(wesc);
         } catch (WebloggerException e) {
             mLogger.error(e);
             monthMap = new HashMap();
@@ -77,10 +77,10 @@ public class BigWeblogCalendarModel exte
             
             // get the 8 char YYYYMMDD datestring for day, returns null
             // if no weblog entry on that day
-            String dateString = null;
+            String dateString;
             List entries = (List)monthMap.get(day);
             if ( entries != null ) {
-                dateString = STAR_DATE_FORMAT.format(
+                dateString = starDateFormat.format(
                         ((WeblogEntry)entries.get(0)).getPubTime());
                 
                 // append 8 char date string on end of selfurl
@@ -90,7 +90,7 @@ public class BigWeblogCalendarModel exte
                 sb.append("<a href=\"");
                 sb.append( dayUrl );
                 sb.append("\">");
-                sb.append(SINGLE_DAY_FORMAT.format(day));
+                sb.append(singleDayFormat.format(day));
                 sb.append("</a></div>");
                 
                 for ( int i=0; i<entries.size(); i++ ) {
@@ -113,7 +113,7 @@ public class BigWeblogCalendarModel exte
                 
             } else {
                 sb.append("<div class=\"hCalendarDayTitleBig\">");
-                sb.append(SINGLE_DAY_FORMAT.format(day));
+                sb.append(singleDayFormat.format(day));
                 sb.append("</div>");
                 sb.append("<div class=\"bCalendarDayContentBig\"/>");
             }
@@ -139,14 +139,14 @@ public class BigWeblogCalendarModel exte
         List entries = (List)monthMap.get( day );
         if ( entries != null && day != null ) {
             WeblogEntry entry = (WeblogEntry)entries.get(0);
-            dateString = STAR_DATE_FORMAT.format(entry.getPubTime());
+            dateString = starDateFormat.format(entry.getPubTime());
         }
         if (dateString == null && !alwaysURL) {
             return null;
         }
         else if (dateString == null && !nextPrevMonthURL) {
             dateString = DateUtil.format8chars(day);
-        } else if (dateString == null && nextPrevMonthURL) {
+        } else if (dateString == null) {
             dateString = DateUtil.format6chars(day);
         }
         try {

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/tags/calendar/CalendarTag.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/tags/calendar/CalendarTag.java?rev=1588757&r1=1588756&r2=1588757&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/tags/calendar/CalendarTag.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/tags/calendar/CalendarTag.java Sun Apr 20 13:38:51 2014
@@ -113,12 +113,17 @@ public class CalendarTag extends TagSupp
         try {
             // build week day names
             this.buildDayNames();
-            
-            Date day=null;       // day to be displayed
-            Calendar dayCal;     // set to day to be displayed
-            Calendar cal;        // for iterating through days of month
-            Calendar todayCal;   // for iterating through days of month
-            CalendarModel model; // the calendar model
+
+            // day to be displayed
+            Date day;
+            // set to day to be displayed
+            Calendar dayCal;
+            // for iterating through days of month
+            Calendar cal;
+            // for iterating through days of month
+            Calendar todayCal;
+            // the calendar model
+            CalendarModel model;
             
             // ---------------------------------
             // --- initialize date variables ---
@@ -208,12 +213,12 @@ public class CalendarTag extends TagSupp
                     Date tddate = cal.getTime();
                     String url = model.computeUrl(tddate, false, false);
                     String content = model.getContent( tddate );
-                    
-                    if // day is in calendar month
-                            ((cal.get(Calendar.MONTH) == dayCal.get(Calendar.MONTH))
+
+                    // day is in calendar month
+                    if ((cal.get(Calendar.MONTH) == dayCal.get(Calendar.MONTH))
                             && (cal.get(Calendar.YEAR) == dayCal.get(Calendar.YEAR))) {
-                        if // day is today then use today style
-                                ((          cal.get(Calendar.DAY_OF_MONTH)
+                        // day is today then use today style
+                        if ((          cal.get(Calendar.DAY_OF_MONTH)
                                 == todayCal.get(Calendar.DAY_OF_MONTH))
                                 && (        cal.get(Calendar.MONTH)
                                 == todayCal.get(Calendar.MONTH))
@@ -223,8 +228,8 @@ public class CalendarTag extends TagSupp
                         } else {
                             printDayInThisMonth(pw, cal, url, content);
                         }
-                    } else // apply day-not-in-month style ;-)
-                    {
+                    } else {
+                        // apply day-not-in-month style ;-)
                         printDayNotInMonth(pw, cal);
                     }
                     

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/tags/calendar/WeblogCalendarModel.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/tags/calendar/WeblogCalendarModel.java?rev=1588757&r1=1588756&r2=1588757&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/tags/calendar/WeblogCalendarModel.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/tags/calendar/WeblogCalendarModel.java Sun Apr 20 13:38:51 2014
@@ -28,7 +28,7 @@ import java.util.Locale;
 import java.util.Map;
 import java.util.TimeZone;
 
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.roller.weblogger.WebloggerException;
@@ -36,6 +36,7 @@ import org.apache.roller.weblogger.busin
 import org.apache.roller.weblogger.business.WeblogEntryManager;
 import org.apache.roller.weblogger.pojos.WeblogEntry;
 import org.apache.roller.weblogger.pojos.Weblog;
+import org.apache.roller.weblogger.pojos.WeblogEntrySearchCriteria;
 import org.apache.roller.weblogger.ui.rendering.util.WeblogPageRequest;
 import org.apache.roller.util.DateUtil;
 
@@ -53,9 +54,9 @@ public class WeblogCalendarModel impleme
     protected String            pageLink = null;
     protected String            locale = null;
     protected Calendar          calendar = null;
-    protected Weblog       weblog = null;
-    protected Date              prevMonth = null; // prev month or null if none
-    protected Date              nextMonth = null; // next month or null if none    
+    protected Weblog            weblog = null;
+    protected Date              prevMonth = null;
+    protected Date              nextMonth = null;
     protected WeblogPageRequest pageRequest = null;
     
     
@@ -69,8 +70,6 @@ public class WeblogCalendarModel impleme
                         pageRequest.getWeblogHandle());
             }
             pageLink = pageRequest.getWeblogPageName();            
-//            day = DateUtil.parseWeblogURLDateString(pageRequest.getWeblogDate(),
-//                    weblog.getTimeZoneInstance(), weblog.getLocaleInstance());
             day = parseWeblogURLDateString(pageRequest.getWeblogDate(),
                   weblog.getTimeZoneInstance(), weblog.getLocaleInstance());
             locale = pageRequest.getLocale();
@@ -106,20 +105,17 @@ public class WeblogCalendarModel impleme
         // Use entry's date as previous month
         try {
             WeblogEntryManager mgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
-            List prevEntries = mgr.getWeblogEntries(
-                    
-                    weblog,                    // website
-                    null,                      // user
-                    null,                      // startDate
-                    // since we need an entry.pubTime<startDate, but the method use <=
-                    new Date(startDate.getTime()-1),                 // endDate 
-                    cat,                       // cat
-                    null,WeblogEntry.PUBLISHED, // status
-                    null,                      // text
-                    null,                      // sortby (null means pubTime)
-                    WeblogEntryManager.DESCENDING,  // sortorder, null means DESCENDING
-                    locale,                    // locale
-                    0, 1);                     // offset, range
+            WeblogEntrySearchCriteria wesc = new WeblogEntrySearchCriteria();
+            wesc.setWeblog(weblog);
+            // since we need an entry.pubTime < startDate, but the method uses endDate
+            wesc.setEndDate(new Date(startDate.getTime()-1));
+            wesc.setCatName(cat);
+            wesc.setStatus(WeblogEntry.PUBLISHED);
+            wesc.setSortOrder(WeblogEntrySearchCriteria.SortOrder.DESCENDING);
+            wesc.setLocale(locale);
+            wesc.setMaxResults(1);
+            List prevEntries = mgr.getWeblogEntries(wesc);
+
             if (prevEntries.size() > 0) {
                 WeblogEntry prevEntry = (WeblogEntry)prevEntries.get(0);
                 prevMonth = DateUtil.getStartOfMonth(new Date(prevEntry.getPubTime().getTime()),getCalendar());
@@ -133,20 +129,16 @@ public class WeblogCalendarModel impleme
         // Use entry's date as next month
         try {
             WeblogEntryManager mgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
-            List nextEntries = mgr.getWeblogEntries(
-                    
-                    weblog,                    // website
-                    null,                      // user
-                    // since we need an entry.pubTime>endDate, but the method use >=
-                    new Date(endDate.getTime()+1),                   // startDate
-                    null,                      // endDate 
-                    cat,                       // cat
-                    null,WeblogEntry.PUBLISHED, // status
-                    null,                      // text
-                    null,                      // sortby (null means pubTime)
-                    WeblogEntryManager.ASCENDING,   // sortorder
-                    locale,                    // locale
-                    0, 1);                     // offset, range
+            WeblogEntrySearchCriteria wesc = new WeblogEntrySearchCriteria();
+            wesc.setWeblog(weblog);
+            // since we need an entry.pubTime > endDate, but the method uses startDate
+            wesc.setStartDate(new Date(startDate.getTime()-1));
+            wesc.setCatName(cat);
+            wesc.setStatus(WeblogEntry.PUBLISHED);
+            wesc.setSortOrder(WeblogEntrySearchCriteria.SortOrder.ASCENDING);
+            wesc.setLocale(locale);
+            wesc.setMaxResults(1);
+            List nextEntries = mgr.getWeblogEntries(wesc);
             if (nextEntries.size() > 0) {
                 WeblogEntry nextEntry = (WeblogEntry)nextEntries.get(0);
                 nextMonth = DateUtil.getStartOfMonth(new Date(nextEntry.getPubTime().getTime()),getCalendar());
@@ -168,21 +160,20 @@ public class WeblogCalendarModel impleme
     protected void loadWeblogEntries(Date startDate, Date endDate, String catName) {
         try {
             WeblogEntryManager mgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
-            monthMap = mgr.getWeblogEntryStringMap(
-                    
-                    weblog,                  // website
-                    startDate,                 // startDate
-                    endDate,                   // endDate
-                    catName,                   // cat
-                    null,WeblogEntry.PUBLISHED, // status
-                    locale,
-                    0, -1);
+            WeblogEntrySearchCriteria wesc = new WeblogEntrySearchCriteria();
+            wesc.setWeblog(weblog);
+            wesc.setStartDate(startDate);
+            wesc.setEndDate(endDate);
+            wesc.setCatName(catName);
+            wesc.setStatus(WeblogEntry.PUBLISHED);
+            wesc.setLocale(locale);
+            monthMap = mgr.getWeblogEntryStringMap(wesc);
         } catch (WebloggerException e) {
             log.error(e);
-            monthMap = new HashMap();
+            monthMap = new HashMap<Date, String>();
         }
     }
-    
+
     public void setDay(String month) throws Exception {
         SimpleDateFormat fmt = DateUtil.get8charDateFormat();
         fmt.setCalendar(getCalendar());
@@ -195,7 +186,7 @@ public class WeblogCalendarModel impleme
     }
     
     public String getParameterValue(Date day) {
-        return (String)monthMap.get( day );
+        return (String) monthMap.get(day);
     }
 
     // convenience method returns 8 char day stamp YYYYMMDD
@@ -228,13 +219,8 @@ public class WeblogCalendarModel impleme
             char8DateFormat.setCalendar(cal);
             ParsePosition pos = new ParsePosition(0);
             ret = char8DateFormat.parse(dateString, pos);
-            
+
             // make sure the requested date is not in the future
-//            Date today = null;
-//            Calendar todayCal = Calendar.getInstance();
-//            todayCal = Calendar.getInstance(tz, locale);
-//            todayCal.setTime(new Date());
-//            today = todayCal.getTime();
             // Date is always ms offset from epoch in UTC, by no means of timezone.
             Date today = new Date();
             if(ret.after(today)) {
@@ -250,10 +236,6 @@ public class WeblogCalendarModel impleme
             ret = char6DateFormat.parse(dateString, pos);
             
             // make sure the requested date is not in the future
-//            Calendar todayCal = Calendar.getInstance();
-//            todayCal = Calendar.getInstance(tz, locale);
-//            todayCal.setTime(new Date());
-//            Date today = todayCal.getTime();
             Date today = new Date();
             if(ret.after(today)) {
                 ret = today;
@@ -272,21 +254,21 @@ public class WeblogCalendarModel impleme
     public String computeUrl(Date day, boolean monthURL, boolean alwaysURL) {
         String url = null;
         // get the 8 char YYYYMMDD datestring for day
-        String dateString = (String)monthMap.get(day);
+        String dateString = (String) monthMap.get(day);
         if (dateString == null && !alwaysURL) {
             return null;
         }
         else if (dateString == null && !monthURL) {
-            dateString = DateUtil.format8chars(day);
         	dateString = format8chars(day,getCalendar());
-        } else if (dateString == null && monthURL) {
-//            dateString = DateUtil.format6chars(day);
+        } else if (dateString == null) {
             dateString = format6chars(day,getCalendar());
         }
         try {
-            if (pageLink == null) { // create date URL
+            if (pageLink == null) {
+                // create date URL
                 url = WebloggerFactory.getWeblogger().getUrlStrategy().getWeblogCollectionURL(weblog, locale, cat, dateString, null, -1, false);
-            } else { // create page URL
+            } else {
+                // create page URL
                 url = WebloggerFactory.getWeblogger().getUrlStrategy().getWeblogPageURL(weblog, locale, pageLink, null, cat, dateString, null, -1, false);
             }
         } catch (Exception e) {
@@ -321,9 +303,11 @@ public class WeblogCalendarModel impleme
     
     public String computeTodayMonthUrl() {
     	String url;
-        if (pageLink == null) { // create default URL
+        if (pageLink == null) {
+            // create default URL
             url = WebloggerFactory.getWeblogger().getUrlStrategy().getWeblogCollectionURL(weblog, locale, cat, null, null, -1, false);
-        } else { // create page URL
+        } else {
+            // create page URL
             url = WebloggerFactory.getWeblogger().getUrlStrategy().getWeblogPageURL(weblog, locale, pageLink, null, cat, null, null, -1, false);
         }
     	return url;



Mime
View raw message