roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agillil...@apache.org
Subject svn commit: r415871 - in /incubator/roller/branches/roller_3.0/src/org/apache/roller/ui: authoring/struts/actions/ authoring/tags/ rendering/model/ rendering/velocity/deprecated/
Date Wed, 21 Jun 2006 01:57:47 GMT
Author: agilliland
Date: Tue Jun 20 18:57:47 2006
New Revision: 415871

URL: http://svn.apache.org/viewvc?rev=415871&view=rev
Log:
starting to refactor rendering code to remove dependency on RollerRequest.

- weblog calendar tags no longer need RollerRequest.
- OldPageHelper has minimal dependencies left.


Modified:
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/struts/actions/WeblogEntryPageModel.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/tags/BigWeblogCalendarModel.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/tags/EditWeblogCalendarModel.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/tags/WeblogCalendarModel.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/CalendarHelper.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/velocity/deprecated/ContextLoader.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/velocity/deprecated/OldPageHelper.java

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/struts/actions/WeblogEntryPageModel.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/struts/actions/WeblogEntryPageModel.java?rev=415871&r1=415870&r2=415871&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/struts/actions/WeblogEntryPageModel.java
(original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/struts/actions/WeblogEntryPageModel.java
Tue Jun 20 18:57:47 2006
@@ -261,7 +261,8 @@
 
         // Setup weblog calendar model
         CalendarModel model = new EditWeblogCalendarModel(
-                rollerRequest, getResponse(), selfUrl );
+                rollerRequest.getRequest(), getResponse(), 
+                rollerRequest.getWebsite(), rollerRequest.getDate(true), selfUrl );
         return model;
     }
 

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/tags/BigWeblogCalendarModel.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/tags/BigWeblogCalendarModel.java?rev=415871&r1=415870&r2=415871&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/tags/BigWeblogCalendarModel.java
(original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/tags/BigWeblogCalendarModel.java
Tue Jun 20 18:57:47 2006
@@ -21,6 +21,7 @@
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
+import javax.servlet.http.HttpServletRequest;
 
 import javax.servlet.http.HttpServletResponse;
 
@@ -30,6 +31,7 @@
 import org.apache.roller.model.RollerFactory;
 import org.apache.roller.model.WeblogManager;
 import org.apache.roller.pojos.WeblogEntryData;
+import org.apache.roller.pojos.WebsiteData;
 import org.apache.roller.ui.core.RollerContext;
 import org.apache.roller.ui.core.RollerRequest;
 import org.apache.roller.util.DateUtil;
@@ -55,10 +57,10 @@
      * @param url
      * @param cat
      */
-    public BigWeblogCalendarModel(RollerRequest rreq, HttpServletResponse res, 
-                                  String url, String cat)
+    public BigWeblogCalendarModel(HttpServletRequest req, HttpServletResponse res, 
+                                  WebsiteData website, Date date, String url, String cat)
     {
-        super(rreq, res, url, cat);
+        super(req, res, website, date, url, cat);
     }
     
     /**
@@ -71,7 +73,7 @@
         {
             WeblogManager mgr = RollerFactory.getRoller().getWeblogManager();
             mMonthMap = mgr.getWeblogEntryObjectMap(
-                            mRollerReq.getWebsite(),   // website
+                            mWebsite,                  // website
                             startDate,                 // startDate
                             endDate,                   // endDate
                             catName,                   // catName

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/tags/EditWeblogCalendarModel.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/tags/EditWeblogCalendarModel.java?rev=415871&r1=415870&r2=415871&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/tags/EditWeblogCalendarModel.java
(original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/tags/EditWeblogCalendarModel.java
Tue Jun 20 18:57:47 2006
@@ -18,7 +18,10 @@
 
 package org.apache.roller.ui.authoring.tags;
 
+import java.util.Date;
+import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import org.apache.roller.pojos.WebsiteData;
 
 import org.apache.roller.ui.core.RollerRequest;
 import org.apache.roller.ui.core.tags.menu.RollerMenuModel;
@@ -36,10 +39,10 @@
      * @param resp
      * @param selfUrl
      * @param queryString  */    
-	public EditWeblogCalendarModel(
-        RollerRequest rreq,  HttpServletResponse res, String url)
+	public EditWeblogCalendarModel(HttpServletRequest req,  
+                HttpServletResponse res, WebsiteData website, Date date, String url)
 	{
-        super( rreq, res, url, null );
+        super( req, res, website, date, url, null );
 	}
     
     /** 

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/tags/WeblogCalendarModel.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/tags/WeblogCalendarModel.java?rev=415871&r1=415870&r2=415871&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/tags/WeblogCalendarModel.java
(original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/tags/WeblogCalendarModel.java
Tue Jun 20 18:57:47 2006
@@ -35,6 +35,7 @@
 import org.apache.roller.model.RollerFactory;
 import org.apache.roller.model.WeblogManager;
 import org.apache.roller.pojos.WeblogEntryData;
+import org.apache.roller.pojos.WebsiteData;
 import org.apache.roller.ui.core.RollerRequest;
 import org.apache.roller.ui.core.tags.calendar.CalendarModel;
 import org.apache.roller.util.DateUtil;
@@ -47,7 +48,6 @@
     private static Log mLogger = 
         LogFactory.getFactory().getInstance(WeblogCalendarModel.class);
     
-    protected RollerRequest       mRollerReq = null;
 	protected HttpServletRequest  mReq = null;
 	protected HttpServletResponse mRes = null;
 	protected Map                 mMonthMap;
@@ -55,16 +55,18 @@
     protected Date                mDay;
     protected String              mCatName = null;
     protected Calendar            mCalendar = null;
+    protected WebsiteData         mWebsite = null;
+    
 
-	public WeblogCalendarModel(
-        RollerRequest rreq, HttpServletResponse res, String url, String cat)
+	public WeblogCalendarModel(HttpServletRequest req, HttpServletResponse res, 
+                WebsiteData website, Date date, String url, String cat)
 	{
-        mRollerReq = rreq;
-		mReq = rreq.getRequest();
+		mReq = req;
 		mRes = res;
-        mSelfUrl = url;
+                mWebsite = website;
+                mSelfUrl = url;
         
-        setDay( mRollerReq.getDate(true) );
+        setDay( date );
         
         // If category is specified in URL, then perpetuate it
         String catKey = RollerRequest.WEBLOGCATEGORYNAME_KEY;
@@ -107,8 +109,8 @@
             mReq.getParameter(RollerRequest.WEBLOGCATEGORYNAME_KEY);
 
         mCalendar = Calendar.getInstance(
-                                mRollerReq.getWebsite().getTimeZoneInstance(),
-                                mRollerReq.getWebsite().getLocaleInstance()
+                                mWebsite.getTimeZoneInstance(),
+                                mWebsite.getLocaleInstance()
         );   
         
         Calendar cal = (Calendar)mCalendar.clone();
@@ -143,7 +145,7 @@
         {
             WeblogManager mgr = RollerFactory.getRoller().getWeblogManager();
             mMonthMap = mgr.getWeblogEntryStringMap(
-                            mRollerReq.getWebsite(),   // website
+                            mWebsite,                  // website
                             startDate,                 // startDate
                             endDate,                   // endDate
                             catName,                   // catName
@@ -225,7 +227,7 @@
         }
         catch (Exception e)
         {
-           mRollerReq.getServletContext().log("ERROR: creating URL",e);
+           mLogger.error("ERROR: creating URL",e);
         }
         return url;
     } 

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/CalendarHelper.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/CalendarHelper.java?rev=415871&r1=415870&r2=415871&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/CalendarHelper.java
(original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/CalendarHelper.java
Tue Jun 20 18:57:47 2006
@@ -17,7 +17,7 @@
  */
 package org.apache.roller.ui.rendering.model;
 
-import java.util.Map;
+import java.util.Date;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.jsp.PageContext;
@@ -56,6 +56,7 @@
         RollerRequest rreq = RollerRequest.getRollerRequest(request);
         WebsiteData weblog = rreq.getWebsite();
         String pageLink = rreq.getPageLink();
+        Date date = rreq.getDate(true);
         
         if ("nil".equals(cat)) cat = null;        
         String ret = null;
@@ -70,9 +71,9 @@
 
             CalendarModel model = null;
             if (big) {
-                model = new BigWeblogCalendarModel(rreq, response, selfUrl, cat);
+                model = new BigWeblogCalendarModel(request, response, weblog, date, selfUrl,
cat);
             } else {
-                model = new WeblogCalendarModel(rreq, response, selfUrl, cat);
+                model = new WeblogCalendarModel(request, response, weblog, date, selfUrl,
cat);
             }
             
             // save model in JSP page context so CalendarTag can find it

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/velocity/deprecated/ContextLoader.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/velocity/deprecated/ContextLoader.java?rev=415871&r1=415870&r2=415871&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/velocity/deprecated/ContextLoader.java
(original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/velocity/deprecated/ContextLoader.java
Tue Jun 20 18:57:47 2006
@@ -31,7 +31,7 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
-
+import javax.servlet.jsp.PageContext;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.roller.RollerException;
@@ -57,8 +57,8 @@
 import org.apache.roller.ui.rendering.model.PlanetPageModel;
 import org.apache.roller.ui.rendering.model.SitePageModel;
 import org.apache.roller.ui.rendering.newsfeeds.NewsfeedCache;
+import org.apache.roller.ui.core.WeblogPageRequest;
 import org.apache.roller.util.RegexUtil;
-import org.apache.roller.util.Utilities;
 import org.apache.struts.util.RequestUtils;
 import org.apache.velocity.VelocityContext;
 import org.apache.velocity.tools.view.context.ChainedContext;
@@ -80,6 +80,7 @@
     private static final String TOOLBOX_MANAGER_KEY =
             "org.apache.roller.presentation.velocity.toolboxManager";
     
+
     /**
      * Setup the a Velocity context by loading it with objects, values, and
      * RollerPagePlugins needed for Roller page execution.
@@ -87,7 +88,7 @@
     public static void setupContext(
             Map                 ctx, 
             HttpServletRequest  request, 
-            HttpServletResponse response )
+            HttpServletResponse response)
             throws RollerException {
         
         mLogger.debug("setupContext( ctx = "+ctx+")");
@@ -95,6 +96,14 @@
         RollerRequest rreq = RollerRequest.getRollerRequest(request);
         RollerContext rollerCtx = RollerContext.getRollerContext( );
         
+        // if this is a weblog page request then parse it out
+        WeblogPageRequest pageRequest = null;
+        try {
+            pageRequest = new WeblogPageRequest(request);
+        } catch(Exception e) {
+            // ignored, just assume it's not a page request
+        }
+        
         try {
             // Add default page model object to context
             String pageModelClassName =
@@ -121,7 +130,9 @@
         }
         
         // Add Velocity page helper to context
-        OldPageHelper pageHelper = new OldPageHelper(request, response, ctx);
+        WebsiteData weblog = rreq.getWebsite();
+        PageContext pageContext = rreq.getPageContext();
+        OldPageHelper pageHelper = new OldPageHelper(request, response, ctx, weblog, pageContext,
pageRequest);
         Roller roller = RollerFactory.getRoller();
         ctx.put("pageHelper", pageHelper);
                 
@@ -362,7 +373,7 @@
         ctx.put("plainFormat", "yyyyMMdd");
         
         ctx.put("page",            TemplateWrapper.wrap(rreq.getPage()));
-        ctx.put("utilities",       new Utilities() );
+        ctx.put("utilities",       new OldUtilities() );
         ctx.put("stringUtils",     new OldStringUtils() );
         ctx.put("rollerVersion",   rollerCtx.getRollerVersion() );
         ctx.put("rollerBuildTime", rollerCtx.getRollerBuildTime() );
@@ -386,11 +397,11 @@
         HttpServletRequest request = rreq.getRequest();
         String url = null;
         if (website != null  && !"zzz_none_zzz".equals(website.getHandle())) {
-            url = Utilities.escapeHTML(
+            url = OldUtilities.escapeHTML(
                       rollerCtx.getAbsoluteContextUrl(request) 
                           + "/page/" + website.getHandle());
         } else {
-            url= Utilities.escapeHTML(rollerCtx.getAbsoluteContextUrl(request));
+            url= OldUtilities.escapeHTML(rollerCtx.getAbsoluteContextUrl(request));
         }
         ctx.put("websiteURL", url);
         ctx.put("baseURL",    rollerCtx.getContextUrl( request ) );

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/velocity/deprecated/OldPageHelper.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/velocity/deprecated/OldPageHelper.java?rev=415871&r1=415870&r2=415871&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/velocity/deprecated/OldPageHelper.java
(original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/velocity/deprecated/OldPageHelper.java
Tue Jun 20 18:57:47 2006
@@ -19,7 +19,7 @@
 package org.apache.roller.ui.rendering.velocity.deprecated;
 
 import java.net.MalformedURLException;
-import java.util.HashMap;
+import java.util.Date;
 import java.util.Hashtable;
 import java.util.Iterator;
 import java.util.List;
@@ -29,7 +29,6 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.jsp.PageContext;
-import org.apache.commons.lang.StringUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.struts.Globals;
@@ -52,6 +51,8 @@
 import org.apache.roller.ui.core.tags.menu.MenuTag;
 import org.apache.roller.ui.authoring.tags.BigWeblogCalendarModel;
 import org.apache.roller.ui.authoring.tags.WeblogCalendarModel;
+import org.apache.roller.ui.core.WeblogPageRequest;
+
 
 /**
  * Provides assistance to VelociMacros, filling in where Velocity falls.
@@ -60,36 +61,39 @@
     
     private static Log mLogger = LogFactory.getLog(OldPageHelper.class);
     
-    private Map              mVelocityContext = null;
-    private PageContext          mPageContext = null;
-    private HttpServletResponse  mResponse = null;
-    private RollerRequest        mRollerReq = null;
-    private Map                  mPagePlugins = null;  // Plugins keyed by name
-    private WebsiteData          mWebsite = null;
+    private PageContext mPageContext = null;
+    private HttpServletRequest mRequest = null;
+    private HttpServletResponse mResponse = null;
+    private RollerRequest mRollerReq = null;
+    private WeblogPageRequest mPageRequest = null;
+    private Map mPagePlugins = null;  // Plugins keyed by name
+    private WebsiteData mWebsite = null;
     
     
     /**
      * Initialize VelocityHelper, setting the variables it will be hiding from
      * the Velocimacros.
      */
-    public OldPageHelper(
-            HttpServletRequest request,
-            HttpServletResponse response,
-            Map ctx) throws RollerException {
+    public OldPageHelper(HttpServletRequest request,
+                      HttpServletResponse response,
+                      Map ctx,
+                      WebsiteData website,
+                      PageContext pageContext,
+                      WeblogPageRequest pageRequest) throws RollerException {
         
-        mVelocityContext = ctx;
+        // old roller request, going to be eoled
         mRollerReq = RollerRequest.getRollerRequest(request);
+        
+        // store the parsed page request
+        mPageRequest = pageRequest;
+        
+        mWebsite = website;
+        mPageContext = pageContext;
+        
+        // save original request and response objects
+        mRequest = request;
         mResponse = response;
-        if (mRollerReq != null) {
-            mPageContext = mRollerReq.getPageContext();
-            if (request.getAttribute(RollerRequest.OWNING_WEBSITE) != null) {
-                mWebsite = (WebsiteData)
-                request.getAttribute(RollerRequest.OWNING_WEBSITE);
-            } else if (mRollerReq.getWebsite() != null ) {
-                mWebsite = mRollerReq.getWebsite();
-            }
-        }
-        if (mVelocityContext == null) mVelocityContext = new HashMap();
+        
         Roller roller = RollerFactory.getRoller();
         PluginManager ppmgr = roller.getPagePluginManager();
         mPagePlugins = ppmgr.getWeblogEntryPlugins(mWebsite, ctx);
@@ -136,8 +140,7 @@
         } catch (MalformedURLException mue) {
             mLogger.warn("RollerRequest.editEntryUrl exception: ", mue);
         }
-        return
-                mRollerReq.getRequest().getContextPath() + "edtior/weblog.do?method=edit";
+        return mRequest.getContextPath() + "edtior/weblog.do?method=edit";
     }
     
     
@@ -146,9 +149,9 @@
         String link = null;
         try {
             RollerSession rollerSession =
-                    RollerSession.getRollerSession(mRollerReq.getRequest());
-            if ( mRollerReq.getWebsite() != null
-                    && rollerSession.isUserAuthorizedToAdmin(mRollerReq.getWebsite()))
{
+                    RollerSession.getRollerSession(mRequest);
+            if (mWebsite != null
+                    && rollerSession.isUserAuthorizedToAdmin(mWebsite)) {
                 Hashtable params = new Hashtable();
                 params.put( RollerRequest.REFERERID_KEY, referer.getId());
                 params.put( RollerRequest.WEBLOG_KEY, mWebsite.getHandle());
@@ -177,10 +180,10 @@
     public boolean isUserAuthorizedToEdit() {
         try {
             RollerSession rses =
-                    RollerSession.getRollerSession(mRollerReq.getRequest());
+                    RollerSession.getRollerSession(mRequest);
             if ( rses.getAuthenticatedUser() != null
-                    && mRollerReq.getWebsite() != null) {
-                return rses.isUserAuthorizedToAdmin(mRollerReq.getWebsite());
+                    && mWebsite != null) {
+                return rses.isUserAuthorizedToAdmin(mWebsite);
             }
         } catch (Exception e) {
             mLogger.warn("PageHelper.isUserAuthorizedToEdit)", e);
@@ -255,27 +258,26 @@
         if (OldWeblogPageModel.VELOCITY_NULL.equals(cat)) cat = null;
         String ret = null;
         try {
-            HttpServletRequest request =
-                    (HttpServletRequest) mRollerReq.getRequest();
             HttpServletResponse response = mResponse;
             
             String selfUrl = null;
-            String pageLink = mRollerReq.getPageLink();
+            String pageLink = mPageRequest.getWeblogPage();
             if ( pageLink != null ) {
-                selfUrl = request.getContextPath() + "/page/"
+                selfUrl = mRequest.getContextPath() + "/page/"
                         + mWebsite.getHandle() + "/"+pageLink;
             } else {
-                selfUrl = request.getContextPath()+"/page/" + mWebsite.getHandle();
+                selfUrl = mRequest.getContextPath()+"/page/" + mWebsite.getHandle();
             }
             
             // setup weblog calendar model
             CalendarModel model = null;
+            Date date = mRollerReq.getDate(true);
             if ( big ) {
                 model = new BigWeblogCalendarModel(
-                        mRollerReq, response, selfUrl, cat);
+                        mRequest, response, mWebsite, date, selfUrl, cat);
             } else {
                 model = new WeblogCalendarModel(
-                        mRollerReq, response, selfUrl, cat);
+                        mRequest, response, mWebsite, date, selfUrl, cat);
             }
             
             // save model in JSP page context so CalendarTag can find it
@@ -286,9 +288,7 @@
             calTag.setPageContext(mPageContext);
             calTag.setName("calendar");
             calTag.setModel("calendarModel");
-            //calTag.setLocale(mRollerReq.getWebsite().getLocaleInstance());
-            calTag.setLocale(LanguageUtil.getViewLocale(request));
-            //calTag.setTimeZone(mRollerReq.getWebsite().getTimeZoneInstance());
+            calTag.setLocale(LanguageUtil.getViewLocale(mRequest));
             if ( big ) {
                 calTag.setClassSuffix("Big");
             }
@@ -338,7 +338,7 @@
             }
         }
         
-        if (StringUtils.isNotEmpty(val1) && !val1.equals("null")) {
+        if (OldStringUtils.isNotEmpty(val1) && !val1.equals("null")) {
             params.clear();
             params.put("weblog", val1);
         }
@@ -362,11 +362,11 @@
     
     /**
      * Pass the String through any PagePlugins that have been
-     * assigned to the OldPageHelper, as selected by the Entry.
-     * 
+     * assigned to the PageHelper, as selected by the Entry.
+     *
      * @param entry Entry being rendered.
      * @param str   String to which plugins are to be applied.
-     * @return Result of applying plugins to str.
+     * @return      Result of applying plugins to str.
      */
     public String renderPlugins(WeblogEntryDataWrapper entry, String str) {
         String ret = str;
@@ -376,12 +376,6 @@
             List entryPlugins = entry.getPluginsList();
             // if no Entry plugins, don't bother looping.
             if (entryPlugins != null && !entryPlugins.isEmpty()) {
-                // need to do this to tell ReadMore not to do its job
-                // if we are in the "view one Entry" page.
-                boolean singleEntry = false;
-                if (mRollerReq == null || mRollerReq.getWeblogEntry() != null) {
-                    singleEntry = true;
-                }
                 
                 // now loop over mPagePlugins, matching
                 // against Entry plugins (by name):
@@ -418,9 +412,9 @@
      */
     public Locale[] getSupportedLanguages() {
         Locale currentLocale =
-                (Locale) mRollerReq.getRequest().getSession().getAttribute(Globals.LOCALE_KEY);
+                (Locale) mRequest.getSession().getAttribute(Globals.LOCALE_KEY);
         if (currentLocale==null) {
-            currentLocale = mRollerReq.getRequest().getLocale();
+            currentLocale = mRequest.getLocale();
         }
         
         Locale[] supportedLanguages =
@@ -448,18 +442,17 @@
      * @return relative URL to page, starting with /username
      */
     public String getPathInfo() {
-        return mRollerReq.getPathInfo();
+        String pathInfo = mRequest.getPathInfo();
+        if(pathInfo == null) {
+            pathInfo = "";
+        }
+        
+        return pathInfo;
     }
     
     
     public String getCommentAuthenticatorHtml() {
-        /* no longer used -- Allen G
-        RollerContext rctx =
-            RollerContext.getRollerContext(mRollerReq.getRequest());
-        return rctx.getCommentAuthenticator().getHtml(
-            mVelocityContext, mRollerReq.getRequest(), mResponse);
-         */
-        
+        // deprecated, does nothing now
         return "";
     }
     



Mime
View raw message