roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agillil...@apache.org
Subject svn commit: r416531 - /incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/PageRenderModel.java
Date Fri, 23 Jun 2006 00:30:54 GMT
Author: agilliland
Date: Thu Jun 22 17:30:54 2006
New Revision: 416531

URL: http://svn.apache.org/viewvc?rev=416531&view=rev
Log:
changing PageRenderModel init() method to expect a "pageRequest" object as part of its init
data rather than having it construct that itself.  this is better because it isn't actually
reliant on the servlet request object. 


Modified:
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/PageRenderModel.java

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/PageRenderModel.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/PageRenderModel.java?rev=416531&r1=416530&r2=416531&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/PageRenderModel.java
(original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/model/PageRenderModel.java
Thu Jun 22 17:30:54 2006
@@ -77,9 +77,17 @@
     }
     
     /** Init page model based on request */
-    public void init(Map map) throws RollerException {
-        HttpServletRequest request = (HttpServletRequest)map.get("request");
-        WeblogPageRequest parsed = new WeblogPageRequest(request);
+    public void init(Map initData) throws RollerException {
+        
+        HttpServletRequest request = (HttpServletRequest) initData.get("request");
+        this.request = request;
+        
+        // we expect the init data to contain a pageRequest object
+        WeblogPageRequest parsed = (WeblogPageRequest) initData.get("pageRequest");
+        if(parsed == null) {
+            throw new RollerException("expected pageRequest from init data");
+        }
+        
         categoryPath = parsed.getWeblogCategory();
         entryAnchor = parsed.getWeblogAnchor();
         dateString = parsed.getWeblogDate();



Mime
View raw message