roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agillil...@apache.org
Subject svn commit: r553697 [1/2] - in /roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger: pojos/wrapper/ ui/rendering/model/ ui/rendering/pagers/ ui/rendering/servlets/ ui/rendering/util/ ui/rendering/velocity/deprecated/
Date Fri, 06 Jul 2007 02:14:58 GMT
Author: agilliland
Date: Thu Jul  5 19:14:56 2007
New Revision: 553697

URL: http://svn.apache.org/viewvc?view=rev&rev=553697
Log:
finishing up the process of plugging in a url strategy throughout the rendering process.  all components involved in rendering need to be able to accept a url strategy to use for building any urls they want to display, this primarily includes Models, Pagers, and Pojo wrappers.


Modified:
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/wrapper/WeblogBookmarkFolderWrapper.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/wrapper/WeblogCategoryWrapper.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryAttributeWrapper.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryCommentWrapper.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryTagWrapper.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryWrapper.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/wrapper/WeblogReferrerWrapper.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/wrapper/WeblogWrapper.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/FeedModel.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/ModelLoader.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/PageModel.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/PlanetModel.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/PreviewPageModel.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/SearchResultsFeedModel.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/SearchResultsModel.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/SiteModel.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/AbstractPager.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/AbstractWeblogEntriesPager.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/CommentsPager.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/PlanetEntriesPager.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/SearchResultsFeedPager.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/SearchResultsPager.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/UsersPager.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesDayPager.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesLatestPager.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesListPager.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesMonthPager.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesPermalinkPager.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesPreviewPager.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogsPager.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/servlets/PageServlet.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/servlets/PreviewServlet.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/servlets/SearchServlet.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/util/WeblogEntryCommentForm.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/velocity/deprecated/ContextLoader.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/velocity/deprecated/OldWeblogPageModel.java

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/wrapper/WeblogBookmarkFolderWrapper.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/wrapper/WeblogBookmarkFolderWrapper.java?view=diff&rev=553697&r1=553696&r2=553697
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/wrapper/WeblogBookmarkFolderWrapper.java (original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/wrapper/WeblogBookmarkFolderWrapper.java Thu Jul  5 19:14:56 2007
@@ -69,10 +69,10 @@
         return this.pojo.getPath();
     }
     
-    
-    public WeblogWrapper getWebsite() {
-        return WeblogWrapper.wrap(this.pojo.getWebsite());
-    }
+    // NOTE: removing this for 4.0 since there is really no need for this in templates
+//    public WeblogWrapper getWebsite() {
+//        return WeblogWrapper.wrap(this.pojo.getWebsite());
+//    }
     
     
     public WeblogBookmarkFolderWrapper getParent() {

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/wrapper/WeblogCategoryWrapper.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/wrapper/WeblogCategoryWrapper.java?view=diff&rev=553697&r1=553696&r2=553697
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/wrapper/WeblogCategoryWrapper.java (original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/wrapper/WeblogCategoryWrapper.java Thu Jul  5 19:14:56 2007
@@ -23,6 +23,7 @@
 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;
 import org.apache.roller.weblogger.pojos.WeblogEntry;
 
@@ -35,16 +36,21 @@
     // keep a reference to the wrapped pojo
     private final WeblogCategory pojo;
     
+    // url strategy to use for any url building
+    private final URLStrategy urlStrategy;
+    
+    
     // this is private so that we can force the use of the .wrap(pojo) method
-    private WeblogCategoryWrapper(WeblogCategory toWrap) {
+    private WeblogCategoryWrapper(WeblogCategory toWrap, URLStrategy strat) {
         this.pojo = toWrap;
+        this.urlStrategy = strat;
     }
     
     
     // wrap the given pojo if it is not null
-    public static WeblogCategoryWrapper wrap(WeblogCategory toWrap) {
+    public static WeblogCategoryWrapper wrap(WeblogCategory toWrap, URLStrategy strat) {
         if(toWrap != null)
-            return new WeblogCategoryWrapper(toWrap);
+            return new WeblogCategoryWrapper(toWrap, strat);
         
         return null;
     }
@@ -76,12 +82,12 @@
     
     
     public WeblogWrapper getWebsite() {
-        return WeblogWrapper.wrap(this.pojo.getWebsite());
+        return WeblogWrapper.wrap(this.pojo.getWebsite(), urlStrategy);
     }
     
     
     public WeblogCategoryWrapper getParent() {
-        return WeblogCategoryWrapper.wrap(this.pojo.getParent());
+        return WeblogCategoryWrapper.wrap(this.pojo.getParent(), urlStrategy);
     }
     
     
@@ -95,7 +101,7 @@
         Iterator it = initialCollection.iterator();
         int i = 0;
         while(it.hasNext()) {
-            wrappedCollection.add(i,WeblogCategoryWrapper.wrap((WeblogCategory) it.next()));
+            wrappedCollection.add(i,WeblogCategoryWrapper.wrap((WeblogCategory) it.next(), urlStrategy));
             i++;
         }
         
@@ -115,7 +121,7 @@
         Iterator it = initialCollection.iterator();
         int i = 0;
         while(it.hasNext()) {
-            wrappedCollection.add(i,WeblogEntryWrapper.wrap((WeblogEntry) it.next()));
+            wrappedCollection.add(i,WeblogEntryWrapper.wrap((WeblogEntry) it.next(), urlStrategy));
             i++;
         }
         

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryAttributeWrapper.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryAttributeWrapper.java?view=diff&rev=553697&r1=553696&r2=553697
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryAttributeWrapper.java (original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryAttributeWrapper.java Thu Jul  5 19:14:56 2007
@@ -43,15 +43,15 @@
         return null;
     }
     
+    // NOTD: removing this for 4.0 because there is no need for it
+//    public String getId() {
+//        return this.pojo.getId();
+//    }
     
-    public String getId() {
-        return this.pojo.getId();
-    }
-    
-    
-    public WeblogEntryWrapper getEntry() {
-        return WeblogEntryWrapper.wrap(this.pojo.getEntry());
-    }
+    // NOTE: removing this for 4.0 because there is no need for it
+//    public WeblogEntryWrapper getEntry() {
+//        return WeblogEntryWrapper.wrap(this.pojo.getEntry());
+//    }
     
     
     public String getName() {

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryCommentWrapper.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryCommentWrapper.java?view=diff&rev=553697&r1=553696&r2=553697
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryCommentWrapper.java (original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryCommentWrapper.java Thu Jul  5 19:14:56 2007
@@ -19,6 +19,7 @@
 package org.apache.roller.weblogger.pojos.wrapper;
 
 import org.apache.commons.lang.StringEscapeUtils;
+import org.apache.roller.weblogger.business.URLStrategy;
 import org.apache.roller.weblogger.pojos.WeblogEntryComment;
 
 
@@ -30,16 +31,21 @@
     // keep a reference to the wrapped pojo
     private final WeblogEntryComment pojo;
     
+    // url strategy to use for any url building
+    private final URLStrategy urlStrategy;
+    
+    
     // this is private so that we can force the use of the .wrap(pojo) method
-    private WeblogEntryCommentWrapper(WeblogEntryComment toWrap) {
+    private WeblogEntryCommentWrapper(WeblogEntryComment toWrap, URLStrategy strat) {
         this.pojo = toWrap;
+        this.urlStrategy = strat;
     }
     
     
     // wrap the given pojo if it is not null
-    public static WeblogEntryCommentWrapper wrap(WeblogEntryComment toWrap) {
+    public static WeblogEntryCommentWrapper wrap(WeblogEntryComment toWrap, URLStrategy strat) {
         if(toWrap != null)
-            return new WeblogEntryCommentWrapper(toWrap);
+            return new WeblogEntryCommentWrapper(toWrap, strat);
         
         return null;
     }
@@ -51,7 +57,7 @@
     
     
     public WeblogEntryWrapper getWeblogEntry() {
-        return WeblogEntryWrapper.wrap(this.pojo.getWeblogEntry());
+        return WeblogEntryWrapper.wrap(this.pojo.getWeblogEntry(), urlStrategy);
     }
     
     

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryTagWrapper.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryTagWrapper.java?view=diff&rev=553697&r1=553696&r2=553697
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryTagWrapper.java (original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryTagWrapper.java Thu Jul  5 19:14:56 2007
@@ -30,6 +30,7 @@
     // keep a reference to the wrapped pojo
     private final WeblogEntryTag pojo;
     
+    
     // this is private so that we can force the use of the .wrap(pojo) method
     private WeblogEntryTagWrapper(WeblogEntryTag toWrap) {
         this.pojo = toWrap;
@@ -44,20 +45,20 @@
         return null;
     }
     
-    
-    public String getId() {
-        return this.pojo.getId();
-    }
-    
-    
-    public WeblogWrapper getWeblog() {
-        return WeblogWrapper.wrap(this.pojo.getWeblog());
-    }
-    
-    
-    public WeblogEntryWrapper getWeblogEntry() {
-        return WeblogEntryWrapper.wrap(this.pojo.getWeblogEntry());
-    }
+    // NOTE: removing for 4.0 because it is not necessary
+//    public String getId() {
+//        return this.pojo.getId();
+//    }
+    
+    // NOTE: removing for 4.0 because it is not necessary
+//    public WeblogWrapper getWeblog() {
+//        return WeblogWrapper.wrap(this.pojo.getWeblog());
+//    }
+    
+    // NOTE: removing for 4.0 because it is not necessary
+//    public WeblogEntryWrapper getWeblogEntry() {
+//        return WeblogEntryWrapper.wrap(this.pojo.getWeblogEntry());
+//    }
     
     
     public UserWrapper getUser() {

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryWrapper.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryWrapper.java?view=diff&rev=553697&r1=553696&r2=553697
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryWrapper.java (original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/wrapper/WeblogEntryWrapper.java Thu Jul  5 19:14:56 2007
@@ -23,6 +23,7 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
+import org.apache.roller.weblogger.business.URLStrategy;
 import org.apache.roller.weblogger.pojos.WeblogCategory;
 import org.apache.roller.weblogger.pojos.WeblogEntry;
 import org.apache.roller.weblogger.pojos.WeblogEntryAttribute;
@@ -39,16 +40,21 @@
     // keep a reference to the wrapped pojo
     private final WeblogEntry pojo;
     
+    // url strategy to use for any url building
+    private final URLStrategy urlStrategy;
+    
+    
     // this is private so that we can force the use of the .wrap(pojo) method
-    private WeblogEntryWrapper(WeblogEntry toWrap) {
+    private WeblogEntryWrapper(WeblogEntry toWrap, URLStrategy strat) {
         this.pojo = toWrap;
+        this.urlStrategy = strat;
     }
     
     
     // wrap the given pojo if it is not null
-    public static WeblogEntryWrapper wrap(WeblogEntry toWrap) {
+    public static WeblogEntryWrapper wrap(WeblogEntry toWrap, URLStrategy strat) {
         if(toWrap != null)
-            return new WeblogEntryWrapper(toWrap);
+            return new WeblogEntryWrapper(toWrap, strat);
         
         return null;
     }
@@ -60,7 +66,7 @@
     
     
     public WeblogCategoryWrapper getCategory() {
-        return WeblogCategoryWrapper.wrap(this.pojo.getCategory());
+        return WeblogCategoryWrapper.wrap(this.pojo.getCategory(), urlStrategy);
     }
     
     
@@ -74,7 +80,7 @@
         Iterator it = initialCollection.iterator();
         int i = 0;
         while(it.hasNext()) {
-            wrappedCollection.add(i,WeblogCategoryWrapper.wrap((WeblogCategory) it.next()));
+            wrappedCollection.add(i,WeblogCategoryWrapper.wrap((WeblogCategory) it.next(), urlStrategy));
             i++;
         }
         
@@ -83,7 +89,7 @@
     
     
     public WeblogWrapper getWebsite() {
-        return WeblogWrapper.wrap(this.pojo.getWebsite());
+        return WeblogWrapper.wrap(this.pojo.getWebsite(), urlStrategy);
     }
     
     
@@ -247,7 +253,7 @@
         Iterator it = initialCollection.iterator();
         int i = 0;
         while(it.hasNext()) {
-            wrappedCollection.add(i,WeblogEntryCommentWrapper.wrap((WeblogEntryComment) it.next()));
+            wrappedCollection.add(i,WeblogEntryCommentWrapper.wrap((WeblogEntryComment) it.next(), urlStrategy));
             i++;
         }
         
@@ -265,7 +271,7 @@
         Iterator it = initialCollection.iterator();
         int i = 0;
         while(it.hasNext()) {
-            wrappedCollection.add(i,WeblogEntryCommentWrapper.wrap((WeblogEntryComment) it.next()));
+            wrappedCollection.add(i,WeblogEntryCommentWrapper.wrap((WeblogEntryComment) it.next(), urlStrategy));
             i++;
         }
         
@@ -288,7 +294,7 @@
         Iterator it = initialCollection.iterator();
         int i = 0;
         while(it.hasNext()) {
-            wrappedCollection.add(i,WeblogReferrerWrapper.wrap((WeblogReferrer) it.next()));
+            wrappedCollection.add(i,WeblogReferrerWrapper.wrap((WeblogReferrer) it.next(), urlStrategy));
             i++;
         }
         

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/wrapper/WeblogReferrerWrapper.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/wrapper/WeblogReferrerWrapper.java?view=diff&rev=553697&r1=553696&r2=553697
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/wrapper/WeblogReferrerWrapper.java (original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/wrapper/WeblogReferrerWrapper.java Thu Jul  5 19:14:56 2007
@@ -18,6 +18,7 @@
 
 package org.apache.roller.weblogger.pojos.wrapper;
 
+import org.apache.roller.weblogger.business.URLStrategy;
 import org.apache.roller.weblogger.pojos.WeblogReferrer;
 
 
@@ -29,16 +30,21 @@
     // keep a reference to the wrapped pojo
     private final WeblogReferrer pojo;
     
+    // url strategy to use for any url building
+    private final URLStrategy urlStrategy;
+    
+    
     // this is private so that we can force the use of the .wrap(pojo) method
-    private WeblogReferrerWrapper(WeblogReferrer toWrap) {
+    private WeblogReferrerWrapper(WeblogReferrer toWrap, URLStrategy strat) {
         this.pojo = toWrap;
+        this.urlStrategy = strat;
     }
     
     
     // wrap the given pojo if it is not null
-    public static WeblogReferrerWrapper wrap(WeblogReferrer toWrap) {
+    public static WeblogReferrerWrapper wrap(WeblogReferrer toWrap, URLStrategy strat) {
         if(toWrap != null)
-            return new WeblogReferrerWrapper(toWrap);
+            return new WeblogReferrerWrapper(toWrap, strat);
         
         return null;
     }
@@ -50,12 +56,12 @@
     
     
     public WeblogWrapper getWebsite() {
-        return WeblogWrapper.wrap(this.pojo.getWebsite());
+        return WeblogWrapper.wrap(this.pojo.getWebsite(), urlStrategy);
     }
     
     
     public WeblogEntryWrapper getWeblogEntry() {
-        return WeblogEntryWrapper.wrap(this.pojo.getWeblogEntry());
+        return WeblogEntryWrapper.wrap(this.pojo.getWeblogEntry(), urlStrategy);
     }
     
     

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/wrapper/WeblogWrapper.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/wrapper/WeblogWrapper.java?view=diff&rev=553697&r1=553696&r2=553697
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/wrapper/WeblogWrapper.java (original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/wrapper/WeblogWrapper.java Thu Jul  5 19:14:56 2007
@@ -26,6 +26,7 @@
 import java.util.Set;
 import java.util.TimeZone;
 import org.apache.roller.weblogger.WebloggerException;
+import org.apache.roller.weblogger.business.URLStrategy;
 import org.apache.roller.weblogger.business.WebloggerFactory;
 import org.apache.roller.weblogger.pojos.ThemeTemplate;
 import org.apache.roller.weblogger.pojos.Weblog;
@@ -34,6 +35,7 @@
 import org.apache.roller.weblogger.pojos.WeblogEntryComment;
 import org.apache.roller.weblogger.pojos.WeblogReferrer;
 
+
 /**
  * Pojo safety wrapper for Weblog objects.
  */
@@ -42,16 +44,21 @@
     // keep a reference to the wrapped pojo
     private final Weblog pojo;
     
+    // url strategy to use for any url building
+    private final URLStrategy urlStrategy;
+    
+    
     // this is private so that we can force the use of the .wrap(pojo) method
-    private WeblogWrapper(Weblog toWrap) {
+    private WeblogWrapper(Weblog toWrap, URLStrategy strat) {
         this.pojo = toWrap;
+        this.urlStrategy = strat;
     }
     
     
     // wrap the given pojo if it is not null
-    public static WeblogWrapper wrap(Weblog toWrap) {
+    public static WeblogWrapper wrap(Weblog toWrap, URLStrategy strat) {
         if(toWrap != null)
-            return new WeblogWrapper(toWrap);
+            return new WeblogWrapper(toWrap, strat);
         
         return null;
     }
@@ -135,12 +142,12 @@
     
     
     public WeblogCategoryWrapper getBloggerCategory() {
-        return WeblogCategoryWrapper.wrap(this.pojo.getBloggerCategory());
+        return WeblogCategoryWrapper.wrap(this.pojo.getBloggerCategory(), urlStrategy);
     }
     
     
     public WeblogCategoryWrapper getDefaultCategory() {
-        return WeblogCategoryWrapper.wrap(this.pojo.getDefaultCategory());
+        return WeblogCategoryWrapper.wrap(this.pojo.getDefaultCategory(), urlStrategy);
     }
     
     
@@ -306,7 +313,7 @@
     
     
     public WeblogEntryWrapper getWeblogEntry(String anchor) {
-        return WeblogEntryWrapper.wrap(this.pojo.getWeblogEntry(anchor));
+        return WeblogEntryWrapper.wrap(this.pojo.getWeblogEntry(anchor), urlStrategy);
     }
     
     
@@ -320,7 +327,7 @@
         Iterator it = initialCollection.iterator();
         int i = 0;
         while(it.hasNext()) {
-            wrappedCollection.add(i,WeblogCategoryWrapper.wrap((WeblogCategory) it.next()));
+            wrappedCollection.add(i,WeblogCategoryWrapper.wrap((WeblogCategory) it.next(), urlStrategy));
             i++;
         }
         
@@ -338,7 +345,7 @@
         Iterator it = initialCollection.iterator();
         int i = 0;
         while(it.hasNext()) {
-            wrappedCollection.add(i,WeblogCategoryWrapper.wrap((WeblogCategory) it.next()));
+            wrappedCollection.add(i,WeblogCategoryWrapper.wrap((WeblogCategory) it.next(), urlStrategy));
             i++;
         }
         
@@ -347,7 +354,7 @@
     
     
     public WeblogCategoryWrapper getWeblogCategory(String categoryPath) {
-        return WeblogCategoryWrapper.wrap(this.pojo.getWeblogCategory(categoryPath));
+        return WeblogCategoryWrapper.wrap(this.pojo.getWeblogCategory(categoryPath), urlStrategy);
     }
     
     
@@ -361,7 +368,7 @@
         Iterator it = initialCollection.iterator();
         int i = 0;
         while(it.hasNext()) {
-            wrappedCollection.add(i,WeblogEntryWrapper.wrap((WeblogEntry) it.next()));
+            wrappedCollection.add(i,WeblogEntryWrapper.wrap((WeblogEntry) it.next(), urlStrategy));
             i++;
         }
         
@@ -379,7 +386,7 @@
         Iterator it = initialCollection.iterator();
         int i = 0;
         while(it.hasNext()) {
-            wrappedCollection.add(i,WeblogEntryWrapper.wrap((WeblogEntry) it.next()));
+            wrappedCollection.add(i,WeblogEntryWrapper.wrap((WeblogEntry) it.next(), urlStrategy));
             i++;
         }
         
@@ -397,7 +404,7 @@
         Iterator it = initialCollection.iterator();
         int i = 0;
         while(it.hasNext()) {
-            wrappedCollection.add(i,WeblogEntryCommentWrapper.wrap((WeblogEntryComment) it.next()));
+            wrappedCollection.add(i,WeblogEntryCommentWrapper.wrap((WeblogEntryComment) it.next(), urlStrategy));
             i++;
         }
         
@@ -420,7 +427,7 @@
         Iterator it = initialCollection.iterator();
         int i = 0;
         while(it.hasNext()) {
-            wrappedCollection.add(i,WeblogReferrerWrapper.wrap((WeblogReferrer) it.next()));
+            wrappedCollection.add(i,WeblogReferrerWrapper.wrap((WeblogReferrer) it.next(), urlStrategy));
             i++;
         }
         

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/FeedModel.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/FeedModel.java?view=diff&rev=553697&r1=553696&r2=553697
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/FeedModel.java (original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/FeedModel.java Thu Jul  5 19:14:56 2007
@@ -97,7 +97,7 @@
      * Get weblog being displayed.
      */
     public WeblogWrapper getWeblog() {
-        return WeblogWrapper.wrap(weblog);
+        return WeblogWrapper.wrap(weblog, urlStrategy);
     }
     
     
@@ -146,7 +146,7 @@
         private WeblogFeedRequest feedRequest;
         
         public FeedEntriesPager(WeblogFeedRequest feedRequest) {
-            super(urlStrategy.getWeblogFeedURL(feedRequest.getWeblog(), 
+            super(urlStrategy, urlStrategy.getWeblogFeedURL(feedRequest.getWeblog(), 
                     feedRequest.getLocale(), feedRequest.getType(),
                     feedRequest.getFormat(), null, null, null, false, true), 
                     feedRequest.getWeblog(), null, feedRequest.getWeblogCategoryName(), feedRequest.getTags(),
@@ -179,7 +179,7 @@
         private WeblogFeedRequest feedRequest;
         
         public FeedCommentsPager(WeblogFeedRequest feedRequest) {            
-            super(urlStrategy.getWeblogFeedURL(feedRequest.getWeblog(), 
+            super(urlStrategy, urlStrategy.getWeblogFeedURL(feedRequest.getWeblog(), 
                     feedRequest.getLocale(), feedRequest.getType(),
                     feedRequest.getFormat(), null, null,
                     null, false, true), feedRequest.getWeblog(), feedRequest.getLocale(), -1, feedRequest.getPage(), DEFAULT_ENTRIES);

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/ModelLoader.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/ModelLoader.java?view=diff&rev=553697&r1=553696&r2=553697
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/ModelLoader.java (original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/ModelLoader.java Thu Jul  5 19:14:56 2007
@@ -25,6 +25,7 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.roller.weblogger.WebloggerException;
+import org.apache.roller.weblogger.business.URLStrategy;
 import org.apache.roller.weblogger.config.WebloggerConfig;
 import org.apache.roller.weblogger.pojos.Weblog;
 import org.apache.roller.weblogger.ui.rendering.util.WeblogPageRequest;
@@ -48,11 +49,12 @@
             HttpServletRequest  request,
             HttpServletResponse response,
             PageContext pageContext,
-            WeblogPageRequest pageRequest) throws WebloggerException {
+            WeblogPageRequest pageRequest,
+            URLStrategy urlStrategy) throws WebloggerException {
         
         // Only load old models if it's enabled     
         if (WebloggerConfig.getBooleanProperty("rendering.legacyModels.enabled")) { 
-            ContextLoader.setupContext(model, request, response, pageContext, pageRequest);            
+            ContextLoader.setupContext(model, request, response, pageContext, pageRequest, urlStrategy);            
         }
     }
     

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/PageModel.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/PageModel.java?view=diff&rev=553697&r1=553696&r2=553697
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/PageModel.java (original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/PageModel.java Thu Jul  5 19:14:56 2007
@@ -121,7 +121,7 @@
      * Get weblog being displayed.
      */
     public WeblogWrapper getWeblog() {
-        return WeblogWrapper.wrap(weblog);
+        return WeblogWrapper.wrap(weblog, urlStrategy);
     }
     
     
@@ -147,7 +147,7 @@
      */
     public WeblogEntryWrapper getWeblogEntry() {
         if(pageRequest.getWeblogEntry() != null) {
-            return WeblogEntryWrapper.wrap(pageRequest.getWeblogEntry());
+            return WeblogEntryWrapper.wrap(pageRequest.getWeblogEntry(), urlStrategy);
         }
         return null;
     }
@@ -176,7 +176,7 @@
      */
     public WeblogCategoryWrapper getWeblogCategory() {
         if(pageRequest.getWeblogCategory() != null) {
-            return WeblogCategoryWrapper.wrap(pageRequest.getWeblogCategory());
+            return WeblogCategoryWrapper.wrap(pageRequest.getWeblogCategory(), urlStrategy);
         }
         return null;
     }
@@ -241,6 +241,7 @@
         // determine which mode to use
         if (pageRequest.getWeblogAnchor() != null) {
             return new WeblogEntriesPermalinkPager(
+                    urlStrategy,
                     weblog,
                     pageRequest.getLocale(),
                     pageRequest.getWeblogPageName(),
@@ -251,6 +252,7 @@
                     pageRequest.getPageNum());
         } else if (dateString != null && dateString.length() == 8) {
             return new WeblogEntriesDayPager(
+                    urlStrategy,
                     weblog,
                     pageRequest.getLocale(),
                     pageRequest.getWeblogPageName(),
@@ -261,6 +263,7 @@
                     pageRequest.getPageNum());
         } else if (dateString != null && dateString.length() == 6) {
             return new WeblogEntriesMonthPager(
+                    urlStrategy,
                     weblog,
                     pageRequest.getLocale(),
                     pageRequest.getWeblogPageName(),
@@ -272,6 +275,7 @@
           
         } else {
             return new WeblogEntriesLatestPager(
+                    urlStrategy,
                     weblog,
                     pageRequest.getLocale(),
                     pageRequest.getWeblogPageName(),

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/PlanetModel.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/PlanetModel.java?view=diff&rev=553697&r1=553696&r2=553697
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/PlanetModel.java (original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/PlanetModel.java Thu Jul  5 19:14:56 2007
@@ -95,6 +95,7 @@
                 null, null, null, null, 0, false);
         
         return new PlanetEntriesPager(
+            urlStrategy,
             null,
             null,    
             pagerUrl,
@@ -118,6 +119,7 @@
                 null, null, null, null, 0, false);
         
         return new PlanetEntriesPager(
+            urlStrategy,
             null,
             groupHandle,
             pagerUrl,
@@ -141,6 +143,7 @@
                 null, null, null, null, 0, false);
         
         return new PlanetEntriesPager(
+            urlStrategy,
             feedURL,
             null,
             pagerUrl,

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/PreviewPageModel.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/PreviewPageModel.java?view=diff&rev=553697&r1=553696&r2=553697
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/PreviewPageModel.java (original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/PreviewPageModel.java Thu Jul  5 19:14:56 2007
@@ -20,6 +20,8 @@
 
 import java.util.Map;
 import org.apache.roller.weblogger.WebloggerException;
+import org.apache.roller.weblogger.business.URLStrategy;
+import org.apache.roller.weblogger.business.WebloggerFactory;
 import org.apache.roller.weblogger.pojos.wrapper.WeblogEntryWrapper;
 import org.apache.roller.weblogger.ui.rendering.pagers.WeblogEntriesLatestPager;
 import org.apache.roller.weblogger.ui.rendering.pagers.WeblogEntriesPager;
@@ -34,6 +36,7 @@
 public class PreviewPageModel extends PageModel {
     
     private WeblogPreviewRequest previewRequest = null;
+    private URLStrategy urlStrategy = null;
     
     
     /** 
@@ -56,6 +59,12 @@
                     "  PreviewPageModel only supports preview requests.");
         }
         
+        // look for url strategy
+        urlStrategy = (URLStrategy) initData.get("urlStrategy");
+        if(urlStrategy == null) {
+            urlStrategy = WebloggerFactory.getWeblogger().getUrlStrategy();
+        }
+        
         super.init(initData);
     }    
     
@@ -70,7 +79,7 @@
         
         if(previewRequest.getPreviewEntry() != null ||
                 previewRequest.getWeblogAnchor() != null) {
-            return WeblogEntryWrapper.wrap(previewRequest.getWeblogEntry());
+            return WeblogEntryWrapper.wrap(previewRequest.getWeblogEntry(), urlStrategy);
         }
         return null;
     }
@@ -90,6 +99,7 @@
         
         if (anchor != null) {
             return new WeblogEntriesPreviewPager(
+                    urlStrategy,
                     previewRequest.getWeblog(),
                     previewRequest.getLocale(),
                     previewRequest.getWeblogPageName(),
@@ -100,6 +110,7 @@
                     previewRequest.getPageNum());
         } else {
             return new WeblogEntriesLatestPager(
+                    urlStrategy,
                     previewRequest.getWeblog(),
                     previewRequest.getLocale(),
                     previewRequest.getWeblogPageName(),

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/SearchResultsFeedModel.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/SearchResultsFeedModel.java?view=diff&rev=553697&r1=553696&r2=553697
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/SearchResultsFeedModel.java (original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/SearchResultsFeedModel.java Thu Jul  5 19:14:56 2007
@@ -117,7 +117,7 @@
         
         // if there is no query, then we are done
         if(feedRequest.getTerm() == null) {
-            pager = new SearchResultsFeedPager(pagerUrl, feedRequest.getPage(),
+            pager = new SearchResultsFeedPager(urlStrategy, pagerUrl, feedRequest.getPage(),
                     feedRequest, results, false);
             return;
         }
@@ -152,7 +152,7 @@
         }
         
         // search completed, setup pager based on results
-        pager = new SearchResultsFeedPager(pagerUrl, feedRequest.getPage(),
+        pager = new SearchResultsFeedPager(urlStrategy, pagerUrl, feedRequest.getPage(),
                 feedRequest, results, (hits > (offset+limit)));
     }
     
@@ -210,7 +210,7 @@
                 // or entry's user is not the requested user.
                 // but don't return future posts
                 if (entry != null && entry.getPubTime().before(now)) {
-                    results.add(WeblogEntryWrapper.wrap(entry));
+                    results.add(WeblogEntryWrapper.wrap(entry, urlStrategy));
                 }
             }
             
@@ -226,7 +226,7 @@
      * Get weblog being displayed.
      */
     public WeblogWrapper getWeblog() {
-        return WeblogWrapper.wrap(weblog);
+        return WeblogWrapper.wrap(weblog, urlStrategy);
     }
     
     public String getTerm() {
@@ -267,7 +267,7 @@
     
     public WeblogCategoryWrapper getWeblogCategory() {
         if(feedRequest.getWeblogCategory() != null) {
-            return WeblogCategoryWrapper.wrap(feedRequest.getWeblogCategory());
+            return WeblogCategoryWrapper.wrap(feedRequest.getWeblogCategory(), urlStrategy);
         }
         return null;
     }    

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/SearchResultsModel.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/SearchResultsModel.java?view=diff&rev=553697&r1=553696&r2=553697
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/SearchResultsModel.java (original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/SearchResultsModel.java Thu Jul  5 19:14:56 2007
@@ -45,6 +45,7 @@
 import org.apache.roller.weblogger.ui.rendering.pagers.WeblogEntriesPager;
 import org.apache.roller.weblogger.ui.rendering.util.WeblogSearchRequest;
 import org.apache.roller.util.DateUtil;
+import org.apache.roller.weblogger.business.URLStrategy;
 import org.apache.roller.weblogger.util.I18nMessages;
 
 
@@ -60,6 +61,7 @@
     
     // the original search request
     WeblogSearchRequest searchRequest = null;
+    private URLStrategy urlStrategy = null;
     
     // the actual search results mapped by Day -> Set of entries
     private TreeMap results = new TreeMap(new ReverseComparator());
@@ -83,12 +85,18 @@
             throw new WebloggerException("expected searchRequest from init data");
         }
         
+        // look for url strategy
+        urlStrategy = (URLStrategy) initData.get("urlStrategy");
+        if(urlStrategy == null) {
+            urlStrategy = WebloggerFactory.getWeblogger().getUrlStrategy();
+        }
+        
         // let parent initialize
         super.init(initData);
         
         // if there is no query, then we are done
         if(searchRequest.getQuery() == null) {
-            pager = new SearchResultsPager(searchRequest, results, false);
+            pager = new SearchResultsPager(urlStrategy, searchRequest, results, false);
             return;
         }
         
@@ -123,7 +131,7 @@
         }
         
         // search completed, setup pager based on results
-        pager = new SearchResultsPager(searchRequest, results, (hits > (offset+limit)));
+        pager = new SearchResultsPager(urlStrategy, searchRequest, results, (hits > (offset+limit)));
     }
     
     /**
@@ -193,7 +201,7 @@
                 // or entry's user is not the requested user.
                 // but don't return future posts
                 if (entry != null && entry.getPubTime().before(now)) {
-                    addEntryToResults(WeblogEntryWrapper.wrap(entry));
+                    addEntryToResults(WeblogEntryWrapper.wrap(entry, urlStrategy));
                 }
             }
             
@@ -261,7 +269,7 @@
     
     public WeblogCategoryWrapper getWeblogCategory() {
         if(searchRequest.getWeblogCategory() != null) {
-            return WeblogCategoryWrapper.wrap(searchRequest.getWeblogCategory());
+            return WeblogCategoryWrapper.wrap(searchRequest.getWeblogCategory(), urlStrategy);
         }
         return null;
     }

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/SiteModel.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/SiteModel.java?view=diff&rev=553697&r1=553696&r2=553697
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/SiteModel.java (original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/model/SiteModel.java Thu Jul  5 19:14:56 2007
@@ -127,6 +127,7 @@
         }
         
         return new WeblogEntriesListPager(
+            urlStrategy,
             pagerUrl, null, null, null,
             tags,
             weblogRequest.getLocale(),
@@ -183,6 +184,7 @@
         }
        
         return new WeblogEntriesListPager(
+            urlStrategy,
             pagerUrl, queryWeblog, user, cat,
             tags,
             weblogRequest.getLocale(),
@@ -213,6 +215,7 @@
         }
         
         return new CommentsPager(
+            urlStrategy,
             pagerUrl,
             null,
             weblogRequest.getLocale(),
@@ -241,6 +244,7 @@
         }
         
         return new UsersPager(
+            urlStrategy,
             pagerUrl,
             letter,
             weblogRequest.getLocale(),
@@ -262,6 +266,7 @@
         }
         
         return new WeblogsPager(
+            urlStrategy,
             pagerUrl,
             letter,
             weblogRequest.getLocale(),
@@ -320,7 +325,7 @@
             List perms = umgr.getAllPermissions(user);
             for (Iterator it = perms.iterator(); it.hasNext();) {
                 WeblogPermission perm = (WeblogPermission) it.next();
-                results.add(WeblogWrapper.wrap(perm.getWebsite()));
+                results.add(WeblogWrapper.wrap(perm.getWebsite(), urlStrategy));
             }
         } catch (Exception e) {
             log.error("ERROR: fetching weblog list", e);
@@ -373,7 +378,7 @@
             Weblogger roller = WebloggerFactory.getWeblogger();
             UserManager umgr = roller.getUserManager();
             Weblog website = umgr.getWebsiteByHandle(handle);
-            wrappedWebsite = WeblogWrapper.wrap(website);
+            wrappedWebsite = WeblogWrapper.wrap(website, urlStrategy);
         } catch (Exception e) {
             log.error("ERROR: fetching users by letter", e);
         }
@@ -402,7 +407,7 @@
                 null, Boolean.TRUE, Boolean.TRUE, startDate, null, 0, length);
             for (Iterator it = weblogs.iterator(); it.hasNext();) {
                 Weblog website = (Weblog) it.next();
-                results.add(WeblogWrapper.wrap(website));
+                results.add(WeblogWrapper.wrap(website, urlStrategy));
             }
         } catch (Exception e) {
             log.error("ERROR: fetching weblog list", e);
@@ -529,7 +534,7 @@
             List weblogs = wmgr.getWeblogEntriesPinnedToMain(new Integer(length));
             for (Iterator it = weblogs.iterator(); it.hasNext();) {
                 WeblogEntry entry = (WeblogEntry) it.next();
-                results.add(WeblogEntryWrapper.wrap(entry));
+                results.add(WeblogEntryWrapper.wrap(entry, urlStrategy));
             }
         } catch (Exception e) {
             log.error("ERROR: fetching pinned weblog entries", e);

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/AbstractPager.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/AbstractPager.java?view=diff&rev=553697&r1=553696&r2=553697
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/AbstractPager.java (original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/AbstractPager.java Thu Jul  5 19:14:56 2007
@@ -20,6 +20,7 @@
 
 import java.util.HashMap;
 import java.util.Map;
+import org.apache.roller.weblogger.business.URLStrategy;
 import org.apache.roller.weblogger.util.URLUtilities;
 
 
@@ -28,12 +29,14 @@
  */
 public abstract class AbstractPager implements Pager {
     
+    final URLStrategy urlStrategy;
     private String url = null;
     private int page = 0;
     
     
-    public AbstractPager(String baseUrl, int pageNum) {
+    public AbstractPager(URLStrategy strat, String baseUrl, int pageNum) {
         
+        this.urlStrategy = strat;
         this.url = baseUrl;
         if(pageNum > 0) {
             this.page = pageNum;

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/AbstractWeblogEntriesPager.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/AbstractWeblogEntriesPager.java?view=diff&rev=553697&r1=553696&r2=553697
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/AbstractWeblogEntriesPager.java (original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/AbstractWeblogEntriesPager.java Thu Jul  5 19:14:56 2007
@@ -31,6 +31,7 @@
 import org.apache.roller.weblogger.config.WebloggerRuntimeConfig;
 import org.apache.roller.weblogger.pojos.Weblog;
 import org.apache.roller.util.DateUtil;
+import org.apache.roller.weblogger.business.URLStrategy;
 import org.apache.roller.weblogger.business.WebloggerFactory;
 import org.apache.roller.weblogger.util.I18nMessages;
 
@@ -48,6 +49,9 @@
     // message utils for doing i18n messages
     I18nMessages messageUtils = null;
     
+    // url strategy for building urls
+    URLStrategy urlStrategy = null;
+    
     Weblog weblog = null;
     String locale = null;
     String pageLink = null;
@@ -61,7 +65,8 @@
     
     
     public AbstractWeblogEntriesPager(
-            Weblog        weblog,
+            URLStrategy        strat,
+            Weblog             weblog,
             String             locale,
             String             pageLink,
             String             entryAnchor,
@@ -70,6 +75,8 @@
             List               tags,
             int                page) {
         
+        this.urlStrategy = strat;
+        
         this.weblog = weblog;
         this.locale = locale;
         this.pageLink = pageLink;
@@ -236,12 +243,12 @@
         int pageNum = page + pageAdd;
         
         if (pageLink != null) {
-            return WebloggerFactory.getWeblogger().getUrlStrategy().getWeblogPageURL(website, locale, pageLink, entryAnchor, catPath, dateString, tags, pageNum, false);
+            return urlStrategy.getWeblogPageURL(website, locale, pageLink, entryAnchor, catPath, dateString, tags, pageNum, false);
         } else if (entryAnchor != null) {
-            return WebloggerFactory.getWeblogger().getUrlStrategy().getWeblogEntryURL(website, locale, entryAnchor, true);
+            return urlStrategy.getWeblogEntryURL(website, locale, entryAnchor, true);
         }
         
-        return WebloggerFactory.getWeblogger().getUrlStrategy().getWeblogCollectionURL(website, locale, catPath, dateString, tags, pageNum, false);
+        return urlStrategy.getWeblogCollectionURL(website, locale, catPath, dateString, tags, pageNum, false);
     }
     
 }

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/CommentsPager.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/CommentsPager.java?view=diff&rev=553697&r1=553696&r2=553697
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/CommentsPager.java (original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/CommentsPager.java Thu Jul  5 19:14:56 2007
@@ -25,6 +25,7 @@
 import java.util.List;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.roller.weblogger.business.URLStrategy;
 import org.apache.roller.weblogger.business.Weblogger;
 import org.apache.roller.weblogger.business.WebloggerFactory;
 import org.apache.roller.weblogger.business.WeblogManager;
@@ -53,6 +54,7 @@
     
     
     public CommentsPager(
+            URLStrategy    strat,
             String         baseUrl,
             Weblog         weblog,
             String         locale,
@@ -60,7 +62,7 @@
             int            page,
             int            length) {
         
-        super(baseUrl, page);
+        super(strat, baseUrl, page);
         
         this.weblog = weblog;
         this.locale = locale;
@@ -103,7 +105,7 @@
                 // wrap the results
                 for (Iterator it = entries.iterator(); it.hasNext();) {
                     WeblogEntryComment comment = (WeblogEntryComment) it.next();
-                    results.add(WeblogEntryCommentWrapper.wrap(comment));
+                    results.add(WeblogEntryCommentWrapper.wrap(comment, urlStrategy));
                 }
                 
             } catch (Exception e) {

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/PlanetEntriesPager.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/PlanetEntriesPager.java?view=diff&rev=553697&r1=553696&r2=553697
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/PlanetEntriesPager.java (original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/PlanetEntriesPager.java Thu Jul  5 19:14:56 2007
@@ -20,7 +20,6 @@
 
 import java.util.ArrayList;
 import java.util.Calendar;
-import java.util.Collections;
 import java.util.Date;
 import java.util.Iterator;
 import java.util.List;
@@ -32,6 +31,7 @@
 import org.apache.roller.planet.pojos.SubscriptionEntry;
 import org.apache.roller.planet.pojos.PlanetGroup;
 import org.apache.roller.planet.pojos.Subscription;
+import org.apache.roller.weblogger.business.URLStrategy;
 
 
 /**
@@ -55,6 +55,7 @@
     
     
     public PlanetEntriesPager(
+            URLStrategy    strat,
             String         feedURL,
             String         groupHandle,
             String         baseUrl,
@@ -63,7 +64,7 @@
             int            page,
             int            length) {
         
-        super(baseUrl, page);
+        super(strat, baseUrl, page);
         
         this.feedURL = feedURL;
         this.groupHandle = groupHandle;

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/SearchResultsFeedPager.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/SearchResultsFeedPager.java?view=diff&rev=553697&r1=553696&r2=553697
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/SearchResultsFeedPager.java (original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/SearchResultsFeedPager.java Thu Jul  5 19:14:56 2007
@@ -22,6 +22,7 @@
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
+import org.apache.roller.weblogger.business.URLStrategy;
 import org.apache.roller.weblogger.business.WebloggerFactory;
 import org.apache.roller.weblogger.pojos.Weblog;
 import org.apache.roller.weblogger.ui.rendering.util.WeblogFeedRequest;
@@ -47,10 +48,10 @@
     private String url = null;
     
             
-    public SearchResultsFeedPager(String baseUrl, int pageNum,
+    public SearchResultsFeedPager(URLStrategy strat, String baseUrl, int pageNum,
             WeblogFeedRequest feedRequest, List entries, boolean more) {
         
-        super(baseUrl, pageNum);
+        super(strat, baseUrl, pageNum);
         
         this.url = baseUrl;
         
@@ -89,7 +90,7 @@
     }
     
     public String getHomeLink() {
-        return WebloggerFactory.getWeblogger().getUrlStrategy().getWeblogURL(weblog, weblog.getLocale(), false);
+        return urlStrategy.getWeblogURL(weblog, weblog.getLocale(), false);
     }
 
     public String getHomeName() {

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/SearchResultsPager.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/SearchResultsPager.java?view=diff&rev=553697&r1=553696&r2=553697
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/SearchResultsPager.java (original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/SearchResultsPager.java Thu Jul  5 19:14:56 2007
@@ -20,7 +20,7 @@
 
 import java.util.Locale;
 import java.util.Map;
-import org.apache.roller.weblogger.business.WebloggerFactory;
+import org.apache.roller.weblogger.business.URLStrategy;
 import org.apache.roller.weblogger.pojos.Weblog;
 import org.apache.roller.weblogger.ui.rendering.util.WeblogSearchRequest;
 import org.apache.roller.weblogger.util.I18nMessages;
@@ -33,6 +33,9 @@
     // message utils for doing i18n messages
     I18nMessages messageUtils = null;
     
+    // url strategy
+    URLStrategy urlStrategy = null;
+    
     private Map entries = null;
     
     private Weblog weblog = null;
@@ -45,7 +48,10 @@
     
     public SearchResultsPager() {}
     
-    public SearchResultsPager(WeblogSearchRequest searchRequest, Map entries, boolean more) {
+    public SearchResultsPager(URLStrategy strat, WeblogSearchRequest searchRequest, Map entries, boolean more) {
+        
+        // url strategy for building urls
+        this.urlStrategy = strat;
         
         // store search results
         this.entries = entries;
@@ -82,7 +88,7 @@
     
     
     public String getHomeLink() {
-        return WebloggerFactory.getWeblogger().getUrlStrategy().getWeblogURL(weblog, locale, false);
+        return urlStrategy.getWeblogURL(weblog, locale, false);
     }
 
     public String getHomeName() {
@@ -92,7 +98,7 @@
     
     public String getNextLink() {
         if(moreResults) {
-            return WebloggerFactory.getWeblogger().getUrlStrategy().getWeblogSearchURL(weblog, locale, query, category, page + 1, false);
+            return urlStrategy.getWeblogSearchURL(weblog, locale, query, category, page + 1, false);
         }
         return null;
     }
@@ -106,7 +112,7 @@
 
     public String getPrevLink() {
         if(page > 0) {
-            return WebloggerFactory.getWeblogger().getUrlStrategy().getWeblogSearchURL(weblog, locale, query, category, page - 1, false);
+            return urlStrategy.getWeblogSearchURL(weblog, locale, query, category, page - 1, false);
         }
         return null;
     }

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/UsersPager.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/UsersPager.java?view=diff&rev=553697&r1=553696&r2=553697
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/UsersPager.java (original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/UsersPager.java Thu Jul  5 19:14:56 2007
@@ -25,6 +25,7 @@
 import java.util.Map;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.roller.weblogger.business.URLStrategy;
 import org.apache.roller.weblogger.business.Weblogger;
 import org.apache.roller.weblogger.business.WebloggerFactory;
 import org.apache.roller.weblogger.business.UserManager;
@@ -52,13 +53,14 @@
     
     
     public UsersPager(
+            URLStrategy    strat,
             String         baseUrl,
             String         locale,
             int            sinceDays,
             int            page,
             int            length) {
         
-        super(baseUrl, page);
+        super(strat, baseUrl, page);
         
         this.locale = locale;
         this.sinceDays = sinceDays;
@@ -70,6 +72,7 @@
     
     
     public UsersPager(
+            URLStrategy    strat,
             String         baseUrl,
             String         letter,
             String         locale,
@@ -77,7 +80,7 @@
             int            page,
             int            length) {
         
-        super(baseUrl, page);
+        super(strat, baseUrl, page);
         
         this.letter = letter;
         this.locale = locale;

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesDayPager.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesDayPager.java?view=diff&rev=553697&r1=553696&r2=553697
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesDayPager.java (original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesDayPager.java Thu Jul  5 19:14:56 2007
@@ -36,7 +36,7 @@
 import org.apache.roller.weblogger.pojos.Weblog;
 import org.apache.roller.weblogger.pojos.wrapper.WeblogEntryWrapper;
 import org.apache.roller.util.DateUtil;
-import org.apache.roller.weblogger.util.I18nMessages;
+import org.apache.roller.weblogger.business.URLStrategy;
 
 
 /**
@@ -60,7 +60,8 @@
     
     
     public WeblogEntriesDayPager(
-            Weblog        weblog,
+            URLStrategy        strat,
+            Weblog             weblog,
             String             locale,
             String             pageLink,
             String             entryAnchor,
@@ -69,7 +70,7 @@
             List               tags,
             int                page) {
         
-        super(weblog, locale, pageLink, entryAnchor, dateString, catPath, tags, page);
+        super(strat, weblog, locale, pageLink, entryAnchor, dateString, catPath, tags, page);
         
         dayFormat = new SimpleDateFormat(
             messageUtils.getString("weblogEntriesPager.day.dateFormat"));
@@ -139,7 +140,7 @@
                     List unwrapped = (List) mmap.get(key);
                     for(int i=0; i < unwrapped.size(); i++) {
                         if (count++ < length) {
-                            wrapped.add(i,WeblogEntryWrapper.wrap((WeblogEntry)unwrapped.get(i)));
+                            wrapped.add(i,WeblogEntryWrapper.wrap((WeblogEntry)unwrapped.get(i), urlStrategy));
                         } else {
                             more = true;
                         }

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesLatestPager.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesLatestPager.java?view=diff&rev=553697&r1=553696&r2=553697
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesLatestPager.java (original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesLatestPager.java Thu Jul  5 19:14:56 2007
@@ -27,12 +27,11 @@
 import org.apache.commons.collections.comparators.ReverseComparator;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.roller.weblogger.business.URLStrategy;
 import org.apache.roller.weblogger.business.Weblogger;
 import org.apache.roller.weblogger.business.WebloggerFactory;
 import org.apache.roller.weblogger.business.WeblogManager;
-import org.apache.roller.weblogger.pojos.WeblogCategory;
 import org.apache.roller.weblogger.pojos.WeblogEntry;
-import org.apache.roller.weblogger.pojos.WeblogTemplate;
 import org.apache.roller.weblogger.pojos.Weblog;
 import org.apache.roller.weblogger.pojos.wrapper.WeblogEntryWrapper;
 
@@ -52,7 +51,8 @@
     
     
     public WeblogEntriesLatestPager(
-            Weblog        weblog,
+            URLStrategy        strat,
+            Weblog             weblog,
             String             locale,
             String             pageLink,
             String             entryAnchor,
@@ -61,7 +61,7 @@
             List               tags,
             int                page) {
         
-        super(weblog, locale, pageLink, entryAnchor, dateString, catPath, tags, page);
+        super(strat, weblog, locale, pageLink, entryAnchor, dateString, catPath, tags, page);
         
         // initialize the pager collection
         getEntries();
@@ -98,7 +98,7 @@
                     List unwrapped= (List) mmap.get(key);
                     for(int i=0; i < unwrapped.size(); i++) {
                         if (count++ < length) {
-                            wrapped.add(i,WeblogEntryWrapper.wrap((WeblogEntry)unwrapped.get(i)));
+                            wrapped.add(i,WeblogEntryWrapper.wrap((WeblogEntry)unwrapped.get(i), urlStrategy));
                         } else {
                             more = true;
                         }

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesListPager.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesListPager.java?view=diff&rev=553697&r1=553696&r2=553697
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesListPager.java (original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesListPager.java Thu Jul  5 19:14:56 2007
@@ -25,6 +25,7 @@
 import java.util.List;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.roller.weblogger.business.URLStrategy;
 import org.apache.roller.weblogger.business.Weblogger;
 import org.apache.roller.weblogger.business.WebloggerFactory;
 import org.apache.roller.weblogger.business.UserManager;
@@ -59,9 +60,10 @@
     
     
     public WeblogEntriesListPager(
+            URLStrategy    strat,
             String         baseUrl,
-            Weblog    queryWeblog,
-            User       queryUser,
+            Weblog         queryWeblog,
+            User           queryUser,
             String         queryCat,
             List           queryTags,
             String         locale,
@@ -69,7 +71,7 @@
             int            pageNum,
             int            length) {
         
-        super(baseUrl, pageNum);
+        super(strat, baseUrl, pageNum);
         
         // store the data
         this.queryWeblog = queryWeblog;
@@ -125,7 +127,7 @@
                 for (Iterator it = rawEntries.iterator(); it.hasNext();) {
                     WeblogEntry entry = (WeblogEntry) it.next();
                     if (count++ < length) {
-                        results.add(WeblogEntryWrapper.wrap(entry));
+                        results.add(WeblogEntryWrapper.wrap(entry, urlStrategy));
                     }
                 }
                 if (rawEntries.size() > length) more = true;

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesMonthPager.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesMonthPager.java?view=diff&rev=553697&r1=553696&r2=553697
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesMonthPager.java (original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesMonthPager.java Thu Jul  5 19:14:56 2007
@@ -34,7 +34,7 @@
 import org.apache.roller.weblogger.pojos.Weblog;
 import org.apache.roller.weblogger.pojos.wrapper.WeblogEntryWrapper;
 import org.apache.roller.util.DateUtil;
-import org.apache.roller.weblogger.util.I18nMessages;
+import org.apache.roller.weblogger.business.URLStrategy;
 
 
 /**
@@ -58,7 +58,8 @@
     
     
     public WeblogEntriesMonthPager(
-            Weblog        weblog,
+            URLStrategy        strat,
+            Weblog             weblog,
             String             locale,
             String             pageLink,
             String             entryAnchor,
@@ -67,7 +68,7 @@
             List               tags,
             int                page) {
         
-        super(weblog, locale, pageLink, entryAnchor, dateString, catPath, tags, page);
+        super(strat, weblog, locale, pageLink, entryAnchor, dateString, catPath, tags, page);
         
         monthFormat = new SimpleDateFormat(
             messageUtils.getString("weblogEntriesPager.month.dateFormat"));
@@ -131,7 +132,7 @@
                     List unwrapped= (List) mmap.get(key);
                     for(int i=0; i < unwrapped.size(); i++) {
                         if (count++ < length) {
-                            wrapped.add(i,WeblogEntryWrapper.wrap((WeblogEntry)unwrapped.get(i)));
+                            wrapped.add(i,WeblogEntryWrapper.wrap((WeblogEntry)unwrapped.get(i), urlStrategy));
                         } else {
                             more = true;
                         }

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesPermalinkPager.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesPermalinkPager.java?view=diff&rev=553697&r1=553696&r2=553697
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesPermalinkPager.java (original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesPermalinkPager.java Thu Jul  5 19:14:56 2007
@@ -18,7 +18,6 @@
 
 package org.apache.roller.weblogger.ui.rendering.pagers;
 
-import java.text.MessageFormat;
 import java.util.Collections;
 import java.util.Date;
 import java.util.List;
@@ -27,13 +26,13 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.roller.weblogger.WebloggerException;
+import org.apache.roller.weblogger.business.URLStrategy;
 import org.apache.roller.weblogger.business.Weblogger;
 import org.apache.roller.weblogger.business.WebloggerFactory;
 import org.apache.roller.weblogger.business.WeblogManager;
 import org.apache.roller.weblogger.pojos.WeblogEntry;
 import org.apache.roller.weblogger.pojos.Weblog;
 import org.apache.roller.weblogger.pojos.wrapper.WeblogEntryWrapper;
-import org.apache.roller.weblogger.util.I18nMessages;
 import org.apache.roller.weblogger.util.Utilities;
 
 
@@ -53,7 +52,8 @@
     
     
     public WeblogEntriesPermalinkPager(
-            Weblog        weblog,
+            URLStrategy        strat,
+            Weblog             weblog,
             String             locale,
             String             pageLink,
             String             entryAnchor,
@@ -62,7 +62,7 @@
             List               tags,
             int                page) {
         
-        super(weblog, locale, pageLink, entryAnchor, dateString, catPath, tags, page);
+        super(strat, weblog, locale, pageLink, entryAnchor, dateString, catPath, tags, page);
         
         getEntries();
     }
@@ -75,7 +75,7 @@
             currEntry = wmgr.getWeblogEntryByAnchor(weblog, entryAnchor);
             if (currEntry != null && currEntry.getStatus().equals(WeblogEntry.PUBLISHED)) {
                 entries = new TreeMap();
-                entries.put(new Date(currEntry.getPubTime().getTime()),Collections.singletonList(WeblogEntryWrapper.wrap(currEntry)));
+                entries.put(new Date(currEntry.getPubTime().getTime()),Collections.singletonList(WeblogEntryWrapper.wrap(currEntry, urlStrategy)));
             }
         } catch (Exception e) {
             log.error("ERROR: fetching entry");

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesPreviewPager.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesPreviewPager.java?view=diff&rev=553697&r1=553696&r2=553697
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesPreviewPager.java (original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogEntriesPreviewPager.java Thu Jul  5 19:14:56 2007
@@ -20,12 +20,12 @@
 
 import java.sql.Timestamp;
 import java.util.Collections;
-import java.util.Date;
 import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.roller.weblogger.business.URLStrategy;
 import org.apache.roller.weblogger.business.Weblogger;
 import org.apache.roller.weblogger.business.WebloggerFactory;
 import org.apache.roller.weblogger.business.WeblogManager;
@@ -47,7 +47,8 @@
     
     
     public WeblogEntriesPreviewPager(
-            Weblog        weblog,
+            URLStrategy        strat,
+            Weblog             weblog,
             String             locale,
             String             pageLink,
             String             entryAnchor,
@@ -56,7 +57,7 @@
             List               tags,
             int                page) {
         
-        super(weblog, locale, pageLink, entryAnchor, dateString, catPath, tags, page);
+        super(strat, weblog, locale, pageLink, entryAnchor, dateString, catPath, tags, page);
     }
     
     
@@ -78,7 +79,7 @@
                 
                 // store the entry in the collection
                 entries = new TreeMap();
-                entries.put(tmpEntry.getPubTime(),Collections.singletonList(WeblogEntryWrapper.wrap(tmpEntry)));
+                entries.put(tmpEntry.getPubTime(),Collections.singletonList(WeblogEntryWrapper.wrap(tmpEntry, urlStrategy)));
             }
         } catch (Exception e) {
             log.error("ERROR: fetching entry", e);

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogsPager.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogsPager.java?view=diff&rev=553697&r1=553696&r2=553697
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogsPager.java (original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/pagers/WeblogsPager.java Thu Jul  5 19:14:56 2007
@@ -27,6 +27,7 @@
 import java.util.Map;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.roller.weblogger.business.URLStrategy;
 import org.apache.roller.weblogger.business.Weblogger;
 import org.apache.roller.weblogger.business.WebloggerFactory;
 import org.apache.roller.weblogger.business.UserManager;
@@ -54,13 +55,14 @@
     
     
     public WeblogsPager(
+            URLStrategy    strat,
             String         baseUrl,
             String         locale,
             int            sinceDays,
             int            page,
             int            length) {
         
-        super(baseUrl, page);
+        super(strat, baseUrl, page);
         
         this.locale = locale;
         this.sinceDays = sinceDays;
@@ -72,6 +74,7 @@
     
     
     public WeblogsPager(
+            URLStrategy    strat,
             String         baseUrl,
             String         letter,
             String         locale,
@@ -79,7 +82,7 @@
             int            page,
             int            length) {
         
-        super(baseUrl, page);
+        super(strat, baseUrl, page);
         
         this.letter = letter;
         this.locale = locale;
@@ -161,7 +164,7 @@
                 // wrap the results
                 for (Iterator it = weblogs.iterator(); it.hasNext();) {
                     Weblog website = (Weblog) it.next();
-                    results.add(WeblogWrapper.wrap(website));
+                    results.add(WeblogWrapper.wrap(website, urlStrategy));
                 }
                 
             } catch (Exception e) {

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/servlets/PageServlet.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/servlets/PageServlet.java?view=diff&rev=553697&r1=553696&r2=553697
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/servlets/PageServlet.java (original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/servlets/PageServlet.java Thu Jul  5 19:14:56 2007
@@ -411,7 +411,7 @@
             ModelLoader.loadCustomModels(weblog, model, initData);
             
             // ick, gotta load pre-3.0 model stuff as well :(
-            ModelLoader.loadOldModels(model, request, response, pageContext, pageRequest);
+            ModelLoader.loadOldModels(model, request, response, pageContext, pageRequest, WebloggerFactory.getWeblogger().getUrlStrategy());
             
         } catch (WebloggerException ex) {
             log.error("Error loading model objects for page", ex);

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/servlets/PreviewServlet.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/servlets/PreviewServlet.java?view=diff&rev=553697&r1=553696&r2=553697
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/servlets/PreviewServlet.java (original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/servlets/PreviewServlet.java Thu Jul  5 19:14:56 2007
@@ -187,7 +187,7 @@
             ModelLoader.loadCustomModels(weblog, model, initData);
             
             // ick, gotta load pre-3.0 model stuff as well :(
-            ModelLoader.loadOldModels(model, request, response, pageContext, previewRequest);
+            ModelLoader.loadOldModels(model, request, response, pageContext, previewRequest, WebloggerFactory.getWeblogger().getUrlStrategy().getPreviewURLStrategy(previewRequest.getThemeName()));
             
         } catch (WebloggerException ex) {
             log.error("ERROR loading model for page", ex);

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/servlets/SearchServlet.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/servlets/SearchServlet.java?view=diff&rev=553697&r1=553696&r2=553697
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/servlets/SearchServlet.java (original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/servlets/SearchServlet.java Thu Jul  5 19:14:56 2007
@@ -160,7 +160,7 @@
             ModelLoader.loadCustomModels(weblog, model, initData);
             
             // ick, gotta load pre-3.0 model stuff as well :(
-            ModelLoader.loadOldModels(model, request, response, pageContext, pageRequest);
+            ModelLoader.loadOldModels(model, request, response, pageContext, pageRequest, WebloggerFactory.getWeblogger().getUrlStrategy());
             
             // manually add search model again to support pre-3.0 weblogs
             Model searchModel = new SearchResultsModel();

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/util/WeblogEntryCommentForm.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/util/WeblogEntryCommentForm.java?view=diff&rev=553697&r1=553696&r2=553697
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/util/WeblogEntryCommentForm.java (original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/util/WeblogEntryCommentForm.java Thu Jul  5 19:14:56 2007
@@ -62,7 +62,8 @@
     }
     
     public WeblogEntryCommentWrapper getPreviewComment() {
-        return WeblogEntryCommentWrapper.wrap(previewComment);
+        // NOTE: no need for url strategy when wrapping preview comment
+        return WeblogEntryCommentWrapper.wrap(previewComment, null);
     }
     
     public boolean isPreview() {

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/velocity/deprecated/ContextLoader.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/velocity/deprecated/ContextLoader.java?view=diff&rev=553697&r1=553696&r2=553697
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/velocity/deprecated/ContextLoader.java (original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/velocity/deprecated/ContextLoader.java Thu Jul  5 19:14:56 2007
@@ -49,6 +49,7 @@
 import org.apache.roller.weblogger.ui.rendering.util.WeblogPageRequest;
 import org.apache.roller.util.DateUtil;
 import org.apache.roller.util.RegexUtil;
+import org.apache.roller.weblogger.business.URLStrategy;
 
 
 /**
@@ -99,7 +100,8 @@
             HttpServletRequest  request,
             HttpServletResponse response,
             PageContext pageContext,
-            WeblogPageRequest pageRequest) throws WebloggerException {
+            WeblogPageRequest pageRequest,
+            URLStrategy urlStrategy) throws WebloggerException {
         
         mLogger.debug("setupContext( ctx = "+ctx+")");
         
@@ -155,7 +157,8 @@
         try {
             // Add old page model object to context
             OldWeblogPageModel pageModel = new OldWeblogPageModel();
-            pageModel.init(request,
+            pageModel.init(urlStrategy,
+                    request,
                     weblog,
                     entry,
                     category,
@@ -185,8 +188,8 @@
         ctx.put("pageHelper", pageHelper);
         
         // Load standard Weblogger objects and values into the context
-        loadWeblogValues(ctx, weblog, pageRequest.getLocaleInstance(), request);
-        loadPathValues(ctx, request, weblog, locale);
+        loadWeblogValues(ctx, weblog, pageRequest.getLocaleInstance(), request, urlStrategy);
+        loadPathValues(ctx, request, weblog, locale, urlStrategy);
         loadRssValues(ctx, request, weblog, category);
         loadUtilityObjects(ctx, request, weblog, page);
         loadRequestParamKeys(ctx);
@@ -194,7 +197,7 @@
         
         // If single entry is specified, load comments too
         if (entry != null) {
-            loadCommentValues(ctx, request, entry);
+            loadCommentValues(ctx, request, entry, urlStrategy);
         }
     }
     
@@ -206,7 +209,8 @@
             Map ctx,
             Weblog weblog,
             Locale locale,
-            HttpServletRequest request) throws WebloggerException {
+            HttpServletRequest request,
+            URLStrategy urlStrategy) throws WebloggerException {
         
         // weblog cannot be null
         if(weblog == null)
@@ -227,7 +231,7 @@
         // setup Timezone for future rendering
         ctx.put("timezone", weblog.getTimeZoneInstance());
         ctx.put("timeZone", weblog.getTimeZoneInstance());
-        ctx.put("website",WeblogWrapper.wrap(weblog) );
+        ctx.put("website",WeblogWrapper.wrap(weblog, urlStrategy) );
         
         String siteName = ((RuntimeConfigProperty)props.get("site.name")).getValue();
         if ("Roller-based Site".equals(siteName)) siteName = "Main";
@@ -268,9 +272,10 @@
      * Load comments for one weblog entry and related objects.
      */
     private static void loadCommentValues(
-            
             Map ctx,
-            HttpServletRequest request,WeblogEntry entry) throws WebloggerException {
+            HttpServletRequest request,
+            WeblogEntry entry,
+            URLStrategy urlStrategy) throws WebloggerException {
         
         mLogger.debug("Loading comment values");
         
@@ -304,7 +309,7 @@
         }
         
         if (entry.getStatus().equals(WeblogEntry.PUBLISHED)) {
-            ctx.put("entry",WeblogEntryWrapper.wrap(entry));
+            ctx.put("entry",WeblogEntryWrapper.wrap(entry, urlStrategy));
         }
     }
     
@@ -396,13 +401,14 @@
             Map ctx,
             HttpServletRequest request,
             Weblog   website,
-            String locale) throws WebloggerException {
+            String locale,
+            URLStrategy urlStrategy) throws WebloggerException {
         
         mLogger.debug("Loading path values");
         
         String url = null;
         if (website != null  && !"zzz_none_zzz".equals(website.getHandle())) {
-            url = WebloggerFactory.getWeblogger().getUrlStrategy().getWeblogURL(website, locale, true);
+            url = urlStrategy.getWeblogURL(website, locale, true);
         } else {
             url= WebloggerRuntimeConfig.getAbsoluteContextURL();
         }



Mime
View raw message